Class ServerResponseContext
java.lang.Object
no.mnemonic.messaging.requestsink.jms.context.ServerResponseContext
- All Implemented Interfaces:
ServerContext
,RequestContext
The server response context is the context object sent to the server side RequestSink along with the signal received from the client.
It will encode all responses into JMS messages and submit back to client.
When RequestSink closes stream or notifies an exception, this will also be notified to the client.
Multiple responses will be encoded as multiple messages, creating a response stream back to the client. When channel is closed, responses will be ignored.
-
Constructor Summary
ConstructorDescriptionServerResponseContext
(String callID, javax.jms.Session session, javax.jms.MessageProducer replyProducer, javax.jms.Destination replyTo, long timeout, ProtocolVersion protocolVersion, int maxMessageSize, ServerMetrics metrics, MessageSerializer serializer, RequestSink requestSink) -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
Request that this context is aborted.void
addListener
(RequestListener listener) boolean
addResponse
(Message msg) void
void
Method to implementServerChannelUploadContext.UploadHandler
boolean
isClosed()
boolean
keepAlive
(long until) void
void
void
removeListener
(RequestListener listener)
-
Constructor Details
-
ServerResponseContext
public ServerResponseContext(String callID, javax.jms.Session session, javax.jms.MessageProducer replyProducer, javax.jms.Destination replyTo, long timeout, ProtocolVersion protocolVersion, int maxMessageSize, ServerMetrics metrics, MessageSerializer serializer, RequestSink requestSink)
-
-
Method Details
-
handle
Method to implementServerChannelUploadContext.UploadHandler
-
keepAlive
public boolean keepAlive(long until) - Specified by:
keepAlive
in interfaceRequestContext
-
addResponse
- Specified by:
addResponse
in interfaceRequestContext
-
abort
public void abort()Description copied from interface:ServerContext
Request that this context is aborted. No more responses should be allowed Ongoing execution should be interrupted.- Specified by:
abort
in interfaceServerContext
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceRequestContext
- Specified by:
isClosed
in interfaceServerContext
- Returns:
- true if this context has been closed
-
notifyClose
public void notifyClose()- Specified by:
notifyClose
in interfaceRequestContext
-
notifyError
- Specified by:
notifyError
in interfaceRequestContext
-
endOfStream
public void endOfStream()- Specified by:
endOfStream
in interfaceRequestContext
-
addListener
- Specified by:
addListener
in interfaceRequestContext
-
removeListener
- Specified by:
removeListener
in interfaceRequestContext
-