|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mina.core.filterchain.IoFilterAdapter
org.apache.mina.filter.util.WriteRequestFilter
org.apache.mina.filter.reqres.RequestResponseFilter
public class RequestResponseFilter
TODO Add documentation
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.mina.core.filterchain.IoFilter |
|---|
IoFilter.NextFilter |
| Constructor Summary | |
|---|---|
RequestResponseFilter(ResponseInspectorFactory responseInspectorFactory,
ScheduledExecutorService timeoutScheduler)
|
|
RequestResponseFilter(ResponseInspector responseInspector,
ScheduledExecutorService timeoutScheduler)
|
|
| Method Summary | |
|---|---|
protected Map<Object,Request> |
createRequestStore(IoSession session)
Returns a Map which stores messageId-Request
pairs whose Responses are not received yet. |
protected Set<Request> |
createUnrespondedRequestStore(IoSession session)
Returns a Set which stores Request whose
Responses are not received yet. |
protected void |
destroyRequestStore(Map<Object,Request> requestStore)
Releases any resources related with the Map created by
createRequestStore(IoSession). |
protected void |
destroyUnrespondedRequestStore(Set<Request> unrespondedRequestStore)
Releases any resources related with the Set created by
createUnrespondedRequestStore(IoSession). |
protected Object |
doFilterWrite(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
|
void |
messageReceived(IoFilter.NextFilter nextFilter,
IoSession session,
Object message)
Filters IoHandler.messageReceived(IoSession,Object)
event. |
void |
onPostRemove(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
Invoked after this filter is removed from the specified parent. |
void |
onPreAdd(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
Invoked before this filter is added to the specified parent. |
void |
sessionClosed(IoFilter.NextFilter nextFilter,
IoSession session)
Filters IoHandler.sessionClosed(IoSession) event. |
| Methods inherited from class org.apache.mina.filter.util.WriteRequestFilter |
|---|
filterWrite, messageSent |
| Methods inherited from class org.apache.mina.core.filterchain.IoFilterAdapter |
|---|
destroy, exceptionCaught, filterClose, init, onPostAdd, onPreRemove, sessionCreated, sessionIdle, sessionOpened, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RequestResponseFilter(ResponseInspector responseInspector,
ScheduledExecutorService timeoutScheduler)
public RequestResponseFilter(ResponseInspectorFactory responseInspectorFactory,
ScheduledExecutorService timeoutScheduler)
| Method Detail |
|---|
public void onPreAdd(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
throws Exception
IoFilterAdapterIoFilter.init() is invoked.
onPreAdd in interface IoFilteronPreAdd in class IoFilterAdapterparent - the parent who called this methodname - the name assigned to this filternextFilter - the IoFilter.NextFilter for this filter. You can reuse
this object until this filter is removed from the chain.
Exception
public void onPostRemove(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
throws Exception
IoFilterAdapterIoFilter.destroy() is invoked.
onPostRemove in interface IoFilteronPostRemove in class IoFilterAdapterparent - the parent who called this methodname - the name assigned to this filternextFilter - the IoFilter.NextFilter for this filter. You can reuse
this object until this filter is removed from the chain.
Exception
public void messageReceived(IoFilter.NextFilter nextFilter,
IoSession session,
Object message)
throws Exception
IoFilterAdapterIoHandler.messageReceived(IoSession,Object)
event.
messageReceived in interface IoFiltermessageReceived in class IoFilterAdapterException
protected Object doFilterWrite(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
throws Exception
doFilterWrite in class WriteRequestFilterException
public void sessionClosed(IoFilter.NextFilter nextFilter,
IoSession session)
throws Exception
IoFilterAdapterIoHandler.sessionClosed(IoSession) event.
sessionClosed in interface IoFiltersessionClosed in class IoFilterAdapterExceptionprotected Map<Object,Request> createRequestStore(IoSession session)
Map which stores messageId-Request
pairs whose Responses are not received yet. Please override
this method if you need to use other Map implementation
than the default one (HashMap).
protected Set<Request> createUnrespondedRequestStore(IoSession session)
Set which stores Request whose
Responses are not received yet. Please override
this method if you need to use other Set implementation
than the default one (LinkedHashSet). Please note that
the Iterator of the returned Set have to iterate
its elements in the insertion order to ensure that
RequestTimeoutExceptions are thrown in the order which
Requests were written. If you don't need to guarantee
the order of thrown exceptions, any Set implementation
can be used.
protected void destroyRequestStore(Map<Object,Request> requestStore)
Map created by
createRequestStore(IoSession). This method is useful
if you override createRequestStore(IoSession).
requestStore - what you returned in createRequestStore(IoSession)protected void destroyUnrespondedRequestStore(Set<Request> unrespondedRequestStore)
Set created by
createUnrespondedRequestStore(IoSession). This method is
useful if you override createUnrespondedRequestStore(IoSession).
unrespondedRequestStore - what you returned in createUnrespondedRequestStore(IoSession)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||