com.sun.grizzly.utils
Class ProcessorWrapper<E extends Context>

java.lang.Object
  extended by com.sun.grizzly.utils.ProcessorWrapper<E>
All Implemented Interfaces:
Processor<E>

public class ProcessorWrapper<E extends Context>
extends Object
implements Processor<E>

Processor, which redirects all calls to internal Processor instance;

Author:
Alexey Stashok

Constructor Summary
ProcessorWrapper(Processor<E> internalProcessor)
           
 
Method Summary
 void afterProcess(E context)
          Method will be called by framework after Processor execution, so it can release associated resources.
 void beforeProcess(E context)
          Method will be called by framework before executing this Processor.
 E context()
          Creates Context
 boolean isInterested(IOEvent ioEvent)
          Is this Processor interested in processing the i/o event
 ProcessorResult process(E context)
          Method will be called by framework to process some event, which occured on a connection
 void setInterested(IOEvent ioEvent, boolean isInterested)
          Set the the i/o event, this Processor is interested in
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessorWrapper

public ProcessorWrapper(Processor<E> internalProcessor)
Method Detail

context

public E context()
Description copied from interface: Processor
Creates Context

Specified by:
context in interface Processor<E extends Context>
Returns:
Context, or null, if default Context could be used.

beforeProcess

public void beforeProcess(E context)
                   throws IOException
Description copied from interface: Processor
Method will be called by framework before executing this Processor.

Specified by:
beforeProcess in interface Processor<E extends Context>
Parameters:
context - processing context
Throws:
IOException

process

public ProcessorResult process(E context)
                        throws IOException
Description copied from interface: Processor
Method will be called by framework to process some event, which occured on a connection

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

afterProcess

public void afterProcess(E context)
                  throws IOException
Description copied from interface: Processor
Method will be called by framework after Processor execution, so it can release associated resources.

Specified by:
afterProcess in interface Processor<E extends Context>
Parameters:
context - processing context
Throws:
IOException

isInterested

public boolean isInterested(IOEvent ioEvent)
Description copied from interface: Processor
Is this Processor interested in processing the i/o event

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

setInterested

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

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


Copyright © 2009 SUN Microsystems. All Rights Reserved.