This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes callback and inline methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "callback and inline methods" Watch "callback and inline methods" New topic
Author

callback and inline methods

shanthisri mocherla
Ranch Hand

Joined: Sep 05, 2005
Posts: 119
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
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
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


Java API Documentation
The Java Tutorial
shanthisri mocherla
Ranch Hand

Joined: Sep 05, 2005
Posts: 119
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
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

"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)


A good workman is known by his tools.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: callback and inline methods
 
Similar Threads
Container callback and inline methods
callback and inline method doubt
Container Callback method doubt
What is a callback method?
doFilter method