|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.flat502.rox.processing.HttpMessageHandler
public abstract class HttpMessageHandler
An abstract base class used by the default client and server implementation to process complete HTTP messages.
Constructor Summary | |
---|---|
protected |
HttpMessageHandler(BlockingQueue queue)
Constructs a new instance coupled to a BlockingQueue . |
Method Summary | |
---|---|
protected void |
handleHttpMessageException(HttpMessageBuffer msg,
java.lang.Throwable exception)
Called when an error occurs while handling an HTTP message. |
protected abstract void |
handleMessage(HttpMessageBuffer msg)
Called to handle complete HTTP messages. |
protected void |
handleProcessingException(ProcessingException exception)
Called when an error occurs that is not related to an HTTP message. |
void |
run()
Processes work items dequeued from the BlockingQueue associated
with this instance. |
void |
stop()
Stops this instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected HttpMessageHandler(BlockingQueue queue)
BlockingQueue
.
queue
- The queue from which this instance should
fetch new work items.Method Detail |
---|
public void run()
BlockingQueue
associated
with this instance.
The default implementation of HttpRpcProcessor
enqueues two types of items on the underlying queue:
HttpMessageBuffer
instances, representing complete
HTTP messages received from a remote entity. These are passed to
handleMessage(HttpMessageBuffer)
for processing.HttpMessageException
instances when an error occurs
while compiling an HTTP message. These are unpacked and passed to
handleHttpMessageException(HttpMessageBuffer, Throwable)
for processing.
run
in interface java.lang.Runnable
public void stop()
If this instance is busy with a work item it is completed.
protected abstract void handleMessage(HttpMessageBuffer msg) throws java.lang.Exception
msg
- The complete HTTP message.
java.lang.Exception
- Implementations may raise an exception if
an error occurs during processing.protected void handleHttpMessageException(HttpMessageBuffer msg, java.lang.Throwable exception)
The default implementation raises an
IllegalStateException
.
msg
- The HTTP message that was being processed
when the exception was raised.exception
- The exception that was raised.protected void handleProcessingException(ProcessingException exception)
The default implementation raises an
IllegalStateException
.
exception
- The exception that was raised.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |