tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans GlobalResourcesLifecycleListener.java
Date Wed, 23 Jan 2002 02:38:01 GMT
remm        02/01/22 18:38:01

  Modified:    catalina/src/share/org/apache/catalina/mbeans
                        GlobalResourcesLifecycleListener.java
  Log:
  - Remove fixme.
  
  Revision  Changes    Path
  1.2       +11 -14    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java
  
  Index: GlobalResourcesLifecycleListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GlobalResourcesLifecycleListener.java	23 Jan 2002 01:23:57 -0000	1.1
  +++ GlobalResourcesLifecycleListener.java	23 Jan 2002 02:38:01 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java,v
1.1 2002/01/23 01:23:57 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/01/23 01:23:57 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java,v
1.2 2002/01/23 02:38:01 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/01/23 02:38:01 $
    *
    * ====================================================================
    *
  @@ -70,6 +70,7 @@
   import javax.management.ObjectName;
   import javax.naming.Binding;
   import javax.naming.Context;
  +import javax.naming.InitialContext;
   import javax.naming.NamingEnumeration;
   import javax.naming.NamingException;
   import org.apache.catalina.Group;
  @@ -90,7 +91,7 @@
    * management.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2002/01/23 01:23:57 $
  + * @version $Revision: 1.2 $ $Date: 2002/01/23 02:38:01 $
    * @since 4.1
    */
   
  @@ -160,17 +161,13 @@
       protected void createMBeans() {
   
           // Look up our global naming context
  -        // FIXME - getGlobalNamingContext should be on Server
  -        if (!(component instanceof StandardServer)) {
  -            throw new IllegalArgumentException
  -                ("Cannot create global resource MBeans for server " +
  -                 component);
  -        }
  -        StandardServer server = (StandardServer) component;
  -        Context context = server.getGlobalNamingContext();
  -        if (context == null) {
  +        Context context = null;
  +        try {
  +            context = (Context) (new InitialContext()).lookup("java:/");
  +        } catch (NamingException e) {
  +            e.printStackTrace();
               throw new IllegalStateException
  -                ("No global naming context defined for server " + server);
  +                ("No global naming context defined for server");
           }
   
           // Recurse through the defined global JNDI resources context
  
  
  

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


Mime
View raw message