com.sun.grizzly.filter
Class MessageDispatcher
java.lang.Object
com.sun.grizzly.filter.MessageDispatcher
- All Implemented Interfaces:
- ProtocolFilter
public abstract class MessageDispatcher
- extends java.lang.Object
- implements ProtocolFilter
Filter which dispatches parsed fully constructed Messages.
This could be a plugin point to write business logic which
handles requests made by some Endpoit.
Note:
Messages are taken from Grizzly WorkerThread
and dispatched to a new Thread Instance of an configurable ThreadPool.
This enables the new Threads for example to be put in blocking mode and
not hurting the Grizzly Selection loop.
- Version:
- 1.0
- Author:
- John Vieten 22.06.2008
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
needMoreDataMessageMapKey
public static final java.lang.String needMoreDataMessageMapKey
- See Also:
- Constant Field Values
threadCounter
protected int threadCounter
threadGroup
protected final java.lang.ThreadGroup threadGroup
MessageDispatcher
public MessageDispatcher()
setExecutorService
public void setExecutorService(java.util.concurrent.ExecutorService executorService)
postExecute
public boolean postExecute(Context ctx)
throws java.io.IOException
- Specified by:
postExecute in interface ProtocolFilter
- Throws:
java.io.IOException
stop
public void stop()
execute
public boolean execute(Context ctx)
throws java.io.IOException
- Specified by:
execute in interface ProtocolFilter
- Throws:
java.io.IOException
onRequestMessage
public abstract void onRequestMessage(RequestMessage msg,
Context ctx)
- Pluginpoint to handle an Message received from some Endpoint
- Parameters:
msg - RequestMessage the message received from an Endpointctx - MessageContext Simple API for writing,quering the connection.
onMessageError
public abstract void onMessageError(MessageError msg,
Context ctx)
Copyright © 2011 Oracle Corporation. All Rights Reserved.