org.glassfish.grizzly
Interface Processor<E extends Context>

All Known Subinterfaces:
FilterChain
All Known Implementing Classes:
AbstractFilterChain, DefaultFilterChain, ListFacadeFilterChain, StandaloneProcessor

public interface Processor<E extends Context>

Processor implementations are responsible for processing I/O events, which occur on connection.

Author:
Alexey Stashok

Method Summary
 boolean isInterested(IOEvent ioEvent)
          Is this Processor interested in processing the i/o event
 E obtainContext(Connection connection)
          Creates Context
 ProcessorResult process(E context)
          Method will be called by framework to process some event, which occurred on a connection
 void read(Connection connection, CompletionHandler<ReadResult> completionHandler)
           
 void setInterested(IOEvent ioEvent, boolean isInterested)
          Set the the i/o event, this Processor is interested in
 void write(Connection connection, Object dstAddress, Object message, CompletionHandler<WriteResult> completionHandler, PushBackHandler pushBackHandler)
           
 

Method Detail

obtainContext

E obtainContext(Connection connection)
Creates Context

Parameters:
connection - Connection to obtain processor for.
Returns:
Context, or null, if default Context could be used.

process

ProcessorResult process(E context)
Method will be called by framework to process some event, which occurred on a connection

Parameters:
context - processing context
Returns:
the result of I/O event processing

read

void read(Connection connection,
          CompletionHandler<ReadResult> completionHandler)

write

void write(Connection connection,
           Object dstAddress,
           Object message,
           CompletionHandler<WriteResult> completionHandler,
           PushBackHandler pushBackHandler)

isInterested

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

Parameters:
ioEvent -
Returns:
true, if this Processor is interested and execution process will start, false otherwise.

setInterested

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

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


Copyright © 2013 Oracle Corporation. All Rights Reserved.