Home » xml-commons-external-1.4.01-src » javax » xml » rpc » handler » [javadoc | source]

    1   /*
    2    * JBoss, Home of Professional Open Source.
    3    * Copyright 2006, Red Hat Middleware LLC, and individual contributors
    4    * as indicated by the @author tags. See the copyright.txt file in the
    5    * distribution for a full listing of individual contributors.
    6    *
    7    * This is free software; you can redistribute it and/or modify it
    8    * under the terms of the GNU Lesser General Public License as
    9    * published by the Free Software Foundation; either version 2.1 of
   10    * the License, or (at your option) any later version.
   11    *
   12    * This software is distributed in the hope that it will be useful,
   13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
   14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   15    * Lesser General Public License for more details.
   16    *
   17    * You should have received a copy of the GNU Lesser General Public
   18    * License along with this software; if not, write to the Free
   19    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   20    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   21    */
   22   package javax.xml.rpc.handler;
   23   
   24   import javax.xml.namespace.QName;
   25   
   26   /** The GenericHandler class implements the Handler interface. SOAP Message
   27    * Handler developers should typically subclass GenericHandler class unless
   28    * the Handler class needs another class as a superclass.
   29    * 
   30    * The GenericHandler class is a convenience abstract class that makes writing
   31    * Handlers easy. This class provides default implementations of the lifecycle
   32    * methods init and destroy and also different handle methods. A Handler
   33    * developer should only override methods that it needs to specialize as part
   34    * of the derived Handler implementation class.
   35    * 
   36    * @author Scott.Stark@jboss.org
   37    * @author Rahul Sharma (javadoc)
   38    */
   39   public abstract class GenericHandler implements Handler
   40   {
   41      /** Default constructor. */
   42      protected GenericHandler()
   43      {
   44      }
   45   
   46      /**
   47       * Gets the header blocks processed by this Handler instance.
   48       *
   49       * @return Array of QNames of header blocks processed by this handler instance.
   50       * QName is the qualified name of the outermost element of the Header block.
   51       */
   52      public abstract QName[] getHeaders();
   53   
   54      /**
   55       * The init method to enable the Handler instance to initialize itself. This method should be overridden if the
   56       * derived Handler class needs to specialize implementation of this method.
   57       * @param config handler configuration
   58       */
   59      public void init(HandlerInfo config)
   60      {
   61      }
   62   
   63      /**
   64       * The destroy method indicates the end of lifecycle for a Handler instance. This method should be overridden if
   65       * the derived Handler class needs to specialize implementation of this method.
   66       */
   67      public void destroy()
   68      {
   69      }
   70   
   71      /**
   72       * The handleRequest method processes the request SOAP message. The default implementation of this method returns true.
   73       * This indicates that the handler chain should continue processing of the request SOAP message.
   74       * This method should be overridden if the derived Handler class needs to specialize implementation of this method.
   75       * @param msgContext the message msgContext
   76       * @return true/false
   77       */
   78      public boolean handleRequest(MessageContext msgContext)
   79      {
   80         return true;
   81      }
   82   
   83      /**
   84       * The handleResponse method processes the response message. The default implementation of this method returns true.
   85       * This indicates that the handler chain should continue processing of the response SOAP message.
   86       * This method should be overridden if the derived Handler class needs to specialize implementation of this method.
   87       * @param msgContext the message msgContext
   88       * @return true/false
   89       */
   90      public boolean handleResponse(MessageContext msgContext)
   91      {
   92         return true;
   93      }
   94   
   95      /**
   96       * The handleFault method processes the SOAP faults based on the SOAP message processing model.
   97       * The default implementation of this method returns true. This indicates that the handler chain should continue
   98       * processing of the SOAP fault. This method should be overridden if the derived Handler class needs to specialize
   99       * implementation of this method.
  100       * @param msgContext the message msgContext
  101       * @return the message msgContext
  102       */
  103      public boolean handleFault(MessageContext msgContext)
  104      {
  105         return true;
  106      }
  107   }

Home » xml-commons-external-1.4.01-src » javax » xml » rpc » handler » [javadoc | source]