public class Context extends Object implements AttributeStorage, Cacheable
Modifier and Type | Field and Description |
---|---|
protected IOEvent |
ioEvent
Processing IOEvent
|
protected boolean |
isManualIOEventControl |
protected IOEventProcessingHandler |
processingHandler
IOEventProcessingHandler is called to notify about IOEvent processing
life-cycle events like suspend, resume, complete.
|
protected boolean |
wasSuspended
true if this IOEvent processing was suspended during its processing,
or false otherwise.
|
Constructor and Description |
---|
Context() |
Modifier and Type | Method and Description |
---|---|
void |
complete(ProcessorResult result) |
static Context |
create(Connection connection) |
static Context |
create(Connection connection,
Processor processor,
IOEvent ioEvent,
IOEventProcessingHandler processingHandler) |
AttributeHolder |
getAttributes()
Get attributes (
AttributeHolder ), associated with the processing
Context . |
Connection |
getConnection()
Get the processing
Connection . |
IOEvent |
getIoEvent()
Get the processing
IOEvent . |
IOEventProcessingHandler |
getProcessingHandler() |
Processor |
getProcessor()
|
boolean |
isManualIOEventControl() |
void |
recycle()
Recycle this
Context |
void |
reset()
If implementation uses
ObjectPool
to store and reuse Context instances - this method will be
called before Context will be offered to pool. |
void |
resume()
Notify Context its processing will be resumed in the current thread.
|
void |
setConnection(Connection connection)
Set the processing
Connection . |
void |
setIoEvent(IOEvent ioEvent)
Set the processing
IOEvent . |
void |
setIoEvent(IOEvent event,
IOEventProcessingHandler handler)
Set the processing
IOEvent . |
void |
setManualIOEventControl()
Switches processing to the manual IOEvent control.
|
void |
setProcessingHandler(IOEventProcessingHandler processingHandler) |
void |
setProcessor(Processor processor)
|
void |
suspend()
Notify Context its processing will be suspended in the current thread.
|
boolean |
wasSuspended() |
protected IOEvent ioEvent
protected IOEventProcessingHandler processingHandler
protected boolean wasSuspended
protected boolean isManualIOEventControl
public static Context create(Connection connection)
public static Context create(Connection connection, Processor processor, IOEvent ioEvent, IOEventProcessingHandler processingHandler)
public void suspend()
public void resume()
public void complete(ProcessorResult result)
public boolean wasSuspended()
public void setManualIOEventControl()
Connection.enableIOEvent(org.glassfish.grizzly.IOEvent)
or
Connection.disableIOEvent(org.glassfish.grizzly.IOEvent)
might be
explicitly called.public boolean isManualIOEventControl()
public void setIoEvent(IOEvent ioEvent)
IOEvent
.ioEvent
- the processing IOEvent
.public void setIoEvent(IOEvent event, IOEventProcessingHandler handler)
IOEvent
.event
- the processing IOEvent
.handler
- the IOEventProcessingHandler
to handle context's life-cycle events.public Connection getConnection()
Connection
.Connection
.public void setConnection(Connection connection)
Connection
.connection
- the processing Connection
.public Processor getProcessor()
public void setProcessor(Processor processor)
public IOEventProcessingHandler getProcessingHandler()
public void setProcessingHandler(IOEventProcessingHandler processingHandler)
public AttributeHolder getAttributes()
AttributeHolder
), associated with the processing
Context
. AttributeHolder
is cleared after each I/O event
processing.
Method may return null, if there were no attributes added before.getAttributes
in interface AttributeStorage
AttributeHolder
), associated with the processing
Context
.public void reset()
ObjectPool
to store and reuse Context
instances - this method will be
called before Context
will be offered to pool.Copyright © 2014 Oracle Corporation. All rights reserved.