Interface StreamInterceptor
-
- All Known Implementing Classes:
DefaultStreamInterceptor
,LoggingStreamInterceptor
public interface StreamInterceptor
Interface For Stream Interceptors Interceptors are invoked when the data is received to the synapse engine or when data is sent out of the engine. After a connection is established, the data is read chunk wise/ whenever available. The same applies when the data leaves the engine as well. There are two requests coming into the engine and two responses going out from the engine. Interceptors will be invoked in all of these four phases
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addProperty(String name, Object value)
Add an interceptor propertyMap
getProperties()
Get all interceptor propertiesboolean
interceptSourceRequest(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the source requestboolean
interceptSourceResponse(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the source responseboolean
interceptTargetRequest(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the target requestboolean
interceptTargetResponse(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the target responseboolean
sourceRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)
Handles the request data coming in to the engine from the clientvoid
sourceResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)
Handles the response data leaving out of the enginevoid
targetRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)
Handles the request data leaving out of the engineboolean
targetResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)
Handles the response data coming in to the engine from the back end
-
-
-
Method Detail
-
interceptSourceRequest
boolean interceptSourceRequest(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the source request- Parameters:
axisCtx
- associated axis2MsgCtx of the request- Returns:
- intercept source request or not
-
sourceRequest
boolean sourceRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)
Handles the request data coming in to the engine from the client- Parameters:
buffer
- copy of data entering inaxisCtx
- associated axis2MsgCtx- Returns:
- whether to continue reading the data or to close the connection
-
interceptTargetRequest
boolean interceptTargetRequest(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the target request- Parameters:
axisCtx
- associated axis2MsgCtx of the request- Returns:
- intercept target request or not
-
targetRequest
void targetRequest(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)
Handles the request data leaving out of the engine- Parameters:
buffer
- copy of data being send outaxisCtx
- associated axis2MsgCtx
-
interceptTargetResponse
boolean interceptTargetResponse(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the target response- Parameters:
axisCtx
- associated axis2MsgCtx of the response- Returns:
- intercept target response or not
-
targetResponse
boolean targetResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)
Handles the response data coming in to the engine from the back end- Parameters:
buffer
- copy of data entering inaxisCtx
- associated axis2MsgCtx- Returns:
- whether to continue reading the data or to close the connection
-
interceptSourceResponse
boolean interceptSourceResponse(org.apache.axis2.context.MessageContext axisCtx)
Logic to determine whether to intercept the source response- Parameters:
axisCtx
- associated axis2MsgCtx of the response- Returns:
- intercept source response or not
-
sourceResponse
void sourceResponse(ByteBuffer buffer, org.apache.axis2.context.MessageContext axisCtx)
Handles the response data leaving out of the engine- Parameters:
buffer
- copy of data leavingaxisCtx
- associated axis2MsgCtx
-
addProperty
void addProperty(String name, Object value)
Add an interceptor property- Parameters:
name
- property namevalue
- property value
-
getProperties
Map getProperties()
Get all interceptor properties- Returns:
- Map of handler properties
-
-