avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/activation/src/java/org/apache/avalon/activation/appliance/impl DefaultServiceContext.java
Date Tue, 09 Sep 2003 02:12:47 GMT
mcconnell    2003/09/08 19:12:47

  Modified:    merlin/activation/src/java/org/apache/avalon/activation/appliance/impl
                        DefaultServiceContext.java
  Log:
  Add support for access to an optional JMX MBeanServer.
  
  Revision  Changes    Path
  1.2       +25 -3     avalon-sandbox/merlin/activation/src/java/org/apache/avalon/activation/appliance/impl/DefaultServiceContext.java
  
  Index: DefaultServiceContext.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/activation/src/java/org/apache/avalon/activation/appliance/impl/DefaultServiceContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultServiceContext.java	7 Aug 2003 17:11:16 -0000	1.1
  +++ DefaultServiceContext.java	9 Sep 2003 02:12:47 -0000	1.2
  @@ -50,7 +50,10 @@
   
   package org.apache.avalon.activation.appliance.impl;
   
  +import javax.management.MBeanServer;
  +
   import org.apache.excalibur.mpool.PoolManager;
  +import org.apache.avalon.activation.appliance.Appliance;
   import org.apache.avalon.activation.appliance.ServiceContext;
   import org.apache.avalon.composition.logging.LoggingManager;
   import org.apache.avalon.framework.context.DefaultContext;
  @@ -70,7 +73,7 @@
        *
        * @return the pool manager
        */
  -    public PoolManager getPoolManager()
  +    public PoolManager getPoolManager() throws IllegalStateException
       {
           try
           {
  @@ -89,7 +92,7 @@
        *
        * @return the logging manager
        */
  -    public LoggingManager getLoggingManager()
  +    public LoggingManager getLoggingManager() throws IllegalStateException
       {
           try
           {
  @@ -102,6 +105,25 @@
               throw new IllegalStateException( error );
           }
       }
  +
  +    /**
  +     * Return the MBean server. If no MBeanServer has been assigned the 
  +     * method will return null.
  +     *
  +     * @return the MBeanServer if available else null
  +     */
  +    public MBeanServer getMBeanServer()
  +    {
  +        try
  +        {
  +            return (MBeanServer) super.get( Appliance.MBEAN_SERVER_KEY );
  +        }
  +        catch( ContextException e )
  +        {
  +            return null;
  +        }
  +    }
  +
   
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message