costin      2003/03/16 23:32:53

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardHost.java
  Log:
  Forgot to mention in the last commit: if no realm is set explicitely, JAAS will be
  created automatically. I'll make it default to the name of the engine - so the
  jaas application id will also match the engine name, jmx domain, jvmroute, etc.
  ( unless explicitely configured otherwise )
  
  In Host - same "register itself if not done already". Name no longer includes 
service.
  In embeded case - when the object is created, it'll register itself with the engine
  ( using the same domain name and the well-known name of the engine )
  
  Revision  Changes    Path
  1.5       +29 -4     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StandardHost.java 12 Mar 2003 06:28:55 -0000      1.4
  +++ StandardHost.java 17 Mar 2003 07:32:53 -0000      1.5
  @@ -756,7 +756,21 @@
        *  that prevents it from being started
        */
       public synchronized void start() throws LifecycleException {
  -
  +        if( started ) {
  +            return;
  +        }
  +        if( oname==null ) {
  +            // not registered in JMX yet - standalone mode
  +            try {
  +                StandardEngine engine=(StandardEngine)parent;
  +                domain=engine.getName();
  +                log.info( "Register " + domain );
  +                oname=new ObjectName(domain + ":type=Host,host=" +
  +                        this.getName());
  +            } catch( Throwable t ) {
  +                log.info("Error registering ", t );
  +            }
  +        }
           // Set error report valve
           if ((errorReportValveClass != null)
               && (!errorReportValveClass.equals(""))) {
  @@ -1018,10 +1032,12 @@
       }
   
       public void init() throws Exception {
  +        // already registered.
           if( getParent() != null ) return;
   
  -        ObjectName serviceName=new ObjectName(domain +
  -                ":type=Engine,name=Tomcat-Standalone");
  +        // Register with the Engine
  +        ObjectName serviceName=new ObjectName(domain + ":type=Engine");
  +
           if( mserver.isRegistered( serviceName )) {
               log.info("Registering with the Engine");
               try {
  @@ -1033,4 +1049,13 @@
               }
           }
       }
  +
  +    public ObjectName createObjectName(String domain, ObjectName parent)
  +        throws Exception
  +    {
  +        if( log.isDebugEnabled())
  +            log.debug("Create ObjectName " + domain + " " + parent );
  +        return new ObjectName( domain + ":type=Host,name=" + getName());
  +    }
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to