|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.filterchain.FilterChainContext
public final class FilterChainContext
FilterChain Context implementation.
Context,
FilterChain| Nested Class Summary | |
|---|---|
static interface |
FilterChainContext.CompletionListener
The interface, which represents a listener, which will be notified, once FilterChainContext processing is complete. |
static interface |
FilterChainContext.CopyListener
The interface, which represents a listener, which will be notified, after copy() is called. |
static class |
FilterChainContext.Operation
|
static class |
FilterChainContext.State
|
static class |
FilterChainContext.TransportContext
|
| Field Summary | |
|---|---|
protected FilterChainEvent |
event
Context associated event, if EVENT operation |
static int |
NO_FILTER_INDEX
|
protected CompletionHandler<FilterChainContext> |
operationCompletionHandler
CompletionHandler, which will be notified, when operation will be
complete. |
| Constructor Summary | |
|---|---|
FilterChainContext()
|
|
| Method Summary | ||
|---|---|---|
void |
addCompletionListener(FilterChainContext.CompletionListener listener)
Add the FilterChainContext.CompletionListener, which will be notified, when
this FilterChainContext processing will be completed. |
|
void |
addCopyListener(FilterChainContext.CopyListener listener)
Add the FilterChainContext.CopyListener, which will be notified, right after
this copy() is called. |
|
void |
completeAndRecycle()
|
|
FilterChainContext |
copy()
|
|
static FilterChainContext |
create(Connection connection)
|
|
void |
fail(java.lang.Throwable error)
|
|
void |
flush(CompletionHandler completionHandler)
|
|
java.lang.Object |
getAddress()
Get address, associated with the current IOEvent processing. |
|
AttributeHolder |
getAttributes()
Get associated AttributeHolder. |
|
Connection |
getConnection()
Get the Connection, associated with the current processing. |
|
int |
getEndIdx()
|
|
FilterChain |
getFilterChain()
Get FilterChain, which runs the Filter. |
|
int |
getFilterIdx()
|
|
NextAction |
getForkAction()
|
|
Context |
getInternalContext()
Get the general Grizzly Context this filter context wraps. |
|
NextAction |
getInvokeAction()
Get NextAction implementation, which instructs FilterChain to
process next Filter in chain. |
|
NextAction |
getInvokeAction(java.lang.Object remainder)
Get NextAction implementation, which instructs FilterChain to
process next Filter in chain. |
|
MemoryManager |
getMemoryManager()
A simple alias for FilterChainContext.getConnection().getTransport().getMemoryManager(). |
|
|
getMessage()
Get message object, associated with the current processing. |
|
NextAction |
getRerunFilterAction()
Get NextAction, which instructs FilterChain to rerun the
filter. |
|
protected java.lang.Runnable |
getRunnable()
|
|
int |
getStartIdx()
|
|
NextAction |
getStopAction()
Get NextAction implementation, which instructs FilterChain
to stop executing phase. |
|
NextAction |
getStopAction(Appendable appendable)
Get NextAction implementation, which instructs FilterChain
stop executing phase. |
|
|
getStopAction(E remainder,
Appender<E> appender)
Get NextAction implementation, which instructs FilterChain
stop executing phase. |
|
NextAction |
getStopAction(java.lang.Object unknownObject)
Get NextAction implementation, which instructs FilterChain
stop executing phase. |
|
NextAction |
getSuspendAction()
Get NextAction, which instructs FilterChain to suspend filter
chain execution. |
|
NextAction |
getSuspendingStopAction()
Deprecated. use getForkAction() |
|
FilterChainContext.TransportContext |
getTransportContext()
Get the TransportFilter related context. |
|
int |
nextFilterIdx()
|
|
void |
notifyDownstream(FilterChainEvent event)
|
|
void |
notifyDownstream(FilterChainEvent event,
CompletionHandler<FilterChainContext> completionHandler)
|
|
void |
notifyUpstream(FilterChainEvent event)
|
|
void |
notifyUpstream(FilterChainEvent event,
CompletionHandler<FilterChainContext> completionHandler)
|
|
int |
previousFilterIdx()
|
|
ReadResult |
read()
Performs a blocking read. |
|
boolean |
removeCompletionListener(FilterChainContext.CompletionListener listener)
Remove the FilterChainContext.CompletionListener. |
|
boolean |
removeCopyListener(FilterChainContext.CopyListener listener)
Remove the FilterChainContext.CopyListener. |
|
void |
reset()
Release the context associated resources. |
|
void |
resume()
Resume processing of the current task |
|
void |
setAddress(java.lang.Object address)
Set address, associated with the current IOEvent processing. |
|
void |
setEndIdx(int endIdx)
|
|
void |
setFilterIdx(int index)
|
|
void |
setMessage(java.lang.Object message)
Set message object, associated with the current processing. |
|
void |
setStartIdx(int startIdx)
|
|
FilterChainContext.State |
state()
Get the current processing task state. |
|
java.lang.Runnable |
suspend()
Suspend processing of the current task |
|
java.lang.String |
toString()
|
|
void |
write(java.lang.Object message)
|
|
void |
write(java.lang.Object message,
boolean blocking)
|
|
void |
write(java.lang.Object message,
CompletionHandler<WriteResult> completionHandler)
|
|
void |
write(java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
boolean blocking)
|
|
void |
write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler)
|
|
void |
write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
boolean blocking)
|
|
void |
write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
PushBackHandler pushBackHandler)
|
|
void |
write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
PushBackHandler pushBackHandler,
boolean blocking)
|
|
void |
write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
PushBackHandler pushBackHandler,
MessageCloner cloner)
|
|
void |
write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
PushBackHandler pushBackHandler,
MessageCloner cloner,
boolean blocking)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_FILTER_INDEX
protected CompletionHandler<FilterChainContext> operationCompletionHandler
CompletionHandler, which will be notified, when operation will be
complete. For WRITE it means the data will be written on wire, for other
operations - the last Filter has finished the processing.
protected FilterChainEvent event
| Constructor Detail |
|---|
public FilterChainContext()
| Method Detail |
|---|
public static FilterChainContext create(Connection connection)
public java.lang.Runnable suspend()
public void resume()
public FilterChainContext.State state()
public int nextFilterIdx()
public int previousFilterIdx()
public int getFilterIdx()
public void setFilterIdx(int index)
public int getStartIdx()
public void setStartIdx(int startIdx)
public int getEndIdx()
public void setEndIdx(int endIdx)
public FilterChain getFilterChain()
FilterChain, which runs the Filter.
FilterChain, which runs the Filter.public Connection getConnection()
Connection, associated with the current processing.
Connection object, associated with the current processing.public <T> T getMessage()
FilterChain represents sequence of parser and process
Filters. Each parser can change the message representation until
it will come to processor Filter.
public void setMessage(java.lang.Object message)
FilterChain represents sequence of parser and process
Filters. Each parser can change the message representation until
it will come to processor Filter.
message - message object, associated with the current processing.public java.lang.Object getAddress()
IOEvent processing.
When we process IOEvent.READ event - it represents sender address,
or when process IOEvent.WRITE - address of receiver.
IOEvent processing.public void setAddress(java.lang.Object address)
IOEvent processing.
When we process IOEvent.READ event - it represents sender address,
or when process IOEvent.WRITE - address of receiver.
address - address, associated with the current IOEvent processing.protected final java.lang.Runnable getRunnable()
public FilterChainContext.TransportContext getTransportContext()
TransportFilter related context.
TransportFilter.public final Context getInternalContext()
Context this filter context wraps.
Context this filter context wraps.public NextAction getInvokeAction(java.lang.Object remainder)
NextAction implementation, which instructs FilterChain to
process next Filter in chain. Parameter remaining signals, that
there is some data remaining in the source message, so FilterChain
could be rerun.
Normally, after receiving this instruction from Filter,
FilterChain executes next filter.
remainder - signals, that there is some data remaining in the source
message, so FilterChain could be rerun.
NextAction implementation, which instructs FilterChain to
process next Filter in chain.public NextAction getInvokeAction()
NextAction implementation, which instructs FilterChain to
process next Filter in chain.
Normally, after receiving this instruction from Filter,
FilterChain executes next filter.
NextAction implementation, which instructs FilterChain to
process next Filter in chain.public NextAction getStopAction()
NextAction implementation, which instructs FilterChain
to stop executing phase.
NextAction implementation, which instructs FilterChain
to stop executing phase.public NextAction getForkAction()
NextAction implementation, which instructs the FilterChain
to suspend the current FilterChainContext, but does not disable
correspondent IOEvent, so if the same IOEvent occurs on
the Connection - it will be processed using new
FilterChainContext.public NextAction getSuspendingStopAction()
getForkAction()
NextAction implementation, which instructs the FilterChain
to suspend the current FilterChainContext and invoke similar logic
as instructed by StopAction with a clean FilterChainContext.
public <E> NextAction getStopAction(E remainder,
Appender<E> appender)
NextAction implementation, which instructs FilterChain
stop executing phase.
Passed Appendable data will be saved and reused
during the next FilterChain invocation.
NextAction implementation, which instructs FilterChain
to stop executing phase.
Passed Appendable data will be saved and reused
during the next FilterChain invocation.public NextAction getStopAction(Appendable appendable)
NextAction implementation, which instructs FilterChain
stop executing phase.
Passed Appendable data will be saved and reused
during the next FilterChain invocation.
NextAction implementation, which instructs FilterChain
to stop executing phase.
Passed Appendable data will be saved and reused
during the next FilterChain invocation.public NextAction getStopAction(java.lang.Object unknownObject)
NextAction implementation, which instructs FilterChain
stop executing phase.
Passed Buffer data will be saved and reused during the next
FilterChain invocation.
NextAction implementation, which instructs FilterChain
to stop executing phase.
Passed Buffer data will be saved and reused during the next
FilterChain invocation.public NextAction getSuspendAction()
NextAction, which instructs FilterChain to suspend filter
chain execution.
NextAction, which instructs FilterChain to suspend
filter chain execution.public NextAction getRerunFilterAction()
NextAction, which instructs FilterChain to rerun the
filter.
NextAction, which instructs FilterChain to rerun the
filter.
public ReadResult read()
throws java.io.IOException
Performs a blocking read.
java.io.IOException - if an I/O error occurs.public void write(java.lang.Object message)
public void write(java.lang.Object message,
boolean blocking)
public void write(java.lang.Object message,
CompletionHandler<WriteResult> completionHandler)
public void write(java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
boolean blocking)
public void write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler)
public void write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
boolean blocking)
public void write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
PushBackHandler pushBackHandler)
public void write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
PushBackHandler pushBackHandler,
boolean blocking)
public void write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
PushBackHandler pushBackHandler,
MessageCloner cloner)
public void write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
PushBackHandler pushBackHandler,
MessageCloner cloner,
boolean blocking)
public void flush(CompletionHandler completionHandler)
public void notifyUpstream(FilterChainEvent event)
public void notifyUpstream(FilterChainEvent event,
CompletionHandler<FilterChainContext> completionHandler)
public void notifyDownstream(FilterChainEvent event)
public void notifyDownstream(FilterChainEvent event,
CompletionHandler<FilterChainContext> completionHandler)
public void fail(java.lang.Throwable error)
public AttributeHolder getAttributes()
AttributeHolder.
Implementation may return null if AttributeHolder wasn't
initialized yet.
getAttributes in interface AttributeStorageAttributeHolder.
Implementation may return null if AttributeHolder wasn't
initialized yet.public final void addCompletionListener(FilterChainContext.CompletionListener listener)
FilterChainContext.CompletionListener, which will be notified, when
this FilterChainContext processing will be completed.
listener - the FilterChainContext.CompletionListener, which will be notified, when
this FilterChainContext processing will be completed.public final boolean removeCompletionListener(FilterChainContext.CompletionListener listener)
FilterChainContext.CompletionListener.
listener - the FilterChainContext.CompletionListener to be removed.
public final void addCopyListener(FilterChainContext.CopyListener listener)
FilterChainContext.CopyListener, which will be notified, right after
this copy() is called.
listener - the FilterChainContext.CopyListener, which will be notified, right
after this copy() is called.public final boolean removeCopyListener(FilterChainContext.CopyListener listener)
FilterChainContext.CopyListener.
listener - the FilterChainContext.CopyListener to be removed.
public final MemoryManager getMemoryManager()
A simple alias for FilterChainContext.getConnection().getTransport().getMemoryManager().
MemoryManager associated with the Connection
of this FilterChainContext.public FilterChainContext copy()
public void reset()
public void completeAndRecycle()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||