Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

callback and inline methods

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can anyone tell me what is meant by callback methods and inline methods?
i found that doFilter() is both a callback and inline method.
and destroy() is always a callback method.

what does it mean??
shanthisri
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this do with SCWCD? And which classes do these methods come from?

I don't think I've ever heard of inline methods in Java. In C++, these are methods that are copied verbatim by the compiler where they are called instead of generated machine code for a function call. I don't think Java has any similar concept.

As for callback methods, these are methods that are typically called by some code that you didn't write. For example, in GUI programming with Swing, it is common to create an event listener such as an ActionListener. In this interface, actionPerformed() is considered a callback function because it is usually called by code in the Java API that deals with the event queue.

Layne
 
shanthisri mocherla
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Layne

i found them in the Filters chapter (coffee cram questions at the end of the chapter)in HeadFirstServlets and JSP book.

Thanks
shanthi
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"container callback" simply means that the container invokes the method. (The term is used a lot in HFEJB, by the way!)

"inline method" here means you call it.

You and the container both call doFilter().
Only the container should call destroy().

Filters also have another container callback method: init(FilterConfig)
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic