org.jibx.ws.transport.interceptor
Class CopiedInputStreamInterceptor

java.lang.Object
  extended by org.jibx.ws.transport.interceptor.CopiedInputStreamInterceptor
All Implemented Interfaces:
InputStreamInterceptor

public final class CopiedInputStreamInterceptor
extends Object
implements InputStreamInterceptor

An interceptor that sniffs the input on the way through.

It can run in two modes.

  1. If constructed with an attribute name, on completion it will put the result into an attribute in the current MessageContext. This is convenient for use on the server side.
  2. If constructed with an output stream, it will copy the input to that output stream. This is convenient for use on the client side.


Constructor Summary
CopiedInputStreamInterceptor(OutputStream copyStream)
          Constructor.
CopiedInputStreamInterceptor(String attributeName)
          Constructor.
 
Method Summary
 void inputComplete()
          Notifies the interceptor that input is complete.
 InputStream intercept(InputStream inputStream)
          Allows the interceptor to hook into the input stream.
 void setMessageContext(InContext ctx)
          Sets the inbound message context for the interceptor to store data in.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopiedInputStreamInterceptor

public CopiedInputStreamInterceptor(String attributeName)
Constructor. When the input is complete, this will put the copy of the input into an attribute in the current MessageContext.

Parameters:
attributeName - the name of the attribute in which to store the result

CopiedInputStreamInterceptor

public CopiedInputStreamInterceptor(OutputStream copyStream)
Constructor. This will duplicate the input to the specified output stream.

Parameters:
copyStream - the stream to copy the input to
Method Detail

setMessageContext

public void setMessageContext(InContext ctx)
Sets the inbound message context for the interceptor to store data in.

Specified by:
setMessageContext in interface InputStreamInterceptor
Parameters:
ctx - inbound message context

intercept

public InputStream intercept(InputStream inputStream)
Allows the interceptor to hook into the input stream.

Specified by:
intercept in interface InputStreamInterceptor
Parameters:
inputStream - the input stream of the request from the transport
Returns:
the input stream that will be presented to the processor

inputComplete

public void inputComplete()
Notifies the interceptor that input is complete.

Specified by:
inputComplete in interface InputStreamInterceptor


Project Web Site