Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What are callback and inline methods.

 
Charmy Madhvani
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have come across the terms callback and inline in Filters chapter. Just wanted to know the definitions of each.

Whether the following methods are callback or not?
doGet,doPost,init and destroy(both in Filters and jsps/servlets), doFilter


Any examples of inline methods?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Callback methods are methods which will be called by the container (you don't call them). Like doPost, doGet of a servlet. Inline methods, although I do not like that term, are all other methods.
 
Charmy Madhvani
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So should I say that Filter's doFilter method is a callback method but FilterChain's doFilter method is an inline?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Filter's doFilter method is called by the container, but it's your role to call the FilterChain's doFilter method.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!