You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Kevin Millsap <Mi...@iticentral.com> on 2001/01/28 15:13:31 UTC

RE: cvs commit: xml-axis/java/src/org/apache/axis/utils Constants .java

dug,
it seems that you are deeply involved in the apache-soap initiative.
if so could you contact the person administering the email discussion group,
and have them clear me out.....

i've tried to unsubscribe 3 times with no luck....
now i'm even getting random unsubscribe messages...

sorry to bother you, but i'm about to go on vacation, and don't need to have
5000 emails in my inbox when i return.... i think you could sympathize....

kpm

-----Original Message-----
From: dug@apache.org [mailto:dug@apache.org]
Sent: Friday, January 26, 2001 5:31 PM
To: xml-axis-cvs@apache.org
Subject: cvs commit: xml-axis/java/src/org/apache/axis/utils
Constants.java


dug         01/01/26 14:30:46

  Modified:    java/src/org/apache/axis/server SimpleAxisEngine.java
               java/src/org/apache/axis/server/transports AxisServlet.java
               java/src/org/apache/axis/utils Constants.java
  Log:
  Add caching to the HTTP T/L
  
  Revision  Changes    Path
  1.8       +11 -7
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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SimpleAxisEngine.java	2001/01/26 20:55:07	1.7
  +++ SimpleAxisEngine.java	2001/01/26 22:30:41	1.8
  @@ -74,20 +74,24 @@
     protected Hashtable options ;
   
     public void init() {
  -  }
  -
  -  public void cleanup() {
  -  };
  -
  -  public void invoke(MessageContext msgContext) throws AxisFault {
       // Load the simple handler registry and init it
       HandlerRegistry  hr = new SimpleHandlerRegistry();
       hr.init();
  +    addOption( Constants.HANDLER_REGISTRY, hr );
   
       // Load the simple deployed services registry and init it
       HandlerRegistry  sr = new SimpleServiceRegistry();
       sr.init();
  -    
  +    addOption( Constants.SERVICE_REGISTRY, sr );
  +  }
  +
  +  public void cleanup() {
  +  };
  +
  +  public void invoke(MessageContext msgContext) throws AxisFault {
  +    HandlerRegistry hr =
(HandlerRegistry)getOption(Constants.HANDLER_REGISTRY);
  +    HandlerRegistry sr =
(HandlerRegistry)getOption(Constants.SERVICE_REGISTRY);
  +
       String action = (String) msgContext.getProperty( Constants.MC_TARGET
);
       if ( action == null ) action = "EchoService" ;
   
  
  
  
  1.8       +14 -5
xml-axis/java/src/org/apache/axis/server/transports/AxisServlet.java
  
  Index: AxisServlet.java
  ===================================================================
  RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/server/transports/AxisServlet.ja
va,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AxisServlet.java	2001/01/26 20:55:08	1.7
  +++ AxisServlet.java	2001/01/26 22:30:44	1.8
  @@ -69,6 +69,9 @@
    * @author Doug Davis (dug@us.ibm.com)
    */
   public class AxisServlet extends HttpServlet {
  +
  +  private static final String AXIS_ENGINE = "AxisEngine" ;
  +
     public void init() {
     }
   
  @@ -85,9 +88,17 @@
       HttpSession    session = req.getSession();
   
       // Set-up the Axis Message objects...
  -    // This really shouldn't be a 'new' - we expect the Transport
Listener
  -    // toh have some sort of caching (probably) to make this less
expensive.
  -    SimpleAxisEngine  engine     = new SimpleAxisEngine();
  +    Handler  engine = null ;
  +
  +    synchronized(context) {
  +      engine = (Handler) context.getAttribute( AXIS_ENGINE );
  +      if ( engine == null ) {
  +        engine = new SimpleAxisEngine() ;   // Get name from config file
  +        context.setAttribute( AXIS_ENGINE, engine );
  +        engine.init();
  +      }
  +    }
  +
       MessageContext    msgContext = new MessageContext();
       Message           msg        = new Message( req, "ServletRequest" );
   
  @@ -100,9 +111,7 @@
   
       // Invoke the Axis engine...
       try {
  -      engine.init();
         engine.invoke( msgContext );
  -      engine.cleanup();
       }
       catch( Exception e ) {
         msgContext.setOutgoingMessage( new Message(e.toString(), "String" )
);
  
  
  
  1.5       +8 -0
xml-axis/java/src/org/apache/axis/utils/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/utils/Constants.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Constants.java	2001/01/26 17:31:43	1.4
  +++ Constants.java	2001/01/26 22:30:45	1.5
  @@ -58,6 +58,14 @@
   package org.apache.axis.utils ;
   
   public class Constants {
  +  // Some common Constants that should be used in local handler options
  +  // (Not all implementations will have these concepts - for example
  +  //  not all Engines will have notion of registries but defining these
  +  //  here should allow people to ask if they exist)
  +
//////////////////////////////////////////////////////////////////////////
  +  public static String HANDLER_REGISTRY = "HandlerRegistry" ;
  +  public static String SERVICE_REGISTRY = "ServiceRegistry" ;
  +
     // MessageContext Property Names
 
//////////////////////////////////////////////////////////////////////////
     public static String MC_TARGET       = "TargetAction" ;