You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by le...@apache.org on 2002/03/04 16:01:13 UTC

cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel DefaultKernel.java Resources.properties

leosimons    02/03/04 07:01:13

  Modified:    src/java/org/apache/avalon/phoenix/components/kernel
                        DefaultKernel.java Resources.properties
  Log:
  register Applications with the SystemManager as they are loaded (no correct interface provided yet).
  
  Revision  Changes    Path
  1.51      +14 -0     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultKernel.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- DefaultKernel.java	1 Feb 2002 12:45:46 -0000	1.50
  +++ DefaultKernel.java	4 Mar 2002 15:01:13 -0000	1.51
  @@ -20,7 +20,9 @@
   import org.apache.avalon.phoenix.components.application.DefaultApplication;
   import org.apache.avalon.phoenix.interfaces.Application;
   import org.apache.avalon.phoenix.interfaces.ApplicationContext;
  +import org.apache.avalon.phoenix.interfaces.ApplicationMBean;
   import org.apache.avalon.phoenix.interfaces.ConfigurationRepository;
  +import org.apache.avalon.phoenix.interfaces.ManagerException;
   import org.apache.avalon.phoenix.interfaces.Kernel;
   import org.apache.avalon.phoenix.interfaces.KernelMBean;
   import org.apache.avalon.phoenix.interfaces.SystemManager;
  @@ -132,6 +134,18 @@
   
                   final String message =
                       REZ.getString( "kernel.error.entry.initialize", entry.getMetaData().getName() );
  +                throw new CascadingException( message, t );
  +            }
  +                
  +            // manage application
  +            try
  +            {
  +              	m_systemManager.register( name+" (Application)", application );
  +          	}
  +            catch( final Throwable t )
  +            {
  +                final String message =
  +                    REZ.getString( "kernel.error.entry.manage", entry.getMetaData().getName() );
                   throw new CascadingException( message, t );
               }
           }
  
  
  
  1.5       +1 -0      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/Resources.properties,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Resources.properties	1 Feb 2002 12:45:46 -0000	1.4
  +++ Resources.properties	4 Mar 2002 15:01:13 -0000	1.5
  @@ -2,6 +2,7 @@
   kernel.error.entry.start=Failed to start application {0}.
   kernel.error.entry.initialize=Failed to initialize application {0}.
   kernel.error.entry.nostop=Failed to stop application {0} as it is not initialized/started.
  +kernel.error.entry.manage=Failed to register application {0} with SystemManager.
   
   kernel.error.entry.nofind=Unable to locate Application by the name "{0}".
   kernel.error.entry.prepare=Error preparing application {0}.
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel DefaultKernel.java Resources.properties

Posted by Peter Donald <pe...@apache.org>.
Hi,

On Tue, 5 Mar 2002 02:01, leosimons@apache.org wrote:
>   +            // manage application
>   +            try
>   +            {
>   +              	m_systemManager.register( name+" (Application)",
> application ); +          	}

To folow the standard idoms of JMX you may want to replace this with 
something like

m_systemManager.register( name + ",type=Application", application )

which will allow you to searches for all applications.



-- 
Cheers,

Pete

-----------------------------------------------
|  If you turn on the light quickly enough,   |
|    you can see what the dark looks like.    |
-----------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>