oracle.soap.server
Interface Handler


public interface Handler

Handler defines the interface for a pluggable handler in the SOAP server. This class does not imply any policies about when the handler in invoked.

A handler implementation must:


Field Summary
static int ERROR_TYPE
          Handler invocation is part of error chain.
static int REQUEST_TYPE
          Handler invocation is part of request chain.
static int RESPONSE_TYPE
          Handler invocation is part of response chain.
 
Method Summary
 void destroy()
          One-time handler cleanup.
 java.lang.String getName()
          Get this handler's name.
 java.util.Properties getOptions()
          Get this handler's options.
 void init(SOAPServerContext ssc)
          One-time handler initialization.
 void invoke(int chainType, RequestContext requestContext)
          Invoke the requested handler as part of the specified chain type.
 void setName(java.lang.String name)
          Set the name of the handler.
 void setOptions(java.util.Properties options)
          Set the options for the handler for subsequent use by init.
 

Field Detail

REQUEST_TYPE

public static final int REQUEST_TYPE
Handler invocation is part of request chain.

RESPONSE_TYPE

public static final int RESPONSE_TYPE
Handler invocation is part of response chain.

ERROR_TYPE

public static final int ERROR_TYPE
Handler invocation is part of error chain.
Method Detail

init

public void init(SOAPServerContext ssc)
          throws SOAPException
One-time handler initialization. This method will be invoked by the SOAP server exactly once before the server makes any invocations on the handler, allowing the handler to set up any global state. It uses any options that were set previously via setOptions.
Parameters:
ssc - The SOAP server context, which contains the logger for informational messages.
Throws:
SOAPException - Unable to initialize the handler.
See Also:

setOptions

public void setOptions(java.util.Properties options)
Set the options for the handler for subsequent use by init. This method must be called before init.
Parameters:
options - Options that are specific to the handler implementation.
See Also:
init(oracle.soap.server.SOAPServerContext)

getOptions

public java.util.Properties getOptions()
Get this handler's options.
Returns:
Options that are specific to the handler implementation.
See Also:
setOptions(java.util.Properties)

setName

public void setName(java.lang.String name)
Set the name of the handler. This method must be called before init.
Parameters:
name - The name of the handler instance.
See Also:
getName()

getName

public java.lang.String getName()
Get this handler's name.
Returns:
The name of the handler instance.
See Also:
setName(java.lang.String)

destroy

public void destroy()
             throws SOAPException
One-time handler cleanup. This method will be invoked by the SOAP server exactly once before the server shuts down. This gives the handler the opportunity to do cleanup of global state.
Throws:
SOAPException - Unable to destroy.
See Also:
init(oracle.soap.server.SOAPServerContext)

invoke

public void invoke(int chainType,
                   RequestContext requestContext)
            throws SOAPException
Invoke the requested handler as part of the specified chain type. Note that execution of a chain of request handlers or response handlers will terminate immediately if any handler throws a SOAPException. In contrast, all handlers in an error chain will be invoked, regardless of whether any handler throws an exception. In case of an exception in an error handler, the exception is logged and discarded.
Parameters:
chainType - Handler.REQUEST_TYPE if the handler is being invoked as part of a request chain (i.e., before the service is invoked); Handler.RESPONSE_TYPE if the handler is being invoked as part of a response chain (i.e., after the service has been invoked); Handler.ERROR_TYPE if the handler is being invoked as part of an error chain (i.e., in case of an error during any one of request chain, service invocation, or response chain).
requestContext - The relevant request context.
Throws:
SOAPException - Handler invocation failed.


Copyright 2001 Oracle SOAP. All Rights Reserved.