|
||||||||||
| 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 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 FutureImpl<FilterChainContext> |
operationCompletionFuture
FutureImpl, which will be notified, when operation will be
complete. |
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 |
completeAndRecycle()
|
|
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()
|
|
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()
|
|
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. |
|
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,
MessageCloner cloner)
|
|
void |
write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
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 FutureImpl<FilterChainContext> operationCompletionFuture
FutureImpl, 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 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 getSuspendingStopAction()
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)
throws java.io.IOException
java.io.IOException
public void write(java.lang.Object message,
boolean blocking)
throws java.io.IOException
java.io.IOException
public void write(java.lang.Object message,
CompletionHandler<WriteResult> completionHandler)
throws java.io.IOException
java.io.IOException
public void write(java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
boolean blocking)
throws java.io.IOException
java.io.IOException
public void write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler)
throws java.io.IOException
java.io.IOException
public void write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
boolean blocking)
throws java.io.IOException
java.io.IOException
public void write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
MessageCloner cloner)
throws java.io.IOException
java.io.IOException
public void write(java.lang.Object address,
java.lang.Object message,
CompletionHandler<WriteResult> completionHandler,
MessageCloner cloner,
boolean blocking)
throws java.io.IOException
java.io.IOException
public void flush(CompletionHandler completionHandler)
throws java.io.IOException
java.io.IOException
public void notifyUpstream(FilterChainEvent event)
throws java.io.IOException
java.io.IOException
public void notifyUpstream(FilterChainEvent event,
CompletionHandler<FilterChainContext> completionHandler)
throws java.io.IOException
java.io.IOException
public void notifyDownstream(FilterChainEvent event)
throws java.io.IOException
java.io.IOException
public void notifyDownstream(FilterChainEvent event,
CompletionHandler<FilterChainContext> completionHandler)
throws java.io.IOException
java.io.IOExceptionpublic 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 MemoryManager getMemoryManager()
A simple alias for FilterChainContext.getConnection().getTransport().getMemoryManager().
MemoryManager associated with the Connection
of this FilterChainContext.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 | |||||||||