org.apache.axis.message.addressing.handler
Class AddressingHandler

java.lang.Object
  extended by org.apache.axis.handlers.BasicHandler
      extended by org.apache.axis.message.addressing.handler.AddressingHandler
All Implemented Interfaces:
java.io.Serializable, org.apache.axis.Handler, Constants

public class AddressingHandler
extends org.apache.axis.handlers.BasicHandler
implements Constants

Class AddressingHandler.

Version:
$Revision: 14 $
Author:
Davanum Srinivas
See Also:
Serialized Form

Field Summary
protected static org.apache.commons.logging.Log LOG
          Class logger.
 
Fields inherited from class org.apache.axis.handlers.BasicHandler
makeLockable, name, options
 
Fields inherited from interface org.apache.axis.message.addressing.Constants
ACTION, ADDRESS, ATTR_REFP, ENDPOINT_REFERENCE, ENV_ADDRESSING_FAULTTO_URI, ENV_ADDRESSING_FROM_URI, ENV_ADDRESSING_NAMESPACE_URI, ENV_ADDRESSING_REPLYTO_URI, ENV_ADDRESSING_REQUEST_HEADERS, ENV_ADDRESSING_REQUIRED, ENV_ADDRESSING_RESP_ACTION, ENV_ADDRESSING_RESPONSE_HEADERS, ENV_ADDRESSING_SEND_REPLYTO, ENV_ADDRESSING_SET_MUST_UNDERSTAND, ENV_ADDRESSING_SHARED_HEADERS, FAULT_DETAIL, FAULT_TO, FROM, MESSAGE_ID, METADATA, NS_PREFIX_ADDRESSING, NS_URI_ADDRESSING, NS_URI_ADDRESSING_2003_03, NS_URI_ADDRESSING_2004_03, NS_URI_ADDRESSING_2004_08, NS_URI_ADDRESSING_2005_08, NS_URI_ADDRESSING_DEFAULT, PORT_NAME, PORT_TYPE, RECIPIENT, REFERENCE_PARAMETERS, REFERENCE_PROPERTIES, RELATES_TO, RELATIONSHIP_TYPE, REPLY, REPLY_TO, RESPONSE, SEND_DEFAULT_FROM, SEND_DEFAULT_MESSAGEID, SEND_DEFAULT_TO, SERVICE_NAME, TO, URI_ANONYMOUS_W3C_CR, URI_NONE_W3C_CR, URI_REPLY, WSDL_ATTRIB_ACTION
 
Constructor Summary
AddressingHandler()
          Creates a new instance.
 
Method Summary
protected  void configureCall(org.apache.axis.client.Call call, org.apache.axis.MessageContext oldContext)
          Override this method to prepare the new call, for instance to add properties from the old MessageContext that may be needed by other handlers.
protected  void forwardMessage(EndpointReferenceType epr, org.apache.axis.Message msg)
          Forwards the message to the given EPR.
protected  org.apache.axis.client.Service getService(org.apache.axis.MessageContext ctx)
          Override this method if you need something other than the default Service.
 void init()
          
protected  void initializeActor()
          Initializes the "actor" URI field.
 void invoke(org.apache.axis.MessageContext msgContext)
          
 void onFault(org.apache.axis.MessageContext msgContext)
          
protected  void processClientRequest(org.apache.axis.MessageContext ctx, boolean setMustUnderstand)
          Method processClientRequest.
protected  void processClientResponse(org.apache.axis.MessageContext ctx)
          Method processClientResponse.
protected  void processFault(org.apache.axis.MessageContext ctx)
          Processes a fault.
protected  void processServerRequest(org.apache.axis.MessageContext ctx)
          Method processServerRequest.
protected  void processServerResponse(org.apache.axis.MessageContext ctx, boolean setMustUnderstand)
          Method processServerResponse.
static void resetContextOperations(org.apache.axis.MessageContext ctx)
          Reinitializes the RPCElement with right operations so that things are nicely deserialized.
protected  void resetOperations(org.apache.axis.MessageContext ctx)
          Reset the context operations.
protected  void setTargetService(org.apache.axis.MessageContext ctx, AddressingHeaders headers)
          Can be overridden by subclasses to customize how the wsa:to header is interpreted.
 
Methods inherited from class org.apache.axis.handlers.BasicHandler
canHandleBlock, cleanup, generateWSDL, getDeploymentData, getName, getOption, getOptions, getUnderstoodHeaders, initHashtable, setName, setOption, setOptionDefault, setOptions, setOptionsLockable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
Class logger.

Constructor Detail

AddressingHandler

public AddressingHandler()
Creates a new instance.

Method Detail

init

public void init()

Specified by:
init in interface org.apache.axis.Handler
Overrides:
init in class org.apache.axis.handlers.BasicHandler

initializeActor

protected void initializeActor()
Initializes the "actor" URI field.


invoke

public void invoke(org.apache.axis.MessageContext msgContext)
            throws org.apache.axis.AxisFault

Specified by:
invoke in interface org.apache.axis.Handler
Throws:
org.apache.axis.AxisFault

onFault

public void onFault(org.apache.axis.MessageContext msgContext)

Specified by:
onFault in interface org.apache.axis.Handler
Overrides:
onFault in class org.apache.axis.handlers.BasicHandler

processFault

protected void processFault(org.apache.axis.MessageContext ctx)
                     throws java.lang.Exception
Processes a fault.

Parameters:
ctx - Context information
Throws:
java.lang.Exception - If an error occurs

processClientRequest

protected void processClientRequest(org.apache.axis.MessageContext ctx,
                                    boolean setMustUnderstand)
                             throws java.lang.Exception
Method processClientRequest.

Parameters:
ctx - Context
setMustUnderstand - Must-Understand attribute value
Throws:
java.lang.Exception

processClientResponse

protected void processClientResponse(org.apache.axis.MessageContext ctx)
                              throws java.lang.Exception
Method processClientResponse.

Parameters:
ctx - Context information
Throws:
java.lang.Exception - If an error occurs

processServerRequest

protected void processServerRequest(org.apache.axis.MessageContext ctx)
                             throws java.lang.Exception
Method processServerRequest.

Parameters:
ctx - Context information
Throws:
java.lang.Exception - If an error occurs

resetOperations

protected void resetOperations(org.apache.axis.MessageContext ctx)
                        throws org.apache.axis.AxisFault
Reset the context operations.

Parameters:
ctx - Context information
Throws:
org.apache.axis.AxisFault - If an error occurs

resetContextOperations

public static void resetContextOperations(org.apache.axis.MessageContext ctx)
                                   throws org.apache.axis.AxisFault
Reinitializes the RPCElement with right operations so that things are nicely deserialized.

Parameters:
ctx - Context information
Throws:
org.apache.axis.AxisFault - If an error occurs

setTargetService

protected void setTargetService(org.apache.axis.MessageContext ctx,
                                AddressingHeaders headers)
                         throws java.lang.Exception
Can be overridden by subclasses to customize how the wsa:to header is interpreted.

Parameters:
ctx - Context information
headers - Header container
Throws:
java.lang.Exception

processServerResponse

protected void processServerResponse(org.apache.axis.MessageContext ctx,
                                     boolean setMustUnderstand)
                              throws java.lang.Exception
Method processServerResponse.

Parameters:
ctx - Context information
setMustUnderstand - Whether to set the attribute
Throws:
java.lang.Exception - If an error occurs

forwardMessage

protected void forwardMessage(EndpointReferenceType epr,
                              org.apache.axis.Message msg)
                       throws java.lang.Exception
Forwards the message to the given EPR.

Parameters:
epr - Destination EPR
msg - Message to forward
Throws:
java.lang.Exception - If an error occurs

getService

protected org.apache.axis.client.Service getService(org.apache.axis.MessageContext ctx)
Override this method if you need something other than the default Service.
The service returned by this method is used in creating the new Call object. Something like:
 Service service = getService(msgContext);
 Call call = service.createCall()
 call.setTargetEndpointAddress(toEndPointReference.getAddress().toString());
 

Parameters:
ctx - Context information
Returns:
A service instance

configureCall

protected void configureCall(org.apache.axis.client.Call call,
                             org.apache.axis.MessageContext oldContext)
Override this method to prepare the new call, for instance to add properties from the old MessageContext that may be needed by other handlers.

Parameters:
call - Call object about to be invoked
oldContext - MessageContext of the original request/response.


Copyright © 2008-2009 Rodrigo Ruiz. All Rights Reserved.