You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by mi...@apache.org on 2001/10/31 23:01:19 UTC

cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer DefaultDeployer.java

mirceatoma    01/10/31 14:01:19

  Modified:    src/java/org/apache/avalon/phoenix/components/deployer
                        DefaultDeployer.java
  Log:
  Use new DeploymentRecorder to avoid application re-installation in the future.
  
  Revision  Changes    Path
  1.9       +15 -4     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultDeployer.java	2001/10/27 22:48:01	1.8
  +++ DefaultDeployer.java	2001/10/31 22:01:19	1.9
  @@ -25,6 +25,7 @@
   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.Kernel;
   import org.apache.avalon.phoenix.interfaces.LogManager;
  @@ -54,12 +55,12 @@
       private final Assembler          m_assembler     = new Assembler();
       private final SarVerifier        m_verifier      = new SarVerifier();
       private final Installer          m_installer     = new Installer();
  -    private final HashMap            m_installations = new HashMap();
   
       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.
  @@ -74,6 +75,7 @@
           m_repository = (ConfigurationRepository)componentManager.lookup( ConfigurationRepository.ROLE );
           m_classLoaderManager = (ClassLoaderManager)componentManager.lookup( ClassLoaderManager.ROLE );
           m_logManager = (LogManager)componentManager.lookup( LogManager.ROLE );
  +        m_recorder = (DeploymentRecorder)componentManager.lookup( DeploymentRecorder.ROLE );
       }
   
       public void initialize()
  @@ -106,8 +108,11 @@
                   m_repository.storeConfiguration( name, blocks[i], null );
               }
               
  -            final Installation installation = (Installation)m_installations.get( name );
  +            final Installation installation = m_recorder.fetchInstallation( name );
               m_installer.uninstall( installation );
  +            
  +            //erase installation information
  +            m_recorder.recordInstallation( name, null);
           }
           catch ( final Exception e )
           {
  @@ -127,8 +132,14 @@
       {
           try
           {
  -            final Installation installation = m_installer.install( location );
  -            m_installations.put( name, installation );
  +            Installation installation = m_recorder.fetchInstallation( name );
  +            
  +            if ( null == installation )
  +            {
  +                //fresh installation
  +                installation = m_installer.install( location );            
  +                m_recorder.recordInstallation( name, installation );
  +            }
   
               final Configuration config = getConfigurationFor( installation.getConfig() );
               final Configuration server = getConfigurationFor( installation.getServer() );
  
  
  

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