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/utils Admin.java
Date Thu, 22 Mar 2001 14:49:09 GMT
dug         01/03/22 06:49:09

  Modified:    java/src/org/apache/axis/client AxisClient.java
                        HTTPMessage.java
               java/src/org/apache/axis/handlers
                        SimpleAuthenticationHandler.java
                        SimpleAuthorizationHandler.java
               java/src/org/apache/axis/registries SupplierRegistry.java
               java/src/org/apache/axis/server AxisServer.java
               java/src/org/apache/axis/transport/http AxisServlet.java
                        HTTPDispatchHandler.java
               java/src/org/apache/axis/utils Admin.java
  Added:       java/src/org/apache/axis/registries
                        DefaultHandlerRegistry.java
                        DefaultServiceRegistry.java
  Removed:     java/samples/xml init.xml
  Log:
  Removed the need for init.xml
  
  By default if there are no registry files (*.reg) then a default list
  of handlers and services will be defined.  This list will not be written
  out to disk until a service or handler is deploy/undeployed.  The thinking
  here is that if nothing is defined then they're dead in the water so we
  should at least give them something but once they do some admin function
  they're on their own.  This will only be true for the Default registries,
  if they define their own then they're on their own for this this default
  handler/service stuff too.
  
  This means that w/o any Axis configuration what so ever (on the client or
  the server) you can run a *.jws Web Service right out of the box.
  
  Revision  Changes    Path
  1.4       +14 -28    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AxisClient.java	2001/03/08 12:44:58	1.3
  +++ AxisClient.java	2001/03/22 14:49:03	1.4
  @@ -92,38 +92,23 @@
           // Load the simple handler registry and init it
           Debug.Print( 1, "Enter: AxisClient::init" );
           //HandlerRegistry  hr = new SimpleRegistry("handlers.reg");
  -        HandlerRegistry  hr = new SupplierRegistry("handlers-supp.reg");
  +        DefaultHandlerRegistry  hr = 
  +          new DefaultHandlerRegistry("handlers-supp.reg");
  +        hr.setOnServer( false );
           hr.init();
           addOption( Constants.HANDLER_REGISTRY, hr );
   
           // Load the simple deployed services registry and init it
           //HandlerRegistry  sr = new SimpleRegistry("services.reg");
  -        HandlerRegistry  sr = new SupplierRegistry("services-supp.reg");
  +        DefaultServiceRegistry  sr = 
  +          new DefaultServiceRegistry("services-supp.reg");
  +        sr.setHandlerRegistry( hr ); // Needs to know about 'hr'
  +        sr.setOnServer( false );
           sr.init();
           addOption( Constants.SERVICE_REGISTRY, sr );
           Debug.Print( 1, "Exit: AxisClient::init" );
       }
   
  -    /** Look for the <b>name</b> in the registry.  If there is no
  -     *  registry then just see if <b>name</b> is a className, and if
  -     *  so, create a new instance of it.
  -     *  Should this go into the registry logic itself???
  -     */
  -    private Handler find(HandlerRegistry hr, String name) {
  -        Handler  h = null ;
  -        if ( name == null ) return( null );
  -        if ( hr != null ) h = hr.find( name);
  -        if ( h != null ) return( h );
  -        try {
  -            ClassLoader cl = new AxisClassLoader();
  -            Class       cls = cl.loadClass( name );
  -            h = (Handler) cls.newInstance();
  -        }
  -        catch( Exception e ) {
  -        }
  -        return( h );
  -    }
  -
       /**
        * Main routine of the AXIS server.  In short we locate the appropriate
        * handler for the desired service and invoke() it.
  @@ -152,7 +137,7 @@
             Debug.Print( 2, "EngineHandler: " + hName );
   
             if ( hName != null ) {
  -            h = find( hr, hName );
  +            h = hr.find( hName );
               if ( h != null ) 
                 h.invoke(msgContext);
               else
  @@ -182,7 +167,7 @@
               /* Process the Service Specific Request Chain */
               /**********************************************/
               hName =  msgContext.getTargetService();
  -            if ( hName != null && (h = find( sr, hName )) != null ) {
  +            if ( hName != null && (h = sr.find( hName )) != null ) {
                 if ( h instanceof SimpleTargetedChain ) {
                   service = (SimpleTargetedChain) h ;
                   h = service.getInputChain();
  @@ -193,13 +178,13 @@
               /* Process the Global Input Chain */
               /**********************************/
               hName = Constants.GLOBAL_INPUT ;
  -            if ( hName != null  && (h = find( hr, hName )) != null )
  +            if ( hName != null  && (h = hr.find( hName )) != null )
                   h.invoke(msgContext);
     
               /* Process the Transport Specific Input Chain */
               /**********************************************/
               hName = msgContext.getStrProp(MessageContext.TRANS_INPUT);
  -            if ( hName != null && (h = find( hr, hName )) != null )
  +            if ( hName != null && (h = hr.find( hName )) != null )
                 h.invoke(msgContext);
     
               /* Note: at the end of the transport specific input chain should */
  @@ -209,13 +194,13 @@
               /* Process the Transport Specific Output Chain */
               /***********************************************/
               hName = msgContext.getStrProp(MessageContext.TRANS_OUTPUT);
  -            if ( hName != null  && (h = find( hr, hName )) != null )
  +            if ( hName != null  && (h = hr.find( hName )) != null )
                 h.invoke(msgContext);
     
               /* Process the Global Output Chain */
               /***********************************/
               hName = Constants.GLOBAL_OUTPUT ;
  -            if ( hName != null && (h = find( hr, hName )) != null )
  +            if ( hName != null && (h = hr.find( hName )) != null )
                 h.invoke(msgContext);
     
               if ( service != null ) {
  @@ -230,6 +215,7 @@
           }
           catch( Exception e ) {
               // Should we even bother catching it ?
  +            Debug.Print( 1, e );
               if ( !(e instanceof AxisFault) ) e = new AxisFault( e );
               throw (AxisFault) e ;
           }
  
  
  
  1.21      +1 -3      xml-axis/java/src/org/apache/axis/client/HTTPMessage.java
  
  Index: HTTPMessage.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/HTTPMessage.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- HTTPMessage.java	2001/03/21 01:17:12	1.20
  +++ HTTPMessage.java	2001/03/22 14:49:03	1.21
  @@ -190,9 +190,7 @@
         HandlerRegistry sr = (HandlerRegistry) client.getOption( 
                                                    Constants.SERVICE_REGISTRY );
         if ( sr == null || sr.find("HTTP.input") == null )
  -        msgContext.setProperty( 
  -                      MessageContext.TRANS_INPUT,
  -                      "org.apache.axis.transport.http.HTTPDispatchHandler" );
  +        msgContext.setProperty( MessageContext.TRANS_INPUT, "HTTPSender" );
         else
           msgContext.setProperty( MessageContext.TRANS_INPUT, "HTTP.input" );
         msgContext.setProperty(MessageContext.TRANS_OUTPUT, "HTTP.output" );
  
  
  
  1.8       +0 -5      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SimpleAuthenticationHandler.java	2001/03/13 06:46:19	1.7
  +++ SimpleAuthenticationHandler.java	2001/03/22 14:49:03	1.8
  @@ -115,11 +115,6 @@
                                null, null );
       }
       catch( Exception e ) {
  -      // If no file - just allow everyone!
  -      if ( e instanceof FileNotFoundException ) {
  -        Debug.Print( 1, "No 'users.lst' file found" );
  -        return ;
  -      }
         Debug.Print( 1, e );
         if ( !(e instanceof AxisFault) ) e = new AxisFault(e);
         throw (AxisFault) e ;
  
  
  
  1.9       +0 -5      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SimpleAuthorizationHandler.java	2001/03/13 06:46:19	1.8
  +++ SimpleAuthorizationHandler.java	2001/03/22 14:49:03	1.9
  @@ -117,11 +117,6 @@
                                null, null );
       }
       catch( Exception e ) {
  -      // If no file - just allow everyone!
  -      if ( e instanceof FileNotFoundException ) {
  -        Debug.Print( 1, "No 'perms.lst' file found" );
  -        return ;
  -      }
         Debug.Print( 1, e );
         if ( !(e instanceof AxisFault) ) e = new AxisFault(e);
         throw (AxisFault) e ;
  
  
  
  1.4       +3 -2      xml-axis/java/src/org/apache/axis/registries/SupplierRegistry.java
  
  Index: SupplierRegistry.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/registries/SupplierRegistry.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SupplierRegistry.java	2001/02/20 22:51:29	1.3
  +++ SupplierRegistry.java	2001/03/22 14:49:04	1.4
  @@ -67,6 +67,7 @@
    * allows creational dynamics to be configured on a per-handler basis.
    *
    * @author Glen Daniels (gdaniels@allaire.com)
  + * @author Doug Davis (dug@us.ibm.com)
    */
   public class SupplierRegistry implements HandlerRegistry {
       protected String     fileName;
  @@ -145,7 +146,7 @@
           return( result );
       }
   
  -    private void load() { 
  +    protected void load() { 
           try {
               FileInputStream    fis = new FileInputStream( fileName );
               ObjectInputStream  ois = new ObjectInputStream( fis );
  @@ -158,7 +159,7 @@
           }
       }
   
  -    private void save() {
  +    protected void save() {
           try {
               FileOutputStream    fos = new FileOutputStream( fileName );
               ObjectOutputStream  oos = new ObjectOutputStream( fos );
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/registries/DefaultHandlerRegistry.java
  
  Index: DefaultHandlerRegistry.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 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 org.apache.axis.registries ;
  
  import java.io.* ;
  import java.util.* ;
  import org.jdom.* ;
  import org.jdom.input.DOMBuilder ;
  
  import org.apache.axis.* ;
  import org.apache.axis.utils.Debug ;
  import org.apache.axis.utils.Admin ;
  import org.apache.axis.suppliers.* ;
  import org.apache.axis.registries.* ;
  
  /** 
   *
   * @author Doug Davis (dug@us.ibm.com)
   */
  public class DefaultHandlerRegistry extends SupplierRegistry {
    private boolean dontSave = false ;
    private boolean onServer = false ;
    private String  clientXML = 
  "<deploy>" +
  "  <!-- HTTP Transport Sender -->"+
  "  <handler name=\"HTTPSender\" "+
  "           class=\"org.apache.axis.transport.http.HTTPDispatchHandler\"/>"+
  "</deploy>" ;
  
    private String  serverXML = 
  "<deploy>" +
  "  <!-- A Debug Header Handler -->"+
  "  <handler name=\"debug\"   class=\"org.apache.axis.handlers.DebugHandler\"/>"+
  ""+
  "  <!-- SOAP Server Protocol Handler -->"+
  "  <handler name=\"SOAPServer\""+
  "           class=\"org.apache.axis.handlers.SOAPServerHandler\"/>"+
  ""+
  "  <!-- Global input/output chains -->"+
  "  <chain name=\"global.input\" flow=\"debug\"/>"+
  "  <!-- <chain name=\"global.output\" flow=\"xxx\"/> -->"+
  ""+
  "  <!-- Message processing dispatcher -->"+
  "  <handler name=\"MsgDispatcher\""+
  "           class=\"org.apache.axis.handlers.MsgDispatchHandler\"/>"+
  ""+
  "  <!-- RPC processing dispatcher -->"+
  "  <handler name=\"RPCDispatcher\""+
  "           class=\"org.apache.axis.handlers.RPCDispatchHandler\"/>"+
  ""+
  "  <!-- JWS file processor/executor and service -->"+
  "  <handler name=\"jwsprocessor\" "+
  "           class=\"org.apache.axis.handlers.JWSProcessor\"/>"+
  ""+
  "  <!-- HTTP Transport Sender -->"+
  "  <handler name=\"HTTPSender\" "+
  "           class=\"org.apache.axis.transport.http.HTTPDispatchHandler\"/>"+
  ""+
  "  <!-- Handler that sets the Target field of the bag based on the -->"+
  "  <!-- URL and/or the SOAPAction HTTP header field                -->"+
  "  <handler name=\"HTTPAction\""+
  "           class=\"org.apache.axis.handlers.HTTPActionHandler\"/>"+
  ""+
  "  <!-- Define HTTP Transport Specific Input/Output Chains -->"+
  "  <chain name=\"HTTP.input\" flow=\"HTTPAction\"/>"+
  "  <!-- <chain name=\"HTTP.output\" flow=\"xxx\"/> -->"+
  "</deploy>" ;
  
    public DefaultHandlerRegistry(String fileName) {
     super( fileName );
    }
  
    public void setOnServer(boolean b) {
      onServer = b ;
    }
  
    public void setDontSave(boolean b) {
      dontSave = b ;
    }
    
    protected void load() { 
      super.load();
      if ( suppliers != null && suppliers.size() != 0 ) 
        return ;
  
      /* If we got here then there was no registry on the filesystem */
      /* or it was empty, which means they're dead in the water,   */
      /* so let's just load some default handlers/services.  In a  */
      /* system that's been properly configured we should never hit  */
      /* this section.                         */
      /* Set the 'dontSave' flag so that we don't save this list to  */
      /* the filesystem.  We'll only start to save it once they've   */
      /* actually done an add/remove - this will prevent us from   */
      /* creating a registry on disk for the non-configured case.  */
      /***************************************************************/
      dontSave = true ;
  
      MessageContext  msgContext = new MessageContext();
      Admin                 admin      = new Admin();
      ByteArrayInputStream  input      = null ;
  
      msgContext.setProperty(Constants.HANDLER_REGISTRY, this);
      input = new ByteArrayInputStream( (onServer ? serverXML : 
                                                    clientXML).getBytes() );
  
      DOMBuilder            builder    = new DOMBuilder();
      Document              doc        = null ;
  
      try {
        doc = builder.build( input );
        admin.AdminService( msgContext, doc );
      }
      catch( Exception e ) {
        e.printStackTrace();
      }
  
      dontSave = false ;
    }
  
    protected void save() {
      if ( dontSave ) return ;
      super.save();
    }
  };
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/registries/DefaultServiceRegistry.java
  
  Index: DefaultServiceRegistry.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 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 org.apache.axis.registries ;
  
  import java.io.* ;
  import java.util.* ;
  import org.jdom.* ;
  import org.jdom.input.DOMBuilder ;
  
  import org.apache.axis.* ;
  import org.apache.axis.utils.Debug ;
  import org.apache.axis.utils.Admin ;
  import org.apache.axis.suppliers.* ;
  import org.apache.axis.registries.* ;
  
  /** 
   *
   * @author Doug Davis (dug@us.ibm.com)
   */
  public class DefaultServiceRegistry extends SupplierRegistry {
    private boolean          dontSave = false ;
    private HandlerRegistry  handlerRegistry = null ;
    private boolean          onServer = false ;
  
    private String  clientXML = 
  "<deploy>" +
  "</deploy>" ;
  
    private String  serverXML = 
  "<deploy>" +
  "  <!-- JWS file processor/executor and service -->"+
  "  <service name=\"JWSProcessor\" pivot=\"jwsprocessor\" />" +
  ""+
  "<!-- Deploy the Admin Service so people can remotely deploy -->"+
  "  <service name=\"AdminService\" pivot=\"MsgDispatcher\">"+
  "    <option name=\"className\" value=\"org.apache.axis.utils.Admin\" />"+
  "    <option name=\"methodName\" value=\"AdminService\" />"+
  "  </service>"+
  "</deploy>" ;
  
    public DefaultServiceRegistry(String fileName) {
     super( fileName );
    }
  
    public void setHandlerRegistry(HandlerRegistry hr) {
      handlerRegistry = hr ;
    }
  
    public void setOnServer(boolean b) {
      onServer = b ;
    }
    
    protected void load() { 
      super.load();
      if ( suppliers != null && suppliers.size() != 0 ) 
        return ;
  
      /* If we got here then there was no registry on the filesystem */
      /* or it was empty, which means they're dead in the water,   */
      /* so let's just load some default handlers/services.  In a  */
      /* system that's been properly configured we should never hit  */
      /* this section.                         */
      /* Set the 'dontSave' flag so that we don't save this list to  */
      /* the filesystem.  We'll only start to save it once they've   */
      /* actually done an add/remove - this will prevent us from   */
      /* creating a registry on disk for the non-configured case.  */
      /***************************************************************/
      if ( handlerRegistry == null ) return ;
      dontSave = true ;
      if ( handlerRegistry instanceof DefaultHandlerRegistry )
        ((DefaultHandlerRegistry)handlerRegistry).setDontSave(true);
  
      MessageContext  msgContext = new MessageContext();
      Admin                 admin      = new Admin();
      ByteArrayInputStream  input      = null ;
  
      msgContext.setProperty(Constants.HANDLER_REGISTRY, handlerRegistry);
      msgContext.setProperty(Constants.SERVICE_REGISTRY, this);
      input = new ByteArrayInputStream( (onServer ? serverXML : 
                                                    clientXML).getBytes() );
  
      DOMBuilder            builder    = new DOMBuilder();
      Document              doc        = null ;
  
      try {
        doc = builder.build( input );
        admin.AdminService( msgContext, doc );
      }
      catch( Exception e ) {
        e.printStackTrace();
      }
  
      dontSave = false ;
      if ( handlerRegistry instanceof DefaultHandlerRegistry )
        ((DefaultHandlerRegistry)handlerRegistry).setDontSave(false);
    }
  
    protected void save() {
      if ( dontSave ) return ;
      super.save();
    }
  };
  
  
  
  1.4       +13 -28    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AxisServer.java	2001/03/08 12:45:00	1.3
  +++ AxisServer.java	2001/03/22 14:49:06	1.4
  @@ -92,38 +92,23 @@
           // Load the simple handler registry and init it
           Debug.Print( 1, "Enter: AxisServer::init" );
           //HandlerRegistry  hr = new SimpleRegistry("handlers.reg");
  -        HandlerRegistry  hr = new SupplierRegistry("handlers-supp.reg");
  +        DefaultHandlerRegistry  hr = 
  +          new DefaultHandlerRegistry("handlers-supp.reg");
  +        hr.setOnServer( true );
           hr.init();
           addOption( Constants.HANDLER_REGISTRY, hr );
   
           // Load the simple deployed services registry and init it
           //HandlerRegistry  sr = new SimpleRegistry("services.reg");
  -        HandlerRegistry  sr = new SupplierRegistry("services-supp.reg");
  +        DefaultServiceRegistry  sr = 
  +          new DefaultServiceRegistry("services-supp.reg");
  +        sr.setHandlerRegistry( hr ); // needs to know about 'hr'
  +        sr.setOnServer( true );
           sr.init();
           addOption( Constants.SERVICE_REGISTRY, sr );
           Debug.Print( 1, "Exit: AxisServer::init" );
       }
   
  -    /** Look for the <b>name</b> in the registry.  If there is no
  -     *  registry then just see if <b>name</b> is a className, and if
  -     *  so, create a new instance of it.
  -     *  Should this go into the registry logic itself???
  -     */
  -    private Handler find(HandlerRegistry hr, String name) {
  -        Handler  h = null ;
  -        if ( name == null ) return( null );
  -        if ( hr != null ) h = hr.find( name);
  -        if ( h != null ) return( h );
  -        try {
  -            ClassLoader cl = new AxisClassLoader();
  -            Class       cls = cl.loadClass( name );
  -            h = (Handler) cls.newInstance();
  -        }
  -        catch( Exception e ) {
  -        }
  -        return( h );
  -    }
  -
       /**
        * Main routine of the AXIS server.  In short we locate the appropriate
        * handler for the desired service and invoke() it.
  @@ -148,7 +133,7 @@
           try {
             hName = msgContext.getStrProp( MessageContext.ENGINE_HANDLER );
             if ( hName != null ) {
  -              if ( hr == null || (h = find(hr, hName)) == null ) {
  +              if ( hr == null || (h = hr.find(hName)) == null ) {
                   ClassLoader cl = new AxisClassLoader();
                   try {
                     Debug.Print( 2, "Trying to load class: " + hName );
  @@ -187,20 +172,20 @@
                 /* Process the Transport Specific Input Chain */
                 /**********************************************/
                 hName = msgContext.getStrProp(MessageContext.TRANS_INPUT);
  -              if ( hName != null && (h = find( hr, hName )) != null )
  +              if ( hName != null && (h = hr.find( hName )) != null )
                   h.invoke(msgContext);
         
                 /* Process the Global Input Chain */
                 /**********************************/
                 hName = Constants.GLOBAL_INPUT ;
  -              if ( hName != null  && (h = find( hr, hName )) != null )
  +              if ( hName != null  && (h = hr.find( hName )) != null )
                     h.invoke(msgContext);
         
                 /* Process the Protocol Specific-Handler/Chain */
                 /***********************************************/
                 hName = msgContext.getStrProp(MessageContext.PROTOCOL_HANDLER);
                 if ( hName == null ) hName = "SOAPServer" ;
  -              if ( hName != null && (h = find( hr, hName )) != null )
  +              if ( hName != null && (h = hr.find( hName )) != null )
                   h.invoke(msgContext);
                 else
                   throw new AxisFault( "Server.error",
  @@ -210,13 +195,13 @@
                 /* Process the Global Output Chain */
                 /***********************************/
                 hName = Constants.GLOBAL_OUTPUT ;
  -              if ( hName != null && (h = find( hr, hName )) != null )
  +              if ( hName != null && (h = hr.find( hName )) != null )
                   h.invoke(msgContext);
         
                 /* Process the Transport Specific Output Chain */
                 /***********************************************/
                 hName = msgContext.getStrProp(MessageContext.TRANS_OUTPUT);
  -              if ( hName != null  && (h = find( hr, hName )) != null )
  +              if ( hName != null  && (h = hr.find( hName )) != null )
                   h.invoke(msgContext);
             }
           }
  
  
  
  1.9       +1 -1      xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java
  
  Index: AxisServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AxisServlet.java	2001/03/08 01:15:22	1.8
  +++ AxisServlet.java	2001/03/22 14:49:06	1.9
  @@ -94,8 +94,8 @@
         engine = (Handler) context.getAttribute( AXIS_ENGINE );
         if ( engine == null ) {
           engine = new AxisServer();
  -        context.setAttribute( AXIS_ENGINE, engine );
           engine.init();
  +        context.setAttribute( AXIS_ENGINE, engine );
         }
       }
   
  
  
  
  1.9       +10 -0     xml-axis/java/src/org/apache/axis/transport/http/HTTPDispatchHandler.java
  
  Index: HTTPDispatchHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/HTTPDispatchHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- HTTPDispatchHandler.java	2001/03/19 12:42:03	1.8
  +++ HTTPDispatchHandler.java	2001/03/22 14:49:06	1.9
  @@ -204,6 +204,16 @@
             len = 0 ;
           }
         }
  +
  +      if ( b != -1 && Debug.getDebugLevel() > 8 ) {
  +        // Special case - if the debug level is this high then something
  +        // really bad must be going on - so just dump the input stream
  +        // to stdout.
  +        while ( (b = (byte) inp.read()) != -1 )
  +          System.err.print(b);
  +        System.err.println("");
  +      }
  +
         if ( b != -1 ) {
           SAXBuilder parser = new SAXBuilder();
           Document doc = parser.build(inp);
  
  
  
  1.20      +6 -6      xml-axis/java/src/org/apache/axis/utils/Admin.java
  
  Index: Admin.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/Admin.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Admin.java	2001/03/09 19:25:33	1.19
  +++ Admin.java	2001/03/22 14:49:09	1.20
  @@ -183,11 +183,11 @@
     
           if ( action.equals( "undeploy" ) ) {
             if ( type.equals("service") ) {
  -            System.out.println("Undeploying " + type + ": " + name );
  +            Debug.Print( 2, "Undeploying " + type + ": " + name );
               sr.remove( name );
             }
             else if ( type.equals("handler") || type.equals("chain") ) {
  -            System.out.println("Undeploying " + type + ": " + name );
  +            Debug.Print( 2, "Undeploying " + type + ": " + name );
               hr.remove( name );
             }
             else
  @@ -208,7 +208,7 @@
     
           if ( type.equals( "handler" ) ) {
             String   cls   = elem.getAttributeValue( "class" );
  -          System.out.println( "Deploying handler: " + name );
  +          Debug.Print( 2, "Deploying handler: " + name );
             
             if (hr instanceof SupplierRegistry) {
               String lifeCycle = elem.getAttributeValue("lifecycle");
  @@ -233,7 +233,7 @@
           }
           else if ( type.equals( "chain" ) ) {
             if ( flow != null && flow.length() > 0 ) {
  -            System.out.println( "Deploying chain: " + name );
  +            Debug.Print( 2, "Deploying chain: " + name );
               Chain    c       = (Chain) hr.find( name );
   
               if ( c == null ) c = new SimpleChain();
  @@ -253,7 +253,7 @@
               hr.add( name, c );
             }
             else {
  -            System.out.println( "Deploying chain: " + name );
  +            Debug.Print( 2, "Deploying chain: " + name );
               StringTokenizer      st = null ;
               SimpleTargetedChain  cc = null ;
               Chain                c  = null ;
  @@ -295,7 +295,7 @@
             }
           }
           else if ( type.equals( "service" ) ) {
  -          System.out.println( "Deploying service: " + name );
  +          Debug.Print( 2, "Deploying service: " + name );
             StringTokenizer      st = null ;
             SimpleTargetedChain  cc = null ;
             Chain                c  = null ;
  
  
  

Mime
View raw message