axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/server SimpleAxisEngine.java
Date Sun, 11 Feb 2001 22:07:21 GMT
dug         01/02/11 14:07:21

  Modified:    java/src/org/apache/axis/handlers BasicHandler.java
                        HTTPActionHandler.java HTTPDispatchHandler.java
                        MsgDispatchHandler.java Router.java
                        SimpleAuthenticationHandler.java
                        SimpleAuthorizationHandler.java
               java/src/org/apache/axis/server SimpleAxisEngine.java
  Log:
  Made undo() abstract in BasicHandler - people need to explicitly
  think about what needs to happen during undo - for example, Router
  didn't have it implmented so it never undid anything - which is wrong.
  Since people need to put thought into the 'invoke' method I think
  they need to put thought into the 'undo' method as well.  Having it
  just default to nothing is asking for trouble.
  
  Revision  Changes    Path
  1.3       +5 -6      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicHandler.java	2001/02/10 04:39:55	1.2
  +++ BasicHandler.java	2001/02/11 22:07:17	1.3
  @@ -65,6 +65,7 @@
    * then override what you need to.
    * 
    * @author Glen Daniels (gdaniels@allaire.com)
  + * @author Doug Davis (dug@us.ibm.com
    */
   public abstract class BasicHandler implements Handler {
       protected Hashtable  options ;
  @@ -81,16 +82,14 @@
       {
       }
   
  -    public void undo(MessageContext msgContext)
  -    {
  -      Debug.Print( 1, "Enter: " + this.getClass().getName() + "::undo" );
  -      Debug.Print( 1, "Exit: " + this.getClass().getName() + "::undo" );
  -    }
  -    
       public boolean canHandleBlock(QName qname)
       {
           return false;
       }
  +
  +    /** Must implement this in subclasses.
  +     */
  +    public abstract void undo(MessageContext msgContext);
   
       /** Must implement this in subclasses.
        */
  
  
  
  1.2       +7 -0      xml-axis/java/src/org/apache/axis/handlers/HTTPActionHandler.java
  
  Index: HTTPActionHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/HTTPActionHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTTPActionHandler.java	2001/02/08 22:08:10	1.1
  +++ HTTPActionHandler.java	2001/02/11 22:07:17	1.2
  @@ -67,6 +67,7 @@
    * SOAPAction to a TARGET.
    * 
    * @author Glen Daniels (gdaniels@allaire.com)
  + * @author Doug Davis (dug@us.ibm.com)
    */
   public class HTTPActionHandler extends BasicHandler
   {
  @@ -79,5 +80,11 @@
   
           msgContext.setProperty(Constants.MC_TARGET, action);
           Debug.Print( 1, "Exit : HTTPActionHandler::invoke" );
  +    }
  +
  +    public void undo(MessageContext msgContext) 
  +    {
  +        Debug.Print( 1, "Enter: HTTPActionHandler::undo" );
  +        Debug.Print( 1, "Exit: HTTPActionHandler::undo" );
       }
   }
  
  
  
  1.11      +5 -0      xml-axis/java/src/org/apache/axis/handlers/HTTPDispatchHandler.java
  
  Index: HTTPDispatchHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/HTTPDispatchHandler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- HTTPDispatchHandler.java	2001/02/10 04:39:55	1.10
  +++ HTTPDispatchHandler.java	2001/02/11 22:07:17	1.11
  @@ -195,4 +195,9 @@
       } 
       Debug.Print( 1, "Exit: HTTPDispatchHandler::invoke" );
     }
  +
  +  public void undo(MessageContext msgContext) {
  +    Debug.Print( 1, "Enter: HTTPDispatchHandler::undo" );
  +    Debug.Print( 1, "Exit: HTTPDispatchHandler::undo" );
  +  }
   };
  
  
  
  1.3       +5 -0      xml-axis/java/src/org/apache/axis/handlers/MsgDispatchHandler.java
  
  Index: MsgDispatchHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/MsgDispatchHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MsgDispatchHandler.java	2001/02/10 04:39:55	1.2
  +++ MsgDispatchHandler.java	2001/02/11 22:07:17	1.3
  @@ -120,4 +120,9 @@
   
       Debug.Print( 1, "Exit: MsgDispatcherHandler::invoke" );
     }
  +
  +  public void undo(MessageContext msgContext) {
  +    Debug.Print( 1, "Enter: MsgDispatcherHandler::undo" );
  +    Debug.Print( 1, "Exit: MsgDispatcherHandler::undo" );
  +  }
   };
  
  
  
  1.2       +21 -0     xml-axis/java/src/org/apache/axis/handlers/Router.java
  
  Index: Router.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/Router.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Router.java	2001/02/08 22:08:10	1.1
  +++ Router.java	2001/02/11 22:07:18	1.2
  @@ -64,6 +64,7 @@
    * the MessageContext off to that Handler.
    * 
    * @author Glen Daniels (gdaniels@allaire.com)
  + * @author Doug Davis (dug@us.ibm.com)
    */
   public class Router extends BasicHandler
   {
  @@ -87,6 +88,26 @@
           msgContext.clearProperty(Constants.MC_TARGET);
           
           h.invoke(msgContext);
  +
  +        msgContext.setProperty(Constants.MC_TARGET, target);
           Debug.Print( 1, "Exit : Router::invoke" );
  +    }
  +
  +    public void undo(MessageContext msgContext)
  +    {
  +        Debug.Print( 1, "Enter: Router::undo" );
  +        SimpleServiceRegistry registry = (SimpleServiceRegistry)msgContext.getProperty(Constants.SERVICE_REGISTRY);
  +        
  +        String target = (String)msgContext.getProperty(Constants.MC_TARGET);
  +        
  +        Handler h = registry.find( target );
  +
  +        // Make sure next dispatch, if any, is clean so we don't loop back.
  +        msgContext.clearProperty(Constants.MC_TARGET);
  +        
  +        h.undo(msgContext);
  +
  +        msgContext.setProperty(Constants.MC_TARGET, target);
  +        Debug.Print( 1, "Exit: Router::undo" );
       }
   }
  
  
  
  1.4       +4 -0      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SimpleAuthenticationHandler.java	2001/02/10 04:39:55	1.3
  +++ SimpleAuthenticationHandler.java	2001/02/11 22:07:18	1.4
  @@ -123,4 +123,8 @@
       }
       Debug.Print( 1, "Exit: SimpleAuthenticationHandler::invoke" );
     }
  +  public void undo(MessageContext msgContext) {
  +    Debug.Print( 1, "Enter: SimpleAuthenticationHandler::undo" );
  +    Debug.Print( 1, "Exit: SimpleAuthenticationHandler::undo" );
  +  }
   };
  
  
  
  1.5       +5 -0      xml-axis/java/src/org/apache/axis/handlers/SimpleAuthorizationHandler.java
  
  Index: SimpleAuthorizationHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/SimpleAuthorizationHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SimpleAuthorizationHandler.java	2001/02/10 04:39:55	1.4
  +++ SimpleAuthorizationHandler.java	2001/02/11 22:07:18	1.5
  @@ -124,4 +124,9 @@
       }
       Debug.Print( 1, "Exit: SimpleAuthorizationHandler::invoke" );
     }
  +
  +  public void undo(MessageContext msgContext) {
  +    Debug.Print( 1, "Enter: SimpleAuthenticationHandler::undo" );
  +    Debug.Print( 1, "Exit: SimpleAuthenticationHandler::undo" );
  +  }
   };
  
  
  
  1.16      +28 -23    xml-axis/java/src/org/apache/axis/server/SimpleAxisEngine.java
  
  Index: SimpleAxisEngine.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/server/SimpleAxisEngine.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SimpleAxisEngine.java	2001/02/11 01:35:19	1.15
  +++ SimpleAxisEngine.java	2001/02/11 22:07:20	1.16
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    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
  @@ -18,7 +18,7 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    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,
  @@ -26,7 +26,7 @@
    *
    * 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 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -66,25 +66,25 @@
    * @author Doug Davis (dug@us.ibm.com)
    * @author Glen Daniels (gdaniels@allaire.com)
    */
  -public class SimpleAxisEngine extends BasicHandler 
  +public class SimpleAxisEngine extends BasicHandler
   {
  -	public SimpleAxisEngine() {}
  -	
  -	/**
  -	 * Allows the Listener to specify which handler/service registry
  -	 * implementation they want to use.
  -	 */
  -	public SimpleAxisEngine(HandlerRegistry handlers, HandlerRegistry services) 
  -	{
  -		Debug.Print( 1, "Enter: SimpleAxisEngine::Constructor");
  -		handlers.init();
  -		services.init();
  -		addOption(Constants.HANDLER_REGISTRY, handlers);
  -		addOption(Constants.SERVICE_REGISTRY, services);
  -		Debug.Print( 1, "Exit: SimpleAxisEngine::Constructor");
  -	}
  -	
  -	/**
  +        public SimpleAxisEngine() {}
  +
  +        /**
  +         * Allows the Listener to specify which handler/service registry
  +         * implementation they want to use.
  +         */
  +        public SimpleAxisEngine(HandlerRegistry handlers, HandlerRegistry services)
  +        {
  +                Debug.Print( 1, "Enter: SimpleAxisEngine::Constructor");
  +                handlers.init();
  +                services.init();
  +                addOption(Constants.HANDLER_REGISTRY, handlers);
  +                addOption(Constants.SERVICE_REGISTRY, services);
  +                Debug.Print( 1, "Exit: SimpleAxisEngine::Constructor");
  +        }
  +
  +        /**
        * Find/load the registries and save them so we don't need to do this
        * each time we're called.
        */
  @@ -110,7 +110,7 @@
           Debug.Print( 1, "Enter: SimpleAxisEngine::invoke" );
           HandlerRegistry hr = (HandlerRegistry)getOption(Constants.HANDLER_REGISTRY);
           HandlerRegistry sr = (HandlerRegistry)getOption(Constants.SERVICE_REGISTRY);
  -        
  +
           /** Make sure later Handlers can get this directly.
           */
           msgContext.setProperty(Constants.SERVICE_REGISTRY, sr);
  @@ -148,6 +148,11 @@
           }
           h.cleanup();   // ???
           Debug.Print( 1, "Exit: SimpleAxisEngine::invoke" );
  +    };
  +
  +    public void undo(MessageContext msgContext) {
  +        Debug.Print( 1, "Enter: SimpleAxisEngine::undo" );
  +        Debug.Print( 1, "Exit: SimpleAxisEngine::undo" );
       };
   
   };
  
  
  

Mime
View raw message