You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2002/01/10 21:01:02 UTC

cvs commit: xml-axis/java/test/outparams ServiceHandler.java

butek       02/01/10 12:01:02

  Modified:    java/samples/transport FileSender.java
               java/samples/transport/tcp TCPSender.java
               java/samples/userguide/example4 LogHandler.java
               java/src/org/apache/axis FaultableHandler.java Handler.java
                        SimpleChain.java SimpleTargetedChain.java
               java/src/org/apache/axis/client AxisClient.java
               java/src/org/apache/axis/handlers BasicHandler.java
                        DebugHandler.java EchoHandler.java
                        ErrorHandler.java JWSHandler.java JWSProcessor.java
                        LogMessage.java MD5AttachHandler.java
                        SimpleAuthenticationHandler.java
                        SimpleSessionHandler.java
               java/src/org/apache/axis/handlers/http
                        HTTPActionHandler.java HTTPAuthHandler.java
                        URLMapper.java
               java/src/org/apache/axis/handlers/soap SOAPService.java
               java/src/org/apache/axis/providers BSFProvider.java
                        ComProvider.java JWSProvider.java
               java/src/org/apache/axis/providers/java JavaProvider.java
                        MsgProvider.java
               java/src/org/apache/axis/server AxisServer.java
               java/src/org/apache/axis/transport/http HTTPSender.java
               java/src/org/apache/axis/transport/local LocalResponder.java
                        LocalSender.java
               java/test/chains PackageTests.java TestSimpleChain.java
               java/test/outparams ServiceHandler.java
  Added:       java/test/chains TestChainFault.java
  Log:
  undo->onFault fixes contributed by Glyn Normington.  From his note:
  
  This patch renames Handler.undo to onFault, provides a default
  implementation of onFault in BasicHandler, deletes the now unnecessary null
  implementations of undo, fixes a bug in SimpleChain.doVisiting which would
  prevent onFault from being driven through a Chain, and adds a testcase of
  the SimpleChain onFault  behaviour.
  
  Revision  Changes    Path
  1.12      +0 -3      xml-axis/java/samples/transport/FileSender.java
  
  Index: FileSender.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/FileSender.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FileSender.java	2 Nov 2001 03:07:40 -0000	1.11
  +++ FileSender.java	10 Jan 2002 20:00:58 -0000	1.12
  @@ -125,7 +125,4 @@
           throw new AxisFault("timeout");
   
     }
  -
  -  public void undo(MessageContext msgContext) {
  -  }
   }
  
  
  
  1.13      +0 -5      xml-axis/java/samples/transport/tcp/TCPSender.java
  
  Index: TCPSender.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/tcp/TCPSender.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TCPSender.java	3 Dec 2001 22:49:22 -0000	1.12
  +++ TCPSender.java	10 Jan 2002 20:00:59 -0000	1.13
  @@ -140,9 +140,4 @@
           }
           category.info( "Exit: TCPSender::invoke" );
       }
  -
  -    public void undo(MessageContext msgContext) {
  -        category.debug("Enter: TCPSender::undo" );
  -        category.debug("Exit: TCPSender::undo" );
  -    }
   };
  
  
  
  1.9       +1 -5      xml-axis/java/samples/userguide/example4/LogHandler.java
  
  Index: LogHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/userguide/example4/LogHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- LogHandler.java	3 Dec 2001 22:49:22 -0000	1.8
  +++ LogHandler.java	10 Jan 2002 20:00:59 -0000	1.9
  @@ -100,8 +100,4 @@
               throw AxisFault.makeFault(e);
           }
       }
  -    
  -    public void undo(MessageContext msgContext)
  -    {
  -    }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.30      +6 -6      xml-axis/java/src/org/apache/axis/FaultableHandler.java
  
  Index: FaultableHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/FaultableHandler.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- FaultableHandler.java	3 Dec 2001 22:49:22 -0000	1.29
  +++ FaultableHandler.java	10 Jan 2002 20:00:59 -0000	1.30
  @@ -98,7 +98,7 @@
        * Invokes the specified handler.  If there's a fault the appropriate
        * key will be calculated and used to find the fault chain to be
        * invoked.  This assumes that the workHandler has caught the exception
  -     * and already processed it's undo logic - as needed.
  +     * and already done its fault processing - as needed.
        */
       public void invoke(MessageContext msgContext) throws AxisFault {
           category.debug(JavaUtils.getMessage("enter00", "FaultableHandler::invoke"));
  @@ -148,12 +148,12 @@
       }
   
       /**
  -     * Some handler later on has faulted so we need to undo our work.
  +     * Some handler later on has faulted so we need to process the fault.
        */
  -    public void undo(MessageContext msgContext) {
  -        category.debug(JavaUtils.getMessage("enter00", "FaultableHandler::undo"));
  -        workHandler.undo( msgContext );
  -        category.debug(JavaUtils.getMessage("exit00", "FaultableHandler::undo"));
  +    public void onFault(MessageContext msgContext) {
  +        category.debug(JavaUtils.getMessage("enter00", "FaultableHandler::onFault"));
  +        workHandler.onFault( msgContext );
  +        category.debug(JavaUtils.getMessage("exit00", "FaultableHandler::onFault"));
       };
   
       public boolean canHandleBlock(QName qname) {
  
  
  
  1.24      +5 -5      xml-axis/java/src/org/apache/axis/Handler.java
  
  Index: Handler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Handler.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Handler.java	9 Nov 2001 23:17:47 -0000	1.23
  +++ Handler.java	10 Jan 2002 20:00:59 -0000	1.24
  @@ -84,16 +84,16 @@
        * If there is a fault during the processing of this method it is
        * invoke's job to catch the exception and undo any partial work
        * that has been completed.  Once we leave 'invoke' if a fault
  -     * is thrown, this classes 'undo' method will be called to undo
  -     * the work that 'invoke' did.
  -     * Invoke should rethrow any exceptions it catches.
  +     * is thrown, this classes 'onFault' method will be called.
  +     * Invoke should rethrow any exceptions it catches, wrapped in
  +     * an AxisFault.
        */
       public void invoke(MessageContext msgContext) throws AxisFault ;
   
       /**
  -     * Called when a fault occurs to 'undo' whatever 'invoke' did.
  +     * Called when a subsequent handler throws a fault.
        */
  -    public void undo(MessageContext msgContext);
  +    public void onFault(MessageContext msgContext);
   
       /**
        * Can this Handler process this QName?
  
  
  
  1.38      +17 -10    xml-axis/java/src/org/apache/axis/SimpleChain.java
  
  Index: SimpleChain.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/SimpleChain.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- SimpleChain.java	23 Dec 2001 14:52:36 -0000	1.37
  +++ SimpleChain.java	10 Jan 2002 20:00:59 -0000	1.38
  @@ -96,7 +96,7 @@
   
       /**
        * Iterate over the chain invoking each handler.  If there's a fault
  -     * then call 'undo' for each completed handler in reverse order, then 
  +     * then call 'onFault' for each completed handler in reverse order, then
        * rethrow the exception.
        */
       public void invoke(MessageContext msgContext) throws AxisFault {
  @@ -125,17 +125,22 @@
           try {
               Vector localHandlers;
               // copies handlers to a local variable for thread-safe
  +            // Unfortunately, localHandlers and handlers are references
  +            // that point at the same Vector so this doesn't give
  +            // thread safety.
               if ((localHandlers = handlers) != null) {
                   Enumeration enum = localHandlers.elements();
  -                while (enum.hasMoreElements())
  +                while (enum.hasMoreElements()) {
                       visitor.visit((Handler)enum.nextElement(), msgContext);
  +                    i++;
  +                }
               }
           }
           catch( Exception e ) {
  -            // undo in reverse order - rethrow
  +            // notify fault in reverse order and then rethrow
               category.error( e );
               while( --i >= 0 )
  -                ((Handler) handlers.elementAt( i )).undo( msgContext );
  +                ((Handler) handlers.elementAt( i )).onFault( msgContext );
               throw AxisFault.makeFault(e);
           }
   
  @@ -146,20 +151,22 @@
       }
   
       /**
  -     * Undo all of the work this chain completed because some handler
  -     * later on has faulted - in reverse order.
  +     * 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!
        */
  -    public void undo(MessageContext msgContext) {
  +    public void onFault(MessageContext msgContext) {
           if (category.isDebugEnabled()) {
               category.debug(JavaUtils.getMessage("enter00", 
  -                "SimpleChain::undo"));
  +                "SimpleChain::onFault"));
           }
   
           for ( int i = handlers.size()-1 ; i >= 0 ; i-- )
  -            ((Handler) handlers.elementAt( i )).undo( msgContext );
  +            ((Handler) handlers.elementAt( i )).onFault( msgContext );
   
           if (category.isDebugEnabled()) {
  -            category.debug(JavaUtils.getMessage("exit00", "SimpleChain::undo"));
  +            category.debug(JavaUtils.getMessage("exit00", "SimpleChain::onFault"));
           }
       }
   
  
  
  
  1.35      +0 -2      xml-axis/java/src/org/apache/axis/SimpleTargetedChain.java
  
  Index: SimpleTargetedChain.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/SimpleTargetedChain.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- SimpleTargetedChain.java	3 Jan 2002 18:08:28 -0000	1.34
  +++ SimpleTargetedChain.java	10 Jan 2002 20:00:59 -0000	1.35
  @@ -86,8 +86,6 @@
      private class PivotIndicator extends BasicHandler {
          public PivotIndicator() {}
   
  -       public void undo(MessageContext msgContext) {}
  -
          public void invoke(MessageContext msgContext) throws AxisFault {
              msgContext.setPastPivot(true);
          }
  
  
  
  1.35      +0 -7      xml-axis/java/src/org/apache/axis/client/AxisClient.java
  
  Index: AxisClient.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/AxisClient.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- AxisClient.java	5 Dec 2001 00:27:18 -0000	1.34
  +++ AxisClient.java	10 Jan 2002 20:00:59 -0000	1.35
  @@ -209,12 +209,5 @@
                   "AxisClient::invoke") );
           }
       };
  -
  -    public void undo(MessageContext msgContext) {
  -        if (category.isDebugEnabled()) {
  -            category.debug(JavaUtils.getMessage("enter00", "AxisClient::undo"));
  -            category.debug(JavaUtils.getMessage("exit00", "AxisClient::undo") );
  -        }
  -    }
   }
   
  
  
  
  1.23      +3 -4      xml-axis/java/src/org/apache/axis/handlers/BasicHandler.java
  
  Index: BasicHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/BasicHandler.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- BasicHandler.java	9 Nov 2001 23:17:47 -0000	1.22
  +++ BasicHandler.java	10 Jan 2002 20:00:59 -0000	1.23
  @@ -98,10 +98,9 @@
           return false;
       }
   
  -    /** Must implement this in subclasses.
  -     */
  -    public abstract void undo(MessageContext msgContext);
  -
  +    public void onFault(MessageContext msgContext)
  +    {
  +    }
       /** Must implement this in subclasses.
        */
       public abstract void invoke(MessageContext msgContext) throws AxisFault;
  
  
  
  1.28      +3 -3      xml-axis/java/src/org/apache/axis/handlers/DebugHandler.java
  
  Index: DebugHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/DebugHandler.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- DebugHandler.java	12 Dec 2001 18:17:52 -0000	1.27
  +++ DebugHandler.java	10 Jan 2002 20:00:59 -0000	1.28
  @@ -101,9 +101,9 @@
           category.debug(JavaUtils.getMessage("exit00", "DebugHandler::invoke") );
       }
   
  -    public void undo(MessageContext msgContext) {
  -        category.debug(JavaUtils.getMessage("enter00", "DebugHandler::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "DebugHandler::undo") );
  +    public void onFault(MessageContext msgContext) {
  +        category.debug(JavaUtils.getMessage("enter00", "DebugHandler::onFault") );
  +        category.debug(JavaUtils.getMessage("exit00", "DebugHandler::onFault") );
       }
   
   };
  
  
  
  1.26      +0 -5      xml-axis/java/src/org/apache/axis/handlers/EchoHandler.java
  
  Index: EchoHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/EchoHandler.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- EchoHandler.java	12 Dec 2001 18:17:52 -0000	1.25
  +++ EchoHandler.java	10 Jan 2002 20:00:59 -0000	1.26
  @@ -84,9 +84,4 @@
           category.debug(JavaUtils.getMessage("exit00", "EchoHandler::invoke") );
       }
   
  -    public void undo(MessageContext msgContext) {
  -        category.debug(JavaUtils.getMessage("enter00", "EchoHandler::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "EchoHandler::undo") );
  -    }
  -
   };
  
  
  
  1.16      +0 -5      xml-axis/java/src/org/apache/axis/handlers/ErrorHandler.java
  
  Index: ErrorHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/ErrorHandler.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ErrorHandler.java	7 Nov 2001 15:13:46 -0000	1.15
  +++ ErrorHandler.java	10 Jan 2002 20:00:59 -0000	1.16
  @@ -74,9 +74,4 @@
           throw new AxisFault( "Server.Whatever", "ERROR", null, null );
       }
   
  -    public void undo(MessageContext msgContext) {
  -        category.debug(JavaUtils.getMessage("enter00", "ErrorHandler::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "ErrorHandler::undo") );
  -    }
  -
   };
  
  
  
  1.11      +0 -8      xml-axis/java/src/org/apache/axis/handlers/JWSHandler.java
  
  Index: JWSHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/JWSHandler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JWSHandler.java	15 Nov 2001 14:07:39 -0000	1.10
  +++ JWSHandler.java	10 Jan 2002 20:00:59 -0000	1.11
  @@ -95,12 +95,4 @@
       public void generateWSDL(MessageContext msgContext) throws AxisFault {
           invoke(msgContext);
       }
  -
  -    public void undo(MessageContext msgContext)
  -    {
  -        if (category.isDebugEnabled()) {
  -            category.debug(JavaUtils.getMessage("enter00", "JWSHandler::undo"));
  -            category.debug(JavaUtils.getMessage("exit00", "JWSHandler::undo"));
  -        }
  -    }
   }
  
  
  
  1.32      +0 -8      xml-axis/java/src/org/apache/axis/handlers/JWSProcessor.java
  
  Index: JWSProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/JWSProcessor.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- JWSProcessor.java	10 Dec 2001 22:25:53 -0000	1.31
  +++ JWSProcessor.java	10 Jan 2002 20:00:59 -0000	1.32
  @@ -259,14 +259,6 @@
           invokeImpl(msgContext, true);
       }
   
  -    public void undo(MessageContext msgContext)
  -    {
  -        if (category.isDebugEnabled()) {
  -            category.debug(JavaUtils.getMessage("enter00", "JWSProcessor::undo"));
  -            category.debug(JavaUtils.getMessage("exit00", "JWSProcessor::undo"));
  -        }
  -    }
  -
       private String getDefaultClasspath(MessageContext msgContext)
       {
           StringBuffer classpath = new StringBuffer();
  
  
  
  1.9       +0 -5      xml-axis/java/src/org/apache/axis/handlers/LogMessage.java
  
  Index: LogMessage.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/LogMessage.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- LogMessage.java	7 Nov 2001 15:13:46 -0000	1.8
  +++ LogMessage.java	10 Jan 2002 20:00:59 -0000	1.9
  @@ -80,9 +80,4 @@
           if (msg != null)
               category.log(Priority.INFO, msg);
       }
  -
  -    public void undo(MessageContext msgContext) {
  -        category.debug(JavaUtils.getMessage("enter00", "LogMessage::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "LogMessage::undo") );
  -    }
   }
  
  
  
  1.4       +0 -5      xml-axis/java/src/org/apache/axis/handlers/MD5AttachHandler.java
  
  Index: MD5AttachHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/MD5AttachHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MD5AttachHandler.java	3 Dec 2001 22:49:23 -0000	1.3
  +++ MD5AttachHandler.java	10 Jan 2002 20:00:59 -0000	1.4
  @@ -158,9 +158,4 @@
           category.debug(JavaUtils.getMessage("exit00", "EchoHandler::invoke") );
       }
   
  -    public void undo(MessageContext msgContext) {
  -        category.debug(JavaUtils.getMessage("enter00", "EchoHandler::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "EchoHandler::undo") );
  -    }
  -
   }
  
  
  
  1.24      +0 -13     xml-axis/java/src/org/apache/axis/handlers/SimpleAuthenticationHandler.java
  
  Index: SimpleAuthenticationHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/SimpleAuthenticationHandler.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- SimpleAuthenticationHandler.java	15 Nov 2001 12:08:11 -0000	1.23
  +++ SimpleAuthenticationHandler.java	10 Jan 2002 20:00:59 -0000	1.24
  @@ -130,17 +130,4 @@
                   "SimpleAuthenticationHandler::invoke") );
           }
       }
  -
  -    /**
  -     * Nothing to undo
  -     */
  -    public void undo(MessageContext msgContext) {
  -        if (category.isDebugEnabled()) {
  -            category.debug(JavaUtils.getMessage("enter00", 
  -                "SimpleAuthenticationHandler::undo") );
  -        
  -            category.debug(JavaUtils.getMessage("exit00", 
  -                "SimpleAuthenticationHandler::undo") );
  -        }
  -    }
   };
  
  
  
  1.11      +0 -5      xml-axis/java/src/org/apache/axis/handlers/SimpleSessionHandler.java
  
  Index: SimpleSessionHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/SimpleSessionHandler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SimpleSessionHandler.java	12 Dec 2001 18:17:52 -0000	1.10
  +++ SimpleSessionHandler.java	10 Jan 2002 20:00:59 -0000	1.11
  @@ -297,11 +297,6 @@
           return id;
       }
   
  -    public void undo(MessageContext msgContext) {
  -        category.debug(JavaUtils.getMessage("enter00", "SimpleSessionHandler::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "SimpleSessionHandler::undo") );
  -    }
  -
       /**
        * Set the reaper periodicity - convenience method for testing.
        *
  
  
  
  1.13      +0 -6      xml-axis/java/src/org/apache/axis/handlers/http/HTTPActionHandler.java
  
  Index: HTTPActionHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/http/HTTPActionHandler.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- HTTPActionHandler.java	7 Nov 2001 15:13:47 -0000	1.12
  +++ HTTPActionHandler.java	10 Jan 2002 20:01:00 -0000	1.13
  @@ -118,10 +118,4 @@
   
           category.debug(JavaUtils.getMessage("exit00", "HTTPActionHandler::invoke") );
       }
  -
  -    public void undo(MessageContext msgContext)
  -    {
  -        category.debug(JavaUtils.getMessage("enter00", "HTTPActionHandler::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "HTTPActionHandler::undo") );
  -    }
   }
  
  
  
  1.10      +0 -6      xml-axis/java/src/org/apache/axis/handlers/http/HTTPAuthHandler.java
  
  Index: HTTPAuthHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/http/HTTPAuthHandler.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- HTTPAuthHandler.java	7 Nov 2001 15:13:47 -0000	1.9
  +++ HTTPAuthHandler.java	10 Jan 2002 20:01:00 -0000	1.10
  @@ -103,10 +103,4 @@
   
           category.debug(JavaUtils.getMessage("exit00", "HTTPAuthHandler::invoke") );
       }
  -
  -    public void undo(MessageContext msgContext) 
  -    {
  -        category.debug(JavaUtils.getMessage("enter00", "HTTPActionHandler::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "HTTPActionHandler::undo") );
  -    }
   }
  
  
  
  1.13      +0 -6      xml-axis/java/src/org/apache/axis/handlers/http/URLMapper.java
  
  Index: URLMapper.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/http/URLMapper.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- URLMapper.java	7 Nov 2001 15:13:47 -0000	1.12
  +++ URLMapper.java	10 Jan 2002 20:01:00 -0000	1.13
  @@ -93,10 +93,4 @@
       public void generateWSDL(MessageContext msgContext) throws AxisFault {
           invoke(msgContext);
       }
  -
  -    public void undo(MessageContext msgContext)
  -    {
  -        category.debug(JavaUtils.getMessage("enter00", "URLMapper::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "URLMapper::undo") );
  -    }
   }
  
  
  
  1.42      +0 -2      xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java
  
  Index: SOAPService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- SOAPService.java	3 Jan 2002 18:08:28 -0000	1.41
  +++ SOAPService.java	10 Jan 2002 20:01:00 -0000	1.42
  @@ -111,8 +111,6 @@
       private class SOAPRequestHandler extends BasicHandler {
           public SOAPRequestHandler() {}
   
  -        public void undo(MessageContext msgContext) {}
  -
           public void invoke(MessageContext msgContext) throws AxisFault {
               // Do SOAP semantics here
               if (category.isDebugEnabled()) {
  
  
  
  1.3       +0 -3      xml-axis/java/src/org/apache/axis/providers/BSFProvider.java
  
  Index: BSFProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/BSFProvider.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BSFProvider.java	30 Oct 2001 14:19:30 -0000	1.2
  +++ BSFProvider.java	10 Jan 2002 20:01:00 -0000	1.3
  @@ -66,7 +66,4 @@
       public void invoke(MessageContext msgContext) {
           System.out.println(getOption("Script"));
       }
  -
  -    public void undo(MessageContext msgContext) {
  -    }
   }
  
  
  
  1.3       +0 -3      xml-axis/java/src/org/apache/axis/providers/ComProvider.java
  
  Index: ComProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/ComProvider.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ComProvider.java	30 Oct 2001 14:19:30 -0000	1.2
  +++ ComProvider.java	10 Jan 2002 20:01:00 -0000	1.3
  @@ -65,8 +65,5 @@
       
       public void invoke(MessageContext msgContext) {
       }
  -
  -    public void undo(MessageContext msgContext) {
  -    }
       
   }
  
  
  
  1.3       +0 -3      xml-axis/java/src/org/apache/axis/providers/JWSProvider.java
  
  Index: JWSProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/JWSProvider.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JWSProvider.java	30 Oct 2001 14:19:30 -0000	1.2
  +++ JWSProvider.java	10 Jan 2002 20:01:00 -0000	1.3
  @@ -61,7 +61,4 @@
       
       public void invoke(MessageContext msgContext) {
       }
  -
  -    public void undo(MessageContext msgContext) {
  -    }
   }
  
  
  
  1.31      +0 -5      xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java
  
  Index: JavaProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- JavaProvider.java	12 Dec 2001 18:17:52 -0000	1.30
  +++ JavaProvider.java	10 Jan 2002 20:01:00 -0000	1.31
  @@ -320,11 +320,6 @@
   
   
   
  -    public void undo(MessageContext msgContext) {
  -        category.debug(JavaUtils.getMessage("enter00", "RPCDispatchHandler::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "RPCDispatchHandler::undo") );
  -    }
  -
       ///////////////////////////////////////////////////////////////
       ///////////////////////////////////////////////////////////////
       /////// Default methods for java classes. Override, eg, for
  
  
  
  1.21      +0 -6      xml-axis/java/src/org/apache/axis/providers/java/MsgProvider.java
  
  Index: MsgProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/MsgProvider.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- MsgProvider.java	17 Dec 2001 00:57:41 -0000	1.20
  +++ MsgProvider.java	10 Jan 2002 20:01:00 -0000	1.21
  @@ -244,10 +244,4 @@
               resEnv.addBodyElement(el);
           }
       }
  -    
  -    
  -    public void undo(MessageContext msgContext) {
  -        category.debug(JavaUtils.getMessage("enter00", "MsgDispatcherHandler::undo") );
  -        category.debug(JavaUtils.getMessage("exit00", "MsgDispatcherHandler::undo") );
  -    }
   };
  
  
  
  1.54      +1 -8      xml-axis/java/src/org/apache/axis/server/AxisServer.java
  
  Index: AxisServer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/server/AxisServer.java,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- AxisServer.java	12 Dec 2001 18:17:52 -0000	1.53
  +++ AxisServer.java	10 Jan 2002 20:01:00 -0000	1.54
  @@ -462,11 +462,4 @@
                   "AxisServer::generateWSDL") );
           }
       }
  -
  -    public void undo(MessageContext msgContext) {
  -        if (category.isDebugEnabled()) {
  -            category.debug(JavaUtils.getMessage("enter00", "AxisServer::undo"));
  -            category.debug(JavaUtils.getMessage("exit00", "AxisServer::undo"));
  -        }
  -    };
  -};
  +}
  
  
  
  1.45      +1 -11     xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java
  
  Index: HTTPSender.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- HTTPSender.java	12 Dec 2001 18:17:52 -0000	1.44
  +++ HTTPSender.java	10 Jan 2002 20:01:01 -0000	1.45
  @@ -723,15 +723,5 @@
           }
           return true;
       }
  -
  -
  -    public void undo(MessageContext msgContext) {
  -        if (category.isDebugEnabled()) {
  -            category.debug( JavaUtils.getMessage("enter00", 
  -                "HTTPDispatchHandler::undo") );
  -            category.debug( JavaUtils.getMessage("exit00", 
  -                "HTTPDispatchHandler::undo") );
  -        }
  -    }
  -};
  +}
   
  
  
  
  1.11      +1 -10     xml-axis/java/src/org/apache/axis/transport/local/LocalResponder.java
  
  Index: LocalResponder.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/local/LocalResponder.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- LocalResponder.java	15 Nov 2001 14:45:57 -0000	1.10
  +++ LocalResponder.java	10 Jan 2002 20:01:01 -0000	1.11
  @@ -84,13 +84,4 @@
                   "LocalResponder::invoke") );
           }
       }
  -
  -    public void undo(MessageContext msgContext) {
  -        if (category.isDebugEnabled()) {
  -            category.debug(JavaUtils.getMessage("enter00", 
  -                "LocalResponder::undo") );
  -            category.debug(JavaUtils.getMessage("exit00", 
  -                "LocalResponder::undo") );
  -        }
  -    }
  -};
  +}
  
  
  
  1.23      +1 -11     xml-axis/java/src/org/apache/axis/transport/local/LocalSender.java
  
  Index: LocalSender.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/local/LocalSender.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- LocalSender.java	12 Dec 2001 18:17:52 -0000	1.22
  +++ LocalSender.java	10 Jan 2002 20:01:01 -0000	1.23
  @@ -174,14 +174,4 @@
                   "LocalSender::invoke"));
           }
       }
  -
  -    public void undo(MessageContext msgContext) {
  -        if (category.isDebugEnabled()) {
  -            category.debug(JavaUtils.getMessage("enter00", 
  -                "LocalSender::undo"));
  -
  -            category.debug(JavaUtils.getMessage("exit00", 
  -                "LocalSender::undo"));
  -        }
  -    }
  -};
  +}
  
  
  
  1.2       +1 -0      xml-axis/java/test/chains/PackageTests.java
  
  Index: PackageTests.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/chains/PackageTests.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PackageTests.java	7 Jan 2002 15:15:53 -0000	1.1
  +++ PackageTests.java	10 Jan 2002 20:01:01 -0000	1.2
  @@ -16,6 +16,7 @@
           TestSuite suite = new TestSuite("All axis Chain tests");
   
           suite.addTest(TestSimpleChain.suite());
  +        suite.addTest(TestChainFault.suite());
           return suite;
       }
   }
  
  
  
  1.4       +0 -1      xml-axis/java/test/chains/TestSimpleChain.java
  
  Index: TestSimpleChain.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/chains/TestSimpleChain.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestSimpleChain.java	8 Jan 2002 14:51:39 -0000	1.3
  +++ TestSimpleChain.java	10 Jan 2002 20:01:01 -0000	1.4
  @@ -81,7 +81,6 @@
       private class TestHandler extends BasicHandler {
           public TestHandler() {}
           public void invoke(MessageContext msgContext) throws AxisFault {}
  -        public void undo(MessageContext msgContext) {}
       }
   
       public void testSimpleChainAddHandler()
  
  
  
  1.1                  xml-axis/java/test/chains/TestChainFault.java
  
  Index: TestChainFault.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Axis" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package test.chains;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  
  import org.apache.axis.SimpleChain;
  import org.apache.axis.Handler;
  import org.apache.axis.handlers.BasicHandler;
  import org.apache.axis.MessageContext;
  import org.apache.axis.AxisFault;
  
  public class TestChainFault extends TestCase
  {
      public TestChainFault (String name) {
          super(name);
      }
  
      public static Test suite() {
          return new TestSuite(TestChainFault.class);
      }
  
      protected void setup() {
      }
  
      private class TestMessageContext extends MessageContext {
  
          private int hcount = 0;
  
          public TestMessageContext() {
              // A null engine is good enough for this test
              super(null);
          }
  
          public void incCount() {
              hcount++;
          }
  
          public void decCount() {
              hcount--;
          }
  
          public int count() {
              return hcount;
          }
      }
  
      private class TestHandler extends BasicHandler {
          private int chainPos;
          private boolean doFault = false;
  
          /* The following state really relates to a Message Context, so this Handler
           * must not be used for more than one Message Context. However, it
           * is sufficient for the purpose of this testcase.
           */
          private boolean invoked = false;
  
          public TestHandler(int pos) {
              chainPos = pos;
          }
  
          public void setToFault() {
              doFault = true;
          }
  
          public void invoke(MessageContext msgContext) throws AxisFault {
              TestMessageContext mc = (TestMessageContext)msgContext;
              assertEquals("Handler.invoke out of sequence", chainPos, mc.count());
              invoked = true;
              if (doFault) {
                  throw new AxisFault();
              }
              mc.incCount();
          }
  
          public void onFault(MessageContext msgContext) {
              TestMessageContext mc = (TestMessageContext)msgContext;
              mc.decCount();
              assertEquals("Handler.onFault out of sequence", chainPos, mc.count());
              assertTrue("Handler.onFault protocol error", invoked);
          }
      }
  
      public void testSimpleChainFaultAfterInvoke()
      {
          try {
              SimpleChain c = new SimpleChain();
              
              for (int i = 0; i < 5; i++) {
                  c.addHandler(new TestHandler(i));
              }
  
              TestMessageContext mc = new TestMessageContext();
              c.invoke(mc);
              c.onFault(mc);
              assertEquals("Some onFaults were missed", mc.count(), 0);
  
          } catch (Exception ex) {
              assertTrue("Unexpected exception", false);
          }
      }
  
      public void testSimpleChainFaultDuringInvoke()
      {
          try {
              SimpleChain c = new SimpleChain();
              
              for (int i = 0; i < 5; i++) {
                  TestHandler th = new TestHandler(i);
                  if (i == 3) {
                      th.setToFault();
                  }
                  c.addHandler(th);
              }
              
  
              TestMessageContext mc = new TestMessageContext();
              try {
                  c.invoke(mc);
                  assertTrue("Testcase error - didn't throw fault", false);
              } catch (AxisFault f) {
                  assertEquals("Some onFaults were missed", mc.count(), 0);
              }
  
          } catch (Exception ex) {
              assertTrue("Unexpected exception", false);
          }
      }
  }
  
  
  
  1.7       +0 -5      xml-axis/java/test/outparams/ServiceHandler.java
  
  Index: ServiceHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/outparams/ServiceHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ServiceHandler.java	30 Oct 2001 16:46:42 -0000	1.6
  +++ ServiceHandler.java	10 Jan 2002 20:01:01 -0000	1.7
  @@ -68,11 +68,6 @@
       public static final Float OUTPARAM2 = new Float(4.56);
       public static final Integer RESPONSE = new Integer(5);
   
  -    /** Must implement this in subclasses.
  -     */
  -    public void undo(MessageContext msgContext) {
  -    }
  -
       public void invoke(MessageContext msgContext) throws AxisFault {
           SOAPEnvelope env = new SOAPEnvelope();