avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application BlockEntry.java DefaultApplication.java DefaultBlockContext.java DependencyGraph.java LifecycleHelper.java
Date Sat, 17 Nov 2001 07:09:50 GMT
donaldp     01/11/16 23:09:50

  Modified:    src/java/org/apache/avalon/phoenix/components/deployer
                        DefaultDeployer.java DefaultDeploymentRecorder.java
                        PersistentDeploymentRecorder.java
               src/java/org/apache/avalon/phoenix/components/kernel
                        DefaultApplicationContext.java DefaultKernel.java
                        DefaultKernelMBean.java SarEntry.java
               src/java/org/apache/avalon/phoenix/components/manager
                        AbstractSystemManager.java DefaultManager.java
               src/java/org/apache/avalon/phoenix/components/logger
                        DefaultLogManager.java SimpleLogKitManager.java
               src/java/org/apache/avalon/phoenix/components/application
                        BlockEntry.java DefaultApplication.java
                        DefaultBlockContext.java DependencyGraph.java
                        LifecycleHelper.java
  Log:
  Ran styleformatter over codebase.
  
  Revision  Changes    Path
  1.13      +25 -24    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/DefaultDeployer.java
  
  Index: DefaultDeployer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/DefaultDeployer.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DefaultDeployer.java	2001/11/10 20:39:43	1.12
  +++ DefaultDeployer.java	2001/11/17 07:09:50	1.13
  @@ -9,8 +9,6 @@
   
   import java.io.File;
   import java.net.URL;
  -import java.util.HashMap;
  -import java.util.ArrayList;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.activity.Initializable;
  @@ -25,8 +23,8 @@
   import org.apache.avalon.phoenix.interfaces.ClassLoaderManager;
   import org.apache.avalon.phoenix.interfaces.ConfigurationRepository;
   import org.apache.avalon.phoenix.interfaces.Deployer;
  -import org.apache.avalon.phoenix.interfaces.DeploymentRecorder;
   import org.apache.avalon.phoenix.interfaces.DeploymentException;
  +import org.apache.avalon.phoenix.interfaces.DeploymentRecorder;
   import org.apache.avalon.phoenix.interfaces.Kernel;
   import org.apache.avalon.phoenix.interfaces.LogManager;
   import org.apache.avalon.phoenix.metadata.BlockListenerMetaData;
  @@ -51,16 +49,16 @@
       private static final Resources REZ =
           ResourceManager.getPackageResources( DefaultDeployer.class );
   
  -    private final DefaultConfigurationBuilder  m_builder  = new DefaultConfigurationBuilder();
  -    private final Assembler          m_assembler     = new Assembler();
  -    private final SarVerifier        m_verifier      = new SarVerifier();
  -    private final Installer          m_installer     = new Installer();
  -
  -    private LogManager               m_logManager;
  -    private Kernel                   m_kernel;
  -    private ConfigurationRepository  m_repository;
  -    private ClassLoaderManager       m_classLoaderManager;
  -    private DeploymentRecorder       m_recorder;
  +    private final DefaultConfigurationBuilder m_builder = new DefaultConfigurationBuilder();
  +    private final Assembler m_assembler = new Assembler();
  +    private final SarVerifier m_verifier = new SarVerifier();
  +    private final Installer m_installer = new Installer();
  +
  +    private LogManager m_logManager;
  +    private Kernel m_kernel;
  +    private ConfigurationRepository m_repository;
  +    private ClassLoaderManager m_classLoaderManager;
  +    private DeploymentRecorder m_recorder;
   
       /**
        * Retrieve relevent services needed to deploy.
  @@ -96,21 +94,21 @@
           throws DeploymentException
       {
           try
  -        {            
  +        {
               final Application application = m_kernel.getApplication( name );
               final String[] blocks = application.getBlockNames();
  -            
  +
               m_kernel.removeApplication( name );
  -            
  +
               for( int i = 0; i < blocks.length; i++ )
  -            {                
  +            {
                   //remove configuration from repository
  -                m_repository.storeConfiguration( name, blocks[i], null );
  +                m_repository.storeConfiguration( name, blocks[ i ], null );
               }
  -            
  +
               final Installation installation = m_recorder.fetchInstallation( name );
               m_installer.uninstall( installation );
  -            
  +
               //erase installation information
               m_recorder.recordInstallation( name, null );
           }
  @@ -133,11 +131,11 @@
           try
           {
               Installation installation = m_recorder.fetchInstallation( name );
  -            
  -            if ( null == installation )
  +
  +            if( null == installation )
               {
                   //fresh installation
  -                installation = m_installer.install( location );            
  +                installation = m_installer.install( location );
                   m_recorder.recordInstallation( name, installation );
               }
   
  @@ -232,7 +230,10 @@
                   throw new DeploymentException( message );
               }
   
  -            try { m_repository.storeConfiguration( appName, name, configuration ); }
  +            try
  +            {
  +                m_repository.storeConfiguration( appName, name, configuration );
  +            }
               catch( final ConfigurationException ce )
               {
                   throw new DeploymentException( ce.getMessage(), ce );
  
  
  
  1.6       +4 -4      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/DefaultDeploymentRecorder.java
  
  Index: DefaultDeploymentRecorder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/DefaultDeploymentRecorder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultDeploymentRecorder.java	2001/11/09 21:14:30	1.5
  +++ DefaultDeploymentRecorder.java	2001/11/17 07:09:50	1.6
  @@ -14,17 +14,17 @@
   import org.apache.avalon.phoenix.tools.installer.Installation;
   
   /**
  - * Recorder for application deployment specific information. 
  + * Recorder for application deployment specific information.
    *
    * @author <a href="mailto:mirceatoma@home.com">Mircea Toma</a>
    */
  -public class DefaultDeploymentRecorder 
  -    extends AbstractLogEnabled 
  +public class DefaultDeploymentRecorder
  +    extends AbstractLogEnabled
       implements DeploymentRecorder
   {
       private final HashMap m_installations = new HashMap();
   
  -    public synchronized void recordInstallation( final String name, final Installation installation ) 
  +    public synchronized void recordInstallation( final String name, final Installation installation )
           throws DeploymentException
       {
           if( null == installation )
  
  
  
  1.5       +72 -72    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/PersistentDeploymentRecorder.java
  
  Index: PersistentDeploymentRecorder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/PersistentDeploymentRecorder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PersistentDeploymentRecorder.java	2001/11/13 23:25:59	1.4
  +++ PersistentDeploymentRecorder.java	2001/11/17 07:09:50	1.5
  @@ -8,66 +8,66 @@
   package org.apache.avalon.phoenix.components.deployer;
   
   import java.io.File;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.excalibur.i18n.ResourceManager;
  +import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
   import org.apache.avalon.framework.configuration.DefaultConfigurationSerializer;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.excalibur.i18n.ResourceManager;
  -import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.avalon.phoenix.interfaces.DeploymentRecorder;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.phoenix.interfaces.DeploymentException;
  -import org.apache.avalon.phoenix.tools.installer.Installation;
  +import org.apache.avalon.phoenix.interfaces.DeploymentRecorder;
   import org.apache.avalon.phoenix.tools.installer.FileDigest;
  +import org.apache.avalon.phoenix.tools.installer.Installation;
   
   /**
    * Recorder for application deployment specific information. This implementation
  - * persists the information in order to be reconstructed. 
  + * persists the information in order to be reconstructed.
    *
    * @author <a href="mailto:mirceatoma@home.com">Mircea Toma</a>
    */
  -public class PersistentDeploymentRecorder extends AbstractLogEnabled implements DeploymentRecorder {
  +public class PersistentDeploymentRecorder extends AbstractLogEnabled implements DeploymentRecorder
  +{
   
       private static final Resources REZ =
           ResourceManager.getPackageResources( PersistentDeploymentRecorder.class );
   
  -    private final static String PHOENIX_HOME  = System.getProperty( "phoenix.home", ".." );
  -    private final static String VAR_PATH      =  PHOENIX_HOME + File.separator + 
  +    private final static String PHOENIX_HOME = System.getProperty( "phoenix.home", ".." );
  +    private final static String VAR_PATH = PHOENIX_HOME + File.separator +
           "conf" + File.separator + "installs";
       private final static String DIGEST_SUFFIX = "install.log";
  -    
  -    private final static String SOURCE      = "source";
  -    private final static String DIRECTORY   = "directory";
  -    private final static String CONFIG      = "config";
  -    private final static String ASSEMBLY    = "assembly";
  +
  +    private final static String SOURCE = "source";
  +    private final static String DIRECTORY = "directory";
  +    private final static String CONFIG = "config";
  +    private final static String ASSEMBLY = "assembly";
       private final static String ENVIRONMENT = "environment";
  -    private final static String CLASSPATH   = "classpath";
  -    private final static String PATH        = "path";
  -    private final static String URL         = "url";
  -    private final static String DIGESTS     = "digests";
  -    private final static String DIGEST      = "digest";
  -    private final static String TIMESTAMP   = "timestamp";
  -    private final static String FILE        = "file";
  -    private final static String CHECKSUM    = "checksum";
  -    
  +    private final static String CLASSPATH = "classpath";
  +    private final static String PATH = "path";
  +    private final static String URL = "url";
  +    private final static String DIGESTS = "digests";
  +    private final static String DIGEST = "digest";
  +    private final static String TIMESTAMP = "timestamp";
  +    private final static String FILE = "file";
  +    private final static String CHECKSUM = "checksum";
  +
       private final DefaultConfigurationBuilder m_builder = new DefaultConfigurationBuilder();
       private final DefaultConfigurationSerializer m_serializer = new DefaultConfigurationSerializer();
  -    
  -    public synchronized void recordInstallation( final String name, final Installation installation ) 
  -       throws DeploymentException
  +
  +    public synchronized void recordInstallation( final String name, final Installation installation )
  +        throws DeploymentException
       {
           final File file = getDigestFile( name );
  -        
  -        if ( null == installation ) 
  +
  +        if( null == installation )
           {
               //remove installation digest file
               if( file.exists() ) file.delete();
               return;
           }
  -            
  -        try 
  -        {                                    
  +
  +        try
  +        {
               final DefaultConfiguration configuration = new DefaultConfiguration( "installation", null );
               configuration.setAttribute( SOURCE, installation.getSource().getCanonicalPath() );
               configuration.setAttribute( DIRECTORY, installation.getDirectory().getCanonicalPath() );
  @@ -75,55 +75,55 @@
               configuration.setAttribute( ASSEMBLY, installation.getAssembly() );
               configuration.setAttribute( ENVIRONMENT, installation.getEnvironment() );
               configuration.setAttribute( TIMESTAMP, Long.toString( installation.getTimestamp() ) );
  -            
  +
               final DefaultConfiguration classpath = new DefaultConfiguration( CLASSPATH, null );
               final String[] urls = installation.getClassPath();
  -            for ( int i = 0; i < urls.length; i++ )
  +            for( int i = 0; i < urls.length; i++ )
               {
                   final DefaultConfiguration path = new DefaultConfiguration( PATH, null );
  -                path.setAttribute( URL, urls[i] );
  +                path.setAttribute( URL, urls[ i ] );
                   classpath.addChild( path );
               }
               configuration.addChild( classpath );
  -            
  +
               final DefaultConfiguration digests = new DefaultConfiguration( DIGESTS, null );
               final FileDigest[] fileDigests = installation.getFileDigests();
  -            for ( int i = 0; i < fileDigests.length; i++ )
  +            for( int i = 0; i < fileDigests.length; i++ )
               {
                   final DefaultConfiguration digest = new DefaultConfiguration( DIGEST, null );
  -                digest.setAttribute( FILE, fileDigests[i].getFile().getCanonicalPath() );
  -                digest.setAttribute( CHECKSUM, String.valueOf( fileDigests[i].getChecksum() ) );
  +                digest.setAttribute( FILE, fileDigests[ i ].getFile().getCanonicalPath() );
  +                digest.setAttribute( CHECKSUM, String.valueOf( fileDigests[ i ].getChecksum() ) );
                   digests.addChild( digest );
  -            }            
  +            }
               configuration.addChild( digests );
  -            
  +
               //create 'conf/installs' directory if not present
               final File var = new File( VAR_PATH );
               if( !var.exists() ) var.mkdirs();
  -                        
  +
               m_serializer.serializeToFile( file, configuration );
  -            
  -            final String message = 
  +
  +            final String message =
                   REZ.getString( "recorder.notice.persist.successful", name, file );
               getLogger().debug( message );
           }
  -        catch ( Exception e )
  +        catch( Exception e )
           {
               final String message = REZ.getString( "recorder.warn.persist.failed", name );
               getLogger().warn( message, e );
  -            
  +
               //delete traces
               file.delete();
           }
  -    }           
  +    }
   
  -    public synchronized Installation fetchInstallation( final String name ) 
  -       throws DeploymentException
  +    public synchronized Installation fetchInstallation( final String name )
  +        throws DeploymentException
       {
           final File file = getDigestFile( name );
           if( !file.exists() ) return null;
  -            
  -        try 
  +
  +        try
           {
               final Configuration configuration = m_builder.buildFromFile( file );
   
  @@ -134,41 +134,41 @@
               final String environment = configuration.getAttribute( ENVIRONMENT );
               final long timestamp = configuration.getAttributeAsLong( TIMESTAMP );
   
  -            final Configuration[] paths = configuration.getChild( CLASSPATH, true).getChildren( PATH );
  +            final Configuration[] paths = configuration.getChild( CLASSPATH, true ).getChildren( PATH );
               final String[] classPath = new String[ paths.length ];
  -            for ( int i = 0; i < paths.length; i++ )
  +            for( int i = 0; i < paths.length; i++ )
               {
  -                classPath[i] = paths[i].getAttribute( URL );
  -            }            
  -            
  -            final Configuration[] digests = configuration.getChild( DIGESTS, true).getChildren( DIGEST );
  -            final FileDigest[] fileDigests = new FileDigest[digests.length];
  -            for ( int i = 0; i < digests.length; i++ )
  +                classPath[ i ] = paths[ i ].getAttribute( URL );
  +            }
  +
  +            final Configuration[] digests = configuration.getChild( DIGESTS, true ).getChildren( DIGEST );
  +            final FileDigest[] fileDigests = new FileDigest[ digests.length ];
  +            for( int i = 0; i < digests.length; i++ )
               {
  -                final File installedFile = new File( digests[i].getAttribute( FILE ) );
  -                final long checksum = digests[i].getAttributeAsLong( CHECKSUM );
  +                final File installedFile = new File( digests[ i ].getAttribute( FILE ) );
  +                final long checksum = digests[ i ].getAttributeAsLong( CHECKSUM );
                   final FileDigest digest = new FileDigest( installedFile, checksum );
  -            }            
  +            }
   
  -            final String message = 
  +            final String message =
                   REZ.getString( "recorder.notice.rebuild.successful", name, file );
               getLogger().debug( message );
  -            
  -            return new Installation( source, directory, config, assembly, environment, 
  +
  +            return new Installation( source, directory, config, assembly, environment,
                                        classPath, fileDigests, timestamp );
           }
  -        catch ( Exception e )
  +        catch( Exception e )
           {
               final String message = REZ.getString( "recorder.warn.rebuild.failed", name );
               getLogger().warn( message, e );
  -            
  +
               //force re-installation
               return null;
  -        }            
  -    }        
  -    
  +        }
  +    }
  +
       private File getDigestFile( final String name )
  -    {                
  +    {
           return new File( VAR_PATH, name + "-" + DIGEST_SUFFIX );
  -    }    
  +    }
   }
  
  
  
  1.6       +3 -3      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultApplicationContext.java
  
  Index: DefaultApplicationContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultApplicationContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultApplicationContext.java	2001/11/09 21:14:30	1.5
  +++ DefaultApplicationContext.java	2001/11/17 07:09:50	1.6
  @@ -41,13 +41,13 @@
           ResourceManager.getPackageResources( DefaultApplicationContext.class );
   
       ///Map of thread pools for application
  -    private HashMap      m_threadPools     = new HashMap();
  +    private HashMap m_threadPools = new HashMap();
   
       //LogKitManager for application
  -    private Hierarchy    m_hierarchy;
  +    private Hierarchy m_hierarchy;
   
       ///ClassLoader for application
  -    private ClassLoader  m_classLoader;
  +    private ClassLoader m_classLoader;
   
       ///ThreadContext for application
       private ThreadContext m_threadContext;
  
  
  
  1.44      +15 -13    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.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- DefaultKernel.java	2001/11/09 21:14:30	1.43
  +++ DefaultKernel.java	2001/11/17 07:09:50	1.44
  @@ -15,10 +15,7 @@
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.component.DefaultComponentManager;
  -import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.context.Contextualizable;
  -import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.phoenix.components.application.DefaultApplication;
   import org.apache.avalon.phoenix.interfaces.Application;
  @@ -49,12 +46,12 @@
           ResourceManager.getPackageResources( DefaultKernel.class );
   
       ///SystemManager provided by Embeddor
  -    private SystemManager            m_systemManager;
  +    private SystemManager m_systemManager;
   
       ///Configuration Repository
  -    private ConfigurationRepository  m_repository;
  +    private ConfigurationRepository m_repository;
   
  -    private HashMap                  m_entrys = new HashMap();
  +    private HashMap m_entrys = new HashMap();
   
       public void compose( final ComponentManager componentManager )
           throws ComponentException
  @@ -94,8 +91,10 @@
       public Application getApplication( final String name )
       {
           final SarEntry entry = (SarEntry)m_entrys.get( name );
  -        if( null == entry ) return null;
  -        else return entry.getApplication();
  +        if( null == entry )
  +            return null;
  +        else
  +            return entry.getApplication();
       }
   
       /**
  @@ -167,7 +166,10 @@
           final SarEntry entry = new SarEntry( metaData, classLoader, hierarchy, server );
           m_entrys.put( name, entry );
   
  -        try { startup( (SarEntry)entry ); }
  +        try
  +        {
  +            startup( (SarEntry)entry );
  +        }
           catch( final Exception e )
           {
               final String message = REZ.getString( "kernel.error.entry.start", name );
  @@ -188,7 +190,7 @@
           if( context instanceof Composable )
           {
               final ComponentManager componentManager = createComponentManager();
  -            ((Composable)context).compose( componentManager );
  +            ( (Composable)context ).compose( componentManager );
           }
   
           //TODO: Remove me once we can remove the ThreadPool stuff
  @@ -204,15 +206,15 @@
           componentManager.makeReadOnly();
           return componentManager;
       }
  -    
  +
       public void removeApplication( String name ) throws Exception
       {
           final SarEntry entry = (SarEntry)m_entrys.get( name );
  -        if( null != entry )        
  +        if( null != entry )
           {
               shutdown( entry );
               m_entrys.remove( name );
           }
       }
  -    
  +
   }
  
  
  
  1.4       +3 -3      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultKernelMBean.java
  
  Index: DefaultKernelMBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultKernelMBean.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultKernelMBean.java	2001/09/30 05:26:15	1.3
  +++ DefaultKernelMBean.java	2001/11/17 07:09:50	1.4
  @@ -11,7 +11,7 @@
   
   /**
    * The manager for the kernel. Used to test ConstructiveMBean.
  - * 
  + *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
   public class DefaultKernelMBean
  @@ -23,14 +23,14 @@
       }
   
       /**
  -     * Utility method called to define manageable 
  +     * Utility method called to define manageable
        * objects attributes and operations.
        */
       protected void defineObject()
       {
           addAttribute( "applicationNames", false );
   
  -        final String[] params = new String[] { String.class.getName() };
  +        final String[] params = new String[]{ String.class.getName() };
           addOperation( "getApplication", params, INFO );
       }
   }
  
  
  
  1.6       +5 -6      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/SarEntry.java
  
  Index: SarEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/SarEntry.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SarEntry.java	2001/09/27 05:04:12	1.5
  +++ SarEntry.java	2001/11/17 07:09:50	1.6
  @@ -7,7 +7,6 @@
    */
   package org.apache.avalon.phoenix.components.kernel;
   
  -import java.net.URL;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.phoenix.interfaces.Application;
   import org.apache.avalon.phoenix.metadata.SarMetaData;
  @@ -20,11 +19,11 @@
    */
   final class SarEntry
   {
  -    private SarMetaData     m_metaData;
  -    private Configuration   m_configuration;
  -    private ClassLoader     m_classLoader;
  -    private Application     m_application;
  -    private Hierarchy       m_hierarchy;
  +    private SarMetaData m_metaData;
  +    private Configuration m_configuration;
  +    private ClassLoader m_classLoader;
  +    private Application m_application;
  +    private Hierarchy m_hierarchy;
   
       protected SarEntry( final SarMetaData metaData,
                           final ClassLoader classLoader,
  
  
  
  1.6       +4 -4      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/AbstractSystemManager.java
  
  Index: AbstractSystemManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/AbstractSystemManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractSystemManager.java	2001/11/09 21:14:31	1.5
  +++ AbstractSystemManager.java	2001/11/17 07:09:50	1.6
  @@ -29,16 +29,16 @@
       protected final static class ManagedEntry
       {
           ///Object passed in for management
  -        protected Object   m_object;
  +        protected Object m_object;
   
           ///Interfaces object wants to be managed through (can be null)
  -        protected Class[]  m_interfaces;
  +        protected Class[] m_interfaces;
   
           ///Object representation when exported (usually a proxy)
  -        protected Object   m_exportedObject;
  +        protected Object m_exportedObject;
       }
   
  -    private HashMap       m_entrys = new HashMap();
  +    private HashMap m_entrys = new HashMap();
   
       /**
        * Register an object for management.
  
  
  
  1.4       +21 -23    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/DefaultManager.java
  
  Index: DefaultManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/DefaultManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultManager.java	2001/09/30 04:33:57	1.3
  +++ DefaultManager.java	2001/11/17 07:09:50	1.4
  @@ -7,12 +7,12 @@
    */
   package org.apache.avalon.phoenix.components.manager;
   
  +import com.sun.jdmk.comm.HtmlAdaptorServer;
   import java.rmi.Remote;
   import java.rmi.registry.LocateRegistry;
   import java.rmi.registry.Registry;
   import java.rmi.server.RemoteObject;
   import java.rmi.server.UnicastRemoteObject;
  -import javax.management.DynamicMBean;
   import javax.management.MBeanServer;
   import javax.management.ObjectName;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
  @@ -23,6 +23,8 @@
   import org.apache.avalon.framework.parameters.ParameterException;
   import org.apache.avalon.framework.parameters.Parameterizable;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.avalon.phoenix.components.kernel.DefaultKernel;
  +import org.apache.avalon.phoenix.components.kernel.DefaultKernelMBean;
   import org.apache.avalon.phoenix.interfaces.ClassLoaderManager;
   import org.apache.avalon.phoenix.interfaces.ConfigurationRepository;
   import org.apache.avalon.phoenix.interfaces.Deployer;
  @@ -30,12 +32,8 @@
   import org.apache.avalon.phoenix.interfaces.Kernel;
   import org.apache.avalon.phoenix.interfaces.LogManager;
   import org.apache.avalon.phoenix.interfaces.ManagerException;
  -import org.apache.avalon.phoenix.interfaces.SystemManager;
  -import org.apache.avalon.phoenix.components.kernel.DefaultKernel;
  -import org.apache.avalon.phoenix.components.kernel.DefaultKernelMBean;
   import org.apache.jmx.adaptor.RMIAdaptorImpl;
   import org.apache.jmx.introspector.JavaBeanMBean;
  -import com.sun.jdmk.comm.HtmlAdaptorServer;
   
   /**
    * This component is responsible for managing phoenix instance.
  @@ -54,23 +52,23 @@
       private static final int DEFAULT_REGISTRY_PORT =
           Integer.getInteger( "phoenix.port", 1111 ).intValue();
   
  -    private Parameters      m_parameters;
  -    private MBeanServer     m_mBeanServer;
  -    private RMIAdaptorImpl  m_rmiAdaptor;
  -    private Registry        m_rmiRegistry;
  +    private Parameters m_parameters;
  +    private MBeanServer m_mBeanServer;
  +    private RMIAdaptorImpl m_rmiAdaptor;
  +    private Registry m_rmiRegistry;
   
       ///Name Adaptor registered with
  -    private String          m_name;
  +    private String m_name;
   
       ///Name Adaptor registered with
  -    private String          m_domain = "Phoenix";
  +    private String m_domain = "Phoenix";
   
  -    private Embeddor                 m_embeddor;
  -    private Deployer                 m_deployer;
  -    private LogManager               m_logManager;
  -    private Kernel                   m_kernel;
  -    private ConfigurationRepository  m_repository;
  -    private ClassLoaderManager       m_classLoaderManager;
  +    private Embeddor m_embeddor;
  +    private Deployer m_deployer;
  +    private LogManager m_logManager;
  +    private Kernel m_kernel;
  +    private ConfigurationRepository m_repository;
  +    private ClassLoaderManager m_classLoaderManager;
   
       public void parameterize( final Parameters parameters )
           throws ParameterException
  @@ -101,7 +99,7 @@
           m_mBeanServer = createMBeanServer();
           m_rmiAdaptor = new RMIAdaptorImpl( m_mBeanServer );
   
  -        try 
  +        try
           {
               final HtmlAdaptorServer html = new HtmlAdaptorServer();
               final ObjectName name = new ObjectName( "Adaptor:name=html,port=8082" );
  @@ -109,17 +107,17 @@
               m_mBeanServer.registerMBean( html, name );
               html.start();
           }
  -        catch( final Exception e ) 
  +        catch( final Exception e )
           {
  -            System.out.println("Could not create the HTML adaptor!!!");
  +            System.out.println( "Could not create the HTML adaptor!!!" );
               e.printStackTrace();
               throw e;
           }
   
           //TODO: SystemManager itself aswell???
           register( "Kernel", m_kernel );
  -        register( "Embeddor", m_embeddor, new Class[] { Embeddor.class } );
  -        register( "Deployer", m_deployer, new Class[] { Deployer.class } );
  +        register( "Embeddor", m_embeddor, new Class[]{ Embeddor.class } );
  +        register( "Deployer", m_deployer, new Class[]{ Deployer.class } );
           register( "LogManager", m_logManager );
           register( "ConfigurationRepository", m_repository );
           register( "ClassLoaderManager", m_classLoaderManager );
  @@ -186,7 +184,7 @@
                   mBean = createMBean( object );
               }
   
  -            final ObjectName objectName = 
  +            final ObjectName objectName =
                   new ObjectName( m_domain + ":type=" + name );
               m_mBeanServer.registerMBean( mBean, objectName );
               return mBean;
  
  
  
  1.7       +0 -2      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/DefaultLogManager.java
  
  Index: DefaultLogManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/DefaultLogManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultLogManager.java	2001/11/09 21:14:30	1.6
  +++ DefaultLogManager.java	2001/11/17 07:09:50	1.7
  @@ -7,9 +7,7 @@
    */
   package org.apache.avalon.phoenix.components.logger;
   
  -import java.io.File;
   import org.apache.avalon.excalibur.logger.DefaultLogKitManager;
  -import org.apache.avalon.excalibur.logger.LogKitManager;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  
  
  
  1.4       +8 -8      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/SimpleLogKitManager.java
  
  Index: SimpleLogKitManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/SimpleLogKitManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SimpleLogKitManager.java	2001/11/09 21:14:30	1.3
  +++ SimpleLogKitManager.java	2001/11/17 07:09:50	1.4
  @@ -28,7 +28,7 @@
   import org.apache.log.output.io.FileTarget;
   
   /**
  - * A <code>LogKitManager</code> that supports the old &lt;logs version="1.0"/&gt; 
  + * A <code>LogKitManager</code> that supports the old &lt;logs version="1.0"/&gt;
    * style logging configuration.
    *
    * @author <a href="mailto:colus@isoft.co.kr">Eung-ju Park</a>
  @@ -41,17 +41,17 @@
       private static final Resources REZ =
           ResourceManager.getPackageResources( SimpleLogKitManager.class );
   
  -    private final static String  DEFAULT_FORMAT =
  +    private final static String DEFAULT_FORMAT =
           "%{time} [%7.7{priority}] (%{category}): %{message}\\n%{throwable}";
   
       //Base name of logger categories
  -    private String       m_name;
  +    private String m_name;
   
       ///Base directory of applications working directory
  -    private File         m_baseDirectory;
  +    private File m_baseDirectory;
   
       ///Hierarchy of Application logging
  -    private Hierarchy    m_logHierarchy    = new Hierarchy();
  +    private Hierarchy m_logHierarchy = new Hierarchy();
   
       public void contextualize( final Context context )
           throws ContextException
  @@ -72,7 +72,7 @@
       public Hierarchy getHierarchy()
       {
           return m_logHierarchy;
  -    } 
  +    }
   
       /**
        * Configure a set of logtargets based on config data.
  @@ -111,7 +111,7 @@
               }
               catch( final IOException ioe )
               {
  -                final String message = 
  +                final String message =
                       REZ.getString( "target.nocreate", name, file, ioe.getMessage() );
                   throw new ConfigurationException( message, ioe );
               }
  @@ -165,7 +165,7 @@
               else
               {
                   logger.setPriority( priority );
  -                logger.setLogTargets( new LogTarget[] { logTarget } );
  +                logger.setLogTargets( new LogTarget[]{ logTarget } );
               }
           }
       }
  
  
  
  1.2       +7 -6      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockEntry.java
  
  Index: BlockEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BlockEntry.java	2001/09/24 11:33:29	1.1
  +++ BlockEntry.java	2001/11/17 07:09:50	1.2
  @@ -20,10 +20,10 @@
    */
   public class BlockEntry
   {
  -    private BlockMetaData           m_blockMetaData;
  -    private BlockInvocationHandler  m_invocationHandler;
  -    private Block                   m_block;
  -    private State                   m_state;
  +    private BlockMetaData m_blockMetaData;
  +    private BlockInvocationHandler m_invocationHandler;
  +    private Block m_block;
  +    private State m_state;
   
       public BlockEntry( final BlockMetaData blockMetaData )
       {
  @@ -36,7 +36,6 @@
           return m_blockMetaData;
       }
   
  -
       public synchronized State getState()
       {
           return m_state;
  @@ -102,8 +101,10 @@
               try
               {
                   classes[ i ] = classLoader.loadClass( services[ i ].getName() );
  +            }
  +            catch( final Throwable throwable )
  +            {
               }
  -            catch( final Throwable throwable ) {}
           }
   
           classes[ services.length ] = Block.class;
  
  
  
  1.4       +9 -8      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/DefaultApplication.java
  
  Index: DefaultApplication.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/DefaultApplication.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultApplication.java	2001/11/09 21:14:30	1.3
  +++ DefaultApplication.java	2001/11/17 07:09:50	1.4
  @@ -15,7 +15,6 @@
   import org.apache.avalon.excalibur.lang.ThreadContext;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.phoenix.Block;
  -import org.apache.avalon.phoenix.BlockListener;
   import org.apache.avalon.phoenix.interfaces.Application;
   import org.apache.avalon.phoenix.interfaces.ApplicationContext;
   import org.apache.avalon.phoenix.metadata.BlockListenerMetaData;
  @@ -35,12 +34,12 @@
       private static final Resources REZ =
           ResourceManager.getPackageResources( DefaultApplication.class );
   
  -    private static final String  PHASE_STARTUP  = "startup";
  -    private static final String  PHASE_SHUTDOWN = "shutdown";
  +    private static final String PHASE_STARTUP = "startup";
  +    private static final String PHASE_SHUTDOWN = "shutdown";
   
  -    private ApplicationContext   m_context;
  -    private LifecycleHelper      m_lifecycle;
  -    private HashMap              m_entrys = new HashMap();
  +    private ApplicationContext m_context;
  +    private LifecycleHelper m_lifecycle;
  +    private HashMap m_entrys = new HashMap();
   
       public void setApplicationContext( final ApplicationContext context )
       {
  @@ -174,8 +173,10 @@
               try
               {
                   final BlockEntry entry = (BlockEntry)m_entrys.get( block );
  -                if( PHASE_STARTUP == name ) m_lifecycle.startup( entry );
  -                else m_lifecycle.shutdown( entry );
  +                if( PHASE_STARTUP == name )
  +                    m_lifecycle.startup( entry );
  +                else
  +                    m_lifecycle.shutdown( entry );
               }
               catch( final Exception e )
               {
  
  
  
  1.7       +12 -11    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/DefaultBlockContext.java
  
  Index: DefaultBlockContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/DefaultBlockContext.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultBlockContext.java	2001/11/09 21:14:30	1.6
  +++ DefaultBlockContext.java	2001/11/17 07:09:50	1.7
  @@ -11,15 +11,13 @@
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.excalibur.thread.ThreadPool;
  -import org.apache.avalon.framework.CascadingRuntimeException;
  -import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.logger.LogEnabled;
  -import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.logger.LogKitLogger;
  +import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.phoenix.BlockContext;
  -import org.apache.avalon.phoenix.metadata.SarMetaData;
   import org.apache.avalon.phoenix.interfaces.ApplicationContext;
  +import org.apache.avalon.phoenix.metadata.SarMetaData;
   
   /**
    * Context via which Blocks communicate with container.
  @@ -32,10 +30,10 @@
       private static final Resources REZ =
           ResourceManager.getPackageResources( DefaultBlockContext.class );
   
  -    private String              m_name;
  -    private ApplicationContext  m_frame;
  -    private Logger              m_logger;
  -    private boolean             m_warningEmitted;
  +    private String m_name;
  +    private ApplicationContext m_frame;
  +    private Logger m_logger;
  +    private boolean m_warningEmitted;
   
       protected DefaultBlockContext( final String name, final ApplicationContext frame )
       {
  @@ -52,9 +50,12 @@
           throws ContextException
       {
           final SarMetaData metaData = m_frame.getMetaData();
  -        if( BlockContext.APP_NAME.equals( key ) ) return metaData.getName();
  -        else if( BlockContext.APP_HOME_DIR.equals( key ) ) return metaData.getHomeDirectory();
  -        else if( BlockContext.NAME.equals( key ) ) return m_name;
  +        if( BlockContext.APP_NAME.equals( key ) )
  +            return metaData.getName();
  +        else if( BlockContext.APP_HOME_DIR.equals( key ) )
  +            return metaData.getHomeDirectory();
  +        else if( BlockContext.NAME.equals( key ) )
  +            return m_name;
           else
           {
               throw new ContextException( "Unknown key: " + key );
  
  
  
  1.3       +1 -2      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/DependencyGraph.java
  
  Index: DependencyGraph.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/DependencyGraph.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DependencyGraph.java	2001/09/24 14:39:53	1.2
  +++ DependencyGraph.java	2001/11/17 07:09:50	1.3
  @@ -8,13 +8,12 @@
   package org.apache.avalon.phoenix.components.application;
   
   import java.util.ArrayList;
  -import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.phoenix.metadata.BlockMetaData;
   import org.apache.avalon.phoenix.metadata.DependencyMetaData;
   import org.apache.avalon.phoenix.metainfo.DependencyDescriptor;
   
   /**
  - * 
  + *
    *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
  
  
  
  1.19      +25 -26    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/LifecycleHelper.java
  
  Index: LifecycleHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/LifecycleHelper.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- LifecycleHelper.java	2001/11/09 21:14:30	1.18
  +++ LifecycleHelper.java	2001/11/17 07:09:50	1.19
  @@ -14,7 +14,6 @@
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.activity.Startable;
  -import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.component.DefaultComponentManager;
  @@ -24,9 +23,9 @@
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.LogEnabled;
  +import org.apache.avalon.framework.logger.LogKitLogger;
   import org.apache.avalon.framework.logger.Loggable;
   import org.apache.avalon.framework.logger.Logger;
  -import org.apache.avalon.framework.logger.LogKitLogger;
   import org.apache.avalon.phoenix.Block;
   import org.apache.avalon.phoenix.BlockContext;
   import org.apache.avalon.phoenix.BlockEvent;
  @@ -52,29 +51,29 @@
           ResourceManager.getPackageResources( LifecycleHelper.class );
   
       //Constants to designate stages
  -    private final static int STAGE_CREATE   = 0;
  -    private final static int STAGE_LOGGER   = 1;
  -    private final static int STAGE_CONTEXT  = 2;
  -    private final static int STAGE_COMPOSE  = 3;
  -    private final static int STAGE_CONFIG   = 4;
  -    private final static int STAGE_INIT     = 5;
  -    private final static int STAGE_START    = 6;
  -    private final static int STAGE_STOP     = 7;
  -    private final static int STAGE_DISPOSE  = 8;
  -    private final static int STAGE_DESTROY  = 9;
  +    private final static int STAGE_CREATE = 0;
  +    private final static int STAGE_LOGGER = 1;
  +    private final static int STAGE_CONTEXT = 2;
  +    private final static int STAGE_COMPOSE = 3;
  +    private final static int STAGE_CONFIG = 4;
  +    private final static int STAGE_INIT = 5;
  +    private final static int STAGE_START = 6;
  +    private final static int STAGE_STOP = 7;
  +    private final static int STAGE_DISPOSE = 8;
  +    private final static int STAGE_DESTROY = 9;
   
       //Constants to designate type of component
  -    private final static int TYPE_BLOCK     = 0;
  -    private final static int TYPE_LISTENER  = 1;
  +    private final static int TYPE_BLOCK = 0;
  +    private final static int TYPE_LISTENER = 1;
   
       ///Frame in which block executes
  -    private ApplicationContext   m_context;
  +    private ApplicationContext m_context;
   
       /**
        * The Application which this phase is associated with.
        * Required to build a ComponentManager.
        */
  -    private Application          m_application;
  +    private Application m_application;
   
       /**
        * Object to support notification of BlockListeners.
  @@ -116,7 +115,7 @@
           if( listener instanceof Configurable )
           {
               final Configuration configuration = getConfiguration( name, TYPE_LISTENER );
  -            ((Configurable)listener).configure( configuration );
  +            ( (Configurable)listener ).configure( configuration );
           }
   
           m_listenerSupport.addBlockListener( listener );
  @@ -156,13 +155,13 @@
               if( block instanceof Loggable )
               {
                   notice( name, stage );
  -                ((Loggable)block).setLogger( m_context.getLogger( name ) );
  +                ( (Loggable)block ).setLogger( m_context.getLogger( name ) );
               }
               else if( block instanceof LogEnabled )
               {
                   notice( name, stage );
                   final Logger logger = new LogKitLogger( m_context.getLogger( name ) );
  -                ((LogEnabled)block).enableLogging( logger );
  +                ( (LogEnabled)block ).enableLogging( logger );
               }
   
               //Contextualize stage
  @@ -171,7 +170,7 @@
               {
                   notice( name, stage );
                   final BlockContext context = createBlockContext( name );
  -                ((Contextualizable)block).contextualize( context );
  +                ( (Contextualizable)block ).contextualize( context );
               }
   
               //Composition stage
  @@ -180,7 +179,7 @@
               {
                   notice( name, stage );
                   final ComponentManager componentManager = createComponentManager( metaData );
  -                ((Composable)block).compose( componentManager );
  +                ( (Composable)block ).compose( componentManager );
               }
   
               //Configuring stage
  @@ -189,7 +188,7 @@
               {
                   notice( name, stage );
                   final Configuration configuration = getConfiguration( name, TYPE_BLOCK );
  -                ((Configurable)block).configure( configuration );
  +                ( (Configurable)block ).configure( configuration );
               }
   
               //Initialize stage
  @@ -197,7 +196,7 @@
               if( block instanceof Initializable )
               {
                   notice( name, stage );
  -                ((Initializable)block).initialize();
  +                ( (Initializable)block ).initialize();
               }
   
               //Start stage
  @@ -205,7 +204,7 @@
               if( block instanceof Startable )
               {
                   notice( name, stage );
  -                ((Startable)block).start();
  +                ( (Startable)block ).start();
               }
   
               entry.setState( State.STARTED );
  @@ -254,7 +253,7 @@
               try
               {
                   entry.setState( State.STOPPING );
  -                ((Startable)block).stop();
  +                ( (Startable)block ).stop();
                   entry.setState( State.STOPPED );
               }
               catch( final Throwable t )
  @@ -271,7 +270,7 @@
               try
               {
                   entry.setState( State.DESTROYING );
  -                ((Disposable)block).dispose();
  +                ( (Disposable)block ).dispose();
               }
               catch( final Throwable t )
               {
  
  
  

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


Mime
View raw message