|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.adobe.flashaccess.sdk.protocol.AbstractHandler com.adobe.flashaccess.sdk.protocol.AbstractMessageHandler com.adobe.flashaccess.sdk.protocol.MessageHandlerBase
public abstract class MessageHandlerBase
Base class for Flash Access request/response handlers which handle a single
request/response. The handler reads the request data
and parses the request. The caller can examine the information
in the request and decide whether to return an error or a successful response
(subclasses of RequestMessageBase
provide a method for setting response data).
Handlers should be invoked as follows (imagine a concrete instance of MessageHandlerBase called ConcreteHandler):
ConcreteHandler handler = new ConcreteHandler(handlerConfig, inputStream, outputStream);
try {
handler.parseRequest();
RequestMessageBase request = handler.getRequest();
// Use request's getters to examine request info and evaluate request
// If successful, construct appropriate responseData and use request's methods to set response
// If an error occurs, construct errorData and call request.setErrorData(errorData);
} catch (HandlerParsingException e) {
// Use e.getErrorData() for info on the error which will be sent to the user
// Do not attempt to call any handler methods except close()
} finally {
// Always call close in a finally statement to ensure a response is sent to the client
handler.close();
}
Method Summary | |
---|---|
void |
close()
Sends the signed and encrypted response (success or error) to the client. |
abstract RequestMessageBase |
getRequest()
Retrieves the request message sent by the client. |
Methods inherited from class com.adobe.flashaccess.sdk.protocol.AbstractHandler |
---|
parseRequest |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract RequestMessageBase getRequest()
getRequest
in class AbstractMessageHandler
public void close() throws java.io.IOException
close()
must be the last method called for this object; it is recommended this be part of
a finally
block to ensure a response is always sent to the client.
close
in interface HandlerInterface
close
in class AbstractMessageHandler
java.lang.IllegalStateException
- if neither the response or error data has been set, or if
close()
has already been called.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |