Class SimpleChain

  • All Implemented Interfaces:
    java.io.Serializable, Chain, Handler
    Direct Known Subclasses:
    SimpleTargetedChain

    public class SimpleChain
    extends BasicHandler
    implements Chain
    A Simple Chain is a 'composite' Handler in that it aggregates a collection of Handlers and also acts as a Handler which delegates its operations to the collection.

    A Simple Chain initially has no Handlers. Handlers may be added until the chain is invoke()d after which Handlers may not be added (and any attempt to do so will throw an exception).

    Author:
    Doug Davis (dug@us.ibm.com), Glyn Normington (norm@uk.ibm.com)
    See Also:
    Serialized Form
    • Field Detail

      • handlers

        protected java.util.Vector handlers
      • invoked

        protected boolean invoked
    • Constructor Detail

      • SimpleChain

        public SimpleChain()
    • Method Detail

      • init

        public void init()
        Description copied from class: BasicHandler
        Stubbed-out methods. Override in your child class to implement any real behavior. Note that there is NOT a stub for invoke(), since we require any Handler derivative to implement that.
        Specified by:
        init in interface Handler
        Overrides:
        init in class BasicHandler
      • cleanup

        public void cleanup()
        Description copied from interface: Handler
        Cleanup is called when the chain containing this Handler object is done processing the chain.
        Specified by:
        cleanup in interface Handler
        Overrides:
        cleanup in class BasicHandler
      • invoke

        public void invoke​(MessageContext msgContext)
                    throws AxisFault
        Iterate over the chain invoking each handler. If there's a fault then call 'onFault' for each completed handler in reverse order, then rethrow the exception.
        Specified by:
        invoke in interface Handler
        Parameters:
        msgContext - the MessageContext to process with this Handler.
        Throws:
        AxisFault - if there was a fault with any of the handlers
      • generateWSDL

        public void generateWSDL​(MessageContext msgContext)
                          throws AxisFault
        Iterate over the chain letting each handler have a crack at contributing to a WSDL description.
        Specified by:
        generateWSDL in interface Handler
        Overrides:
        generateWSDL in class BasicHandler
        Parameters:
        msgContext - the MessageContext to write the WSDL out to
        Throws:
        AxisFault - if there was a problem writing the WSDL
      • onFault

        public void onFault​(MessageContext msgContext)
        Notify the handlers in this chain because some handler later on has faulted - in reverse order. If any handlers have been added since we visited the chain, they will get notified too!
        Specified by:
        onFault in interface Handler
        Overrides:
        onFault in class BasicHandler
        Parameters:
        msgContext - the context to process
      • canHandleBlock

        public boolean canHandleBlock​(QName qname)
        Description copied from interface: Handler
        Indicate if this handler can process qname.
        Specified by:
        canHandleBlock in interface Handler
        Overrides:
        canHandleBlock in class BasicHandler
        Parameters:
        qname - the QName to check
        Returns:
        true if this Handler can handle qname, false otherwise
      • addHandler

        public void addHandler​(Handler handler)
        Description copied from interface: Chain
        Adds a handler to the end of the chain. May not be called after invoke.
        Specified by:
        addHandler in interface Chain
        Parameters:
        handler - the Handler to be added
      • contains

        public boolean contains​(Handler handler)
        Description copied from interface: Chain
        Discover if a handler is in this chain.
        Specified by:
        contains in interface Chain
        Parameters:
        handler - the Handler to check
        Returns:
        true if it is in this chain, false otherwise
      • getHandlers

        public Handler[] getHandlers()
        Description copied from interface: Chain
        Get the list of handlers in the chain. Is Handler[] the right form?
        Specified by:
        getHandlers in interface Chain
        Returns:
        an array of Handlers that have been added
      • getDeploymentData

        public org.w3c.dom.Element getDeploymentData​(org.w3c.dom.Document doc)
        Description copied from interface: Handler
        This will return the root element of an XML doc that describes the deployment information about this handler. This is NOT the WSDL, this is all of the static internal data use by Axis - WSDL takes into account run-time information (like which service we're talking about) this is just the data that's stored in the registry. Used by the 'list' Admin function.
        Specified by:
        getDeploymentData in interface Handler
        Overrides:
        getDeploymentData in class BasicHandler
        Parameters:
        doc - a Document within which to build the deployment data
        Returns:
        an Element representing the deployment data