001    /*
002     * Copyright 2001-2004 The Apache Software Foundation.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package javax.xml.rpc.handler;
017    
018    import java.util.List;
019    import java.util.Map;
020    
021    /**
022     * The <code>javax.xml.rpc.handler.HandlerChain</code> represents
023     * a list of handlers. All elements in the HandlerChain are of
024     * the type <code>javax.xml.rpc.handler.Handler</code>.
025     * <p>
026     * An implementation class for the <code>HandlerChain</code>
027     * interface abstracts the policy and mechanism for the invocation
028     * of the registered handlers.
029     *
030     * @version 1.0
031     */
032    public interface HandlerChain extends List {
033    
034        /**
035         * The <code>handleRequest</code> method initiates the request
036         * processing for this handler chain.
037         * @param context MessageContext parameter provides access to
038         *             the request SOAP message.
039         * @return boolean Returns <code>true</code> if all handlers in
040         *             chain have been processed. Returns <code>false</code>
041         *
042         *             if a handler in the chain returned
043         *             <code>false</code> from its handleRequest
044         *             method.
045         * @throws javax.xml.rpc.JAXRPCException if any processing error happens
046         */
047        public boolean handleRequest(MessageContext context);
048    
049        /**
050         * The <code>handleResponse</code> method initiates the response
051         * processing for this handler chain.
052         *
053         * @param context MessageContext parameter provides access to the response
054         *                  SOAP message.
055         * @return boolean Returns <code>true</code> if all handlers in
056         *             chain have been processed. Returns <code>false</code>
057         *             if a handler in the chain returned
058         *             <code>false</code> from its handleResponse method.
059         * @throws javax.xml.rpc.JAXRPCException if any processing error happens
060         */
061        public boolean handleResponse(MessageContext context);
062    
063        /**
064         * The <code>handleFault</code> method initiates the SOAP
065         * fault processing for this handler chain.
066         *
067         * @param  context MessageContext parameter provides access to the SOAP
068         *         message.
069         * @return Returns boolean Returns <code>true</code> if all handlers in
070         *             chain have been processed. Returns <code>false</code>
071         *             if a handler in the chain returned
072         *             <code>false</code> from its handleFault method.
073         * @throws javax.xml.rpc.JAXRPCException if any processing error happens
074         */
075        public boolean handleFault(MessageContext context);
076    
077        /**
078         * Initializes the configuration for a HandlerChain.
079         *
080         * @param config Configuration for the initialization of this handler
081         *                 chain
082         *
083         * @throws javax.xml.rpc.JAXRPCException if there is any error that prevents
084         *              initialization
085         */
086        public void init(Map config);
087    
088        /**
089         * Indicates the end of lifecycle for a HandlerChain.
090         *
091         * @throws javax.xml.rpc.JAXRPCException if there was any error that
092         *              prevented destroy from completing
093         */
094        public void destroy();
095    
096        /**
097         * Sets SOAP Actor roles for this <code>HandlerChain</code>. This
098         * specifies the set of roles in which this HandlerChain is to act
099         * for the SOAP message processing at this SOAP node. These roles
100         * assumed by a HandlerChain must be invariant during the
101         * processing of an individual SOAP message through the HandlerChain.
102         * <p>
103         * A <code>HandlerChain</code> always acts in the role of the
104         * special SOAP actor <code>next</code>. Refer to the SOAP
105         * specification for the URI name for this special SOAP actor.
106         * There is no need to set this special role using this method.
107         *
108         * @param soapActorNames URIs for SOAP actor name
109         */
110        public void setRoles(String[] soapActorNames);
111    
112        /**
113         * Gets SOAP actor roles registered for this HandlerChain at
114         * this SOAP node. The returned array includes the special
115         * SOAP actor <code>next</code>.
116         * @return String[] SOAP Actor roles as URIs
117         */
118        public java.lang.String[] getRoles();
119    }
120