public class Context extends Object implements AttributeStorage, Cacheable
Modifier and Type | Class and Description |
---|---|
protected class |
Context.MinimalisticArrayList<E> |
Modifier and Type | Field and Description |
---|---|
protected IOEvent |
ioEvent
Processing IOEvent
|
protected boolean |
isManualIOEventControl |
protected Context.MinimalisticArrayList<IOEventLifeCycleListener> |
lifeCycleListeners
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 |
addLifeCycleListener(IOEventLifeCycleListener listener) |
void |
complete(ProcessorResult result) |
static Context |
create(Connection connection) |
static Context |
create(Connection connection,
Processor processor,
IOEvent ioEvent,
IOEventLifeCycleListener lifeCycleListener) |
AttributeHolder |
getAttributes()
Get attributes (
AttributeHolder ), associated with the processing
Context . |
Connection |
getConnection()
Get the processing
Connection . |
IOEvent |
getIoEvent()
Get the processing
IOEvent . |
Processor |
getProcessor()
|
boolean |
hasLifeCycleListener(IOEventLifeCycleListener listener) |
boolean |
isManualIOEventControl() |
void |
recycle()
Recycle this
Context |
void |
removeAllLifeCycleListeners() |
boolean |
removeLifeCycleListener(IOEventLifeCycleListener listener) |
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 |
setManualIOEventControl()
Switches processing to the manual IOEvent control.
|
void |
setProcessor(Processor processor)
|
void |
suspend()
Notify Context its processing will be suspended in the current thread.
|
boolean |
wasSuspended() |
protected IOEvent ioEvent
protected final Context.MinimalisticArrayList<IOEventLifeCycleListener> lifeCycleListeners
protected boolean wasSuspended
protected boolean isManualIOEventControl
public static Context create(Connection connection)
public static Context create(Connection connection, Processor processor, IOEvent ioEvent, IOEventLifeCycleListener lifeCycleListener)
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 Connection getConnection()
Connection
.Connection
.public void setConnection(Connection connection)
Connection
.connection
- the processing Connection
.public Processor getProcessor()
public void setProcessor(Processor processor)
public boolean hasLifeCycleListener(IOEventLifeCycleListener listener)
public void addLifeCycleListener(IOEventLifeCycleListener listener)
public boolean removeLifeCycleListener(IOEventLifeCycleListener listener)
public void removeAllLifeCycleListeners()
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 © 2015 Oracle Corporation. All rights reserved.