Package org.apache.axis2.kernel
Interface RequestResponseTransport
-
- All Known Implementing Classes:
AxisServlet.ServletRequestResponseTransport
,MailRequestResponseTransport
public interface RequestResponseTransport
This interface represents a control object for a Request/Response transport. The normal flow of Axis2 is rooted at the transport -- this does not allow for an acknowledgement to be transmitted before processing has completed, nor does it allow for processing to be paused and resumed on a separate thread without having a response be sent back. This interface enables both of those scenarios by allowing the transport to expose controls to the rest of the engine via a callback.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RequestResponseTransport.RequestResponseTransportStatus
Used to give the current status of the RequestResponseTransport object.
-
Field Summary
Fields Modifier and Type Field Description static String
HOLD_RESPONSE
If this property is set to true in a message transport will call the awaitResponse method of the RequestResponseTransport instead of returning.static String
TRANSPORT_CONTROL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
acknowledgeMessage(MessageContext msgContext)
Notify the transport that a message should be acknowledged at this time.void
awaitResponse()
Pause execution and wait for a response message to be ready.RequestResponseTransport.RequestResponseTransportStatus
getStatus()
This gives the current status of an RequestResponseTransport object.boolean
isResponseWritten()
This will indicate whether or not the response has already been writtenvoid
setResponseWritten(boolean responseWritten)
This is used to set the response written flag on the RequestResponseTransport instancevoid
signalFaultReady(AxisFault fault)
This will tell the transport to end a current wait by raising the given fault.void
signalResponseReady()
Signal that a response has be created and is ready for transmission.
-
-
-
Field Detail
-
TRANSPORT_CONTROL
static final String TRANSPORT_CONTROL
- See Also:
- Constant Field Values
-
HOLD_RESPONSE
static final String HOLD_RESPONSE
If this property is set to true in a message transport will call the awaitResponse method of the RequestResponseTransport instead of returning. The value should be a Boolean object.- See Also:
- Constant Field Values
-
-
Method Detail
-
acknowledgeMessage
void acknowledgeMessage(MessageContext msgContext) throws AxisFault
Notify the transport that a message should be acknowledged at this time.- Parameters:
msgContext
-- Throws:
AxisFault
-
awaitResponse
void awaitResponse() throws InterruptedException, AxisFault
Pause execution and wait for a response message to be ready. This will typically be called by the transport after a message has been paused and will cause the transport to block until a response message is ready to be returned. This is required to enable RM for in-out MEPs over a request/response transport; without it the message would be paused and the transport would simply ack the request.- Throws:
InterruptedException
AxisFault
-
signalResponseReady
void signalResponseReady()
Signal that a response has be created and is ready for transmission. This should release anyone who is blocked on a awaitResponse().
-
signalFaultReady
void signalFaultReady(AxisFault fault)
This will tell the transport to end a current wait by raising the given fault.- Parameters:
fault
- The fault to be raised.
-
getStatus
RequestResponseTransport.RequestResponseTransportStatus getStatus()
This gives the current status of an RequestResponseTransport object.- Returns:
-
isResponseWritten
boolean isResponseWritten()
This will indicate whether or not the response has already been written
-
setResponseWritten
void setResponseWritten(boolean responseWritten)
This is used to set the response written flag on the RequestResponseTransport instance
-
-