org.glassfish.grizzly
Class ProcessorRunnable

java.lang.Object
  extended by org.glassfish.grizzly.ProcessorRunnable
All Implemented Interfaces:
Runnable

public class ProcessorRunnable
extends Object
implements Runnable

Runnable task, which encapsulates Processor execution information and actually runs Processor to process occured IOEvent. Usually ProcessorRunnable task is constructed by Transport and passed to Strategy, which makes decision how this task should be executed.

Author:
Alexey Stashok

Constructor Summary
ProcessorRunnable(Context context)
           
ProcessorRunnable(IOEvent ioEvent, Connection connection, Processor processor, PostProcessor postProcessor)
           
 
Method Summary
protected  void createContext()
          Create Context instance.
 Connection getConnection()
          Get the processing Connection.
 Context getContext()
          Get the processing Context.
 IOEvent getIoEvent()
          Get the processing IOEvent.
 PostProcessor getPostProcessor()
          Get the PostProcessor, which will be called after Processor will finish its execution to finish IOEvent processing.
 Processor getProcessor()
          Get the Processor, which is responsible to process the IOEvent.
protected  void initContext()
          Initialize Context with task's settings.
 boolean isSuspended()
          Returns true is task was suspended (terminated, but not completed), so it's possible to resume task processing.
 void run()
          Runs the IOEvent processing.
 void setConnection(Connection connection)
          Set the processing Connection.
 void setContext(Context context)
          Set the processing Context.
 void setIoEvent(IOEvent ioEvent)
          Set the processing IOEvent.
 void setPostProcessor(PostProcessor ioEventPostProcessor)
          Set the PostProcessor, which will be called after Processor will finish its execution to finish IOEvent processing.
 void setProcessor(Processor processor)
          Set the Processor, which is responsible to process the IOEvent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessorRunnable

public ProcessorRunnable(Context context)

ProcessorRunnable

public ProcessorRunnable(IOEvent ioEvent,
                         Connection connection,
                         Processor processor,
                         PostProcessor postProcessor)
Method Detail

isSuspended

public boolean isSuspended()
Returns true is task was suspended (terminated, but not completed), so it's possible to resume task processing. Fasle will be returned otherwise.

Returns:
true is task was suspended, or fasle will be returned otherwise.

getIoEvent

public IOEvent getIoEvent()
Get the processing IOEvent.

Returns:
the processing IOEvent.

setIoEvent

public void setIoEvent(IOEvent ioEvent)
Set the processing IOEvent.

Parameters:
ioEvent - the processing IOEvent.

getConnection

public Connection getConnection()
Get the processing Connection.

Returns:
the processing Connection.

setConnection

public void setConnection(Connection connection)
Set the processing Connection.

Parameters:
connection - the processing Connection.

getProcessor

public Processor getProcessor()
Get the Processor, which is responsible to process the IOEvent.

Returns:
the Processor, which is responsible to process the IOEvent.

setProcessor

public void setProcessor(Processor processor)
Set the Processor, which is responsible to process the IOEvent.

Parameters:
processor - the Processor, which is responsible to process the IOEvent.

getPostProcessor

public PostProcessor getPostProcessor()
Get the PostProcessor, which will be called after Processor will finish its execution to finish IOEvent processing.

Returns:
the PostProcessor, which will be called after Processor will finish its execution to finish IOEvent processing.

setPostProcessor

public void setPostProcessor(PostProcessor ioEventPostProcessor)
Set the PostProcessor, which will be called after Processor will finish its execution to finish IOEvent processing.

Parameters:
ioEventPostProcessor - the PostProcessor, which will be called after Processor will finish its execution to finish IOEvent processing.

getContext

public Context getContext()
Get the processing Context.

Returns:
the processing Context.

setContext

public void setContext(Context context)
Set the processing Context.

Parameters:
context - the processing Context.

run

public void run()
Runs the IOEvent processing.

Specified by:
run in interface Runnable

createContext

protected void createContext()
Create Context instance.


initContext

protected void initContext()
Initialize Context with task's settings.



Copyright © 2009 SUN Microsystems. All Rights Reserved.