avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader PropertyUtil.java DefaultPolicy.java
Date Mon, 15 Jul 2002 16:17:23 GMT
proyal      2002/07/15 09:17:23

  Modified:    src/java/org/apache/avalon/phoenix/components/deployer/installer
                        Installer.java
               src/java/org/apache/avalon/phoenix/components/configuration
                        FileSystemPersistentConfigurationRepository.java
               src/java/org/apache/avalon/phoenix/components/classloader
                        PropertyUtil.java DefaultPolicy.java
  Log:
  Fixed checkstyle errors
  
  Revision  Changes    Path
  1.11      +5 -4      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/installer/Installer.java
  
  Index: Installer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/installer/Installer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Installer.java	30 May 2002 12:25:31 -0000	1.10
  +++ Installer.java	15 Jul 2002 16:17:23 -0000	1.11
  @@ -153,6 +153,7 @@
               }
               catch( final IOException ioe2 )
               {
  +                //ignore
               }
               final String message =
                   REZ.getString( "nodelete-workdir.error",
  @@ -402,9 +403,9 @@
                                   final ArrayList jars )
           throws InstallationException
       {
  -        if( name.startsWith( LIB ) &&
  -            name.endsWith( ".jar" ) &&
  -            LIB.length() == name.lastIndexOf( "/" ) )
  +        if( name.startsWith( LIB )
  +            && name.endsWith( ".jar" )
  +            && LIB.length() == name.lastIndexOf( "/" ) )
           {
               final File jar = new File( workDir, name );
               jars.add( getURLAsString( jar ) );
  
  
  
  1.2       +43 -24    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/configuration/FileSystemPersistentConfigurationRepository.java
  
  Index: FileSystemPersistentConfigurationRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/configuration/FileSystemPersistentConfigurationRepository.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileSystemPersistentConfigurationRepository.java	28 Jun 2002 05:30:38 -0000	1.1
  +++ FileSystemPersistentConfigurationRepository.java	15 Jul 2002 16:17:23 -0000	1.2
  @@ -18,8 +18,8 @@
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.excalibur.io.FileUtil;
  -import org.apache.avalon.excalibur.property.PropertyUtil;
   import org.apache.avalon.excalibur.property.PropertyException;
  +import org.apache.avalon.excalibur.property.PropertyUtil;
   import org.apache.avalon.framework.activity.Startable;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -42,10 +42,10 @@
    * @author <a href="mailto:proyal@apache.org">Peter Royal</a>
    */
   public class FileSystemPersistentConfigurationRepository extends AbstractLogEnabled
  -  implements ConfigurationRepository, Parameterizable, Configurable, Startable
  +    implements ConfigurationRepository, Parameterizable, Configurable, Startable
   {
       private static final Resources REZ =
  -      ResourceManager.getPackageResources( FileSystemPersistentConfigurationRepository.class
);
  +        ResourceManager.getPackageResources( FileSystemPersistentConfigurationRepository.class
);
   
       private final HashMap m_configurations = new HashMap();
   
  @@ -93,13 +93,17 @@
           }
       }
   
  -    private String constructStoragePath( final Configuration configuration ) throws ConfigurationException
  +    private String constructStoragePath( final Configuration configuration )
  +        throws ConfigurationException
       {
  -        final String path = configuration.getChild( "storage-directory" ).getValue( "${phoenix.home}/conf/apps"
);
  +        final String path =
  +            configuration.getChild( "storage-directory" ).getValue( "${phoenix.home}/conf/apps"
);
   
           try
           {
  -            final Object opath = PropertyUtil.resolveProperty( path, createConfigurationContext(),
false );
  +            final Object opath = PropertyUtil.resolveProperty( path,
  +                                                               createConfigurationContext(),
  +                                                               false );
   
               if( opath instanceof String )
               {
  @@ -107,25 +111,28 @@
               }
               else
               {
  -                final String message = REZ.getString( "config.error.nonstring", opath.getClass().getName()
);
  +                final String message = REZ.getString( "config.error.nonstring",
  +                                                      opath.getClass().getName() );
  +
                   throw new ConfigurationException( message );
               }
           }
           catch( PropertyException e )
           {
  -            final String message = REZ.getString( "config.error.missingproperty", configuration.getLocation()
);
  +            final String message = REZ.getString( "config.error.missingproperty",
  +                                                  configuration.getLocation() );
   
               throw new ConfigurationException( message, e );
           }
       }
   
       public void start()
  -      throws Exception
  +        throws Exception
       {
       }
   
       public void stop()
  -      throws Exception
  +        throws Exception
       {
           writeJoinedConfigurationsToDisk( joinConfigurations() );
       }
  @@ -139,13 +146,14 @@
               final Map.Entry entry = ( Map.Entry ) i.next();
               final ConfigurationKey key = ( ConfigurationKey ) entry.getKey();
   
  -            DefaultConfiguration joined = ( DefaultConfiguration ) joinedConfigurations.get(
key.application );
  +            DefaultConfiguration joined =
  +                ( DefaultConfiguration ) joinedConfigurations.get( key.getApplication()
);
   
               if( null == joined )
               {
  -                joined = new DefaultConfiguration( key.application, "-" );
  +                joined = new DefaultConfiguration( key.getApplication(), "-" );
   
  -                joinedConfigurations.put( key.application, joined );
  +                joinedConfigurations.put( key.getApplication(), joined );
               }
   
               joined.addChild( ( Configuration ) entry.getValue() );
  @@ -155,7 +163,7 @@
       }
   
       private void writeJoinedConfigurationsToDisk( Map joinedConfigurations )
  -      throws SAXException, IOException, ConfigurationException
  +        throws SAXException, IOException, ConfigurationException
       {
           final DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
   
  @@ -166,7 +174,8 @@
               final Map.Entry entry = ( Map.Entry ) i.next();
               final String application = ( String ) entry.getKey();
   
  -            if( getLogger().isDebugEnabled() ) getLogger().debug( "Serializing configuration
to disk: " + application );
  +            if( getLogger().isDebugEnabled() )
  +                getLogger().debug( "Serializing configuration to disk: " + application
);
   
               serializer.serializeToFile( new File( this.m_storageDirectory, application
+ ".xml" ),
                                           ( Configuration ) entry.getValue() );
  @@ -176,7 +185,7 @@
       public synchronized void storeConfiguration( final String application,
                                                    final String block,
                                                    final Configuration configuration )
  -      throws ConfigurationException
  +        throws ConfigurationException
       {
           final ConfigurationKey key = new ConfigurationKey( application, block );
   
  @@ -192,7 +201,7 @@
   
       public synchronized Configuration getConfiguration( final String application,
                                                           final String block )
  -      throws ConfigurationException
  +        throws ConfigurationException
       {
           final ConfigurationKey key = new ConfigurationKey( application, block );
           final Configuration configuration = ( Configuration ) m_configurations.get( key
);
  @@ -208,18 +217,18 @@
   
       private final class ConfigurationKey
       {
  -        final String application;
  -        final String block;
  +        private final String m_application;
  +        private final String m_block;
   
           public ConfigurationKey( String application, String block )
           {
  -            this.application = application;
  -            this.block = block;
  +            this.m_application = application;
  +            this.m_block = block;
           }
   
           public int hashCode()
           {
  -            return this.application.hashCode() + this.block.hashCode();
  +            return this.getApplication().hashCode() + this.getBlock().hashCode();
           }
   
           public boolean equals( Object obj )
  @@ -228,13 +237,23 @@
               {
                   final ConfigurationKey key = ( ConfigurationKey ) obj;
   
  -                return this.application.equals( key.application ) &&
  -                  this.block.equals( key.block );
  +                return this.getApplication().equals( key.getApplication() )
  +                    && this.getBlock().equals( key.getBlock() );
               }
               else
               {
                   return false;
               }
  +        }
  +
  +        public String getApplication()
  +        {
  +            return m_application;
  +        }
  +
  +        public String getBlock()
  +        {
  +            return m_block;
           }
       }
   }
  
  
  
  1.3       +4 -3      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/PropertyUtil.java
  
  Index: PropertyUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/PropertyUtil.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PropertyUtil.java	13 Jul 2002 10:06:35 -0000	1.2
  +++ PropertyUtil.java	15 Jul 2002 16:17:23 -0000	1.3
  @@ -226,6 +226,7 @@
           }
           catch( final ContextException ce )
           {
  +            //ignore
           }
   
           try
  @@ -248,8 +249,8 @@
               }
               else
               {
  -                throw new Exception( "Unable to find " + key + " to expand during " +
  -                                     "property resolution." );
  +                throw new Exception( "Unable to find " + key + " to expand during "
  +                                     + "property resolution." );
               }
           }
   
  
  
  
  1.9       +2 -2      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/DefaultPolicy.java
  
  Index: DefaultPolicy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/DefaultPolicy.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultPolicy.java	27 Jun 2002 04:11:21 -0000	1.8
  +++ DefaultPolicy.java	15 Jul 2002 16:17:23 -0000	1.9
  @@ -255,8 +255,8 @@
               final String filename =
                   codeBase.substring( 4 ).replace( '/', File.separatorChar );
               File baseDir = null;
  -            if( codeBase.startsWith( CLASSES ) ||
  -                codeBase.startsWith( LIB ) )
  +            if( codeBase.startsWith( CLASSES )
  +                || codeBase.startsWith( LIB ) )
               {
                   baseDir = m_workDirectory;
               }
  
  
  

--
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