tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5 MapperListener.java
Date Sat, 08 Mar 2003 06:52:37 GMT
costin      2003/03/07 22:52:36

  Modified:    coyote/src/java/org/apache/coyote/tomcat5
                        MapperListener.java
  Log:
  A Server is not required for non-standalone operation. In fact, Embeded doesn't define
   a server, and most apps embeding tomcat use this approach.
  
  All we care is an Engine.
  
  Revision  Changes    Path
  1.7       +14 -5     jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MapperListener.java	2 Mar 2003 16:11:57 -0000	1.6
  +++ MapperListener.java	8 Mar 2003 06:52:36 -0000	1.7
  @@ -80,6 +80,7 @@
   import org.apache.catalina.Host;
   import org.apache.catalina.ServerFactory;
   import org.apache.catalina.Wrapper;
  +import org.apache.catalina.Server;
   import org.apache.catalina.util.StringManager;
   
   
  @@ -226,11 +227,19 @@
        * Register host (FIXME).
        */
       private void registerHost(ObjectName objectName)
  -        throws Exception {
  -
  -        Container container = 
  -            ServerFactory.getServer().findServices()[0].getContainer();
  -
  +        throws Exception
  +    {
  +        Container container =null;
  +
  +        Server server=ServerFactory.getServer();
  +        if( server!= null ) {
  +            // a Server is not required
  +            container=server.findServices()[0].getContainer();
  +        } else {
  +            String domain="Catalina";
  +            ObjectName engineName=new ObjectName(domain + ":type=Engine,name=Tomcat-Standalone");
  +            container=(Container)mBeanServer.getAttribute(engineName, "managedResource");
  +        }
           Container[] hosts = null;
           String defaultHost = null;
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message