com.sun.grizzly.callbackhandler
Class AbstractCallbackHandler

java.lang.Object
  extended by com.sun.grizzly.AbstractProcessor
      extended by com.sun.grizzly.callbackhandler.AbstractCallbackHandler
All Implemented Interfaces:
CallbackHandler, Processor
Direct Known Subclasses:
CallbackHandlerAdapter

public abstract class AbstractCallbackHandler
extends AbstractProcessor
implements CallbackHandler

Base CallbackHandler implementation, which delegates Processor.process(Context) call to appropriate CallbackHandler method.

Author:
Alexey Stashok
See Also:
CallbackHandler

Field Summary
protected  IOEventMask interestedIoEventsMask
           
 
Constructor Summary
AbstractCallbackHandler()
           
 
Method Summary
 boolean isInterested(IOEvent ioEvent)
          Is this Processor interested in processing the i/o event
 ProcessorResult process(Context context)
          Delegate IOEvent processing to appropriate CallbackHandler method.
 void setInterested(IOEvent ioEvent, boolean isInterested)
          Set the the i/o event, this Processor is interested in
 
Methods inherited from class com.sun.grizzly.AbstractProcessor
afterProcess, beforeProcess, context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.grizzly.callbackhandler.CallbackHandler
onAccept, onClose, onConnect, onRead, onWrite
 
Methods inherited from interface com.sun.grizzly.Processor
afterProcess, beforeProcess, context
 

Field Detail

interestedIoEventsMask

protected IOEventMask interestedIoEventsMask
Constructor Detail

AbstractCallbackHandler

public AbstractCallbackHandler()
Method Detail

isInterested

public boolean isInterested(IOEvent ioEvent)
Is this Processor interested in processing the i/o event

Specified by:
isInterested in interface Processor
Returns:
true, if this Processor is interested and execution process will start, false otherwise.

setInterested

public void setInterested(IOEvent ioEvent,
                          boolean isInterested)
Set the the i/o event, this Processor is interested in

Specified by:
setInterested in interface Processor
Parameters:
ioEvent - IOEvent
isInterested - true, if Processor is interested in processing of the I/O event, or false otherwise.

process

public ProcessorResult process(Context context)
                        throws IOException
Delegate IOEvent processing to appropriate CallbackHandler method.

Specified by:
process in interface Processor
Parameters:
context - processing context
Returns:
the result of I/O event processing
Throws:
IOException


Copyright © 2009 SUN Microsystems. All Rights Reserved.