CVS: jcontainer/loom/engine/src/java/org/jcontainer/loom/components/monitor DefaultDeploymentMonitor.java,1.11,1.12

Peter Donald <pdonald-yCVjj/[email protected]>
Newsgroups gmane.comp.java.jcontainer.cvs
Message-ID <[email protected]>
Update of /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/monitor
In directory hogshead.codehaus.org:/tmp/cvs-serv21894/engine/src/java/org/jcontainer/loom/components/monitor

Modified Files:
	DefaultDeploymentMonitor.java 
Log Message:
Remove usage of DNAs Parameters object and replace with usage of ResourceLocator


Index: DefaultDeploymentMonitor.java
===================================================================
RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/monitor/DefaultDeploymentMonitor.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- DefaultDeploymentMonitor.java	5 Oct 2003 13:45:40 -0000	1.11
+++ DefaultDeploymentMonitor.java	29 Oct 2003 21:55:27 -0000	1.12
@@ -101,11 +101,7 @@
 import org.jcontainer.dna.Configuration;
 import org.jcontainer.dna.ConfigurationException;
 import org.jcontainer.dna.MissingResourceException;
-import org.jcontainer.dna.ParameterException;
-import org.jcontainer.dna.Parameterizable;
-import org.jcontainer.dna.Parameters;
 import org.jcontainer.dna.ResourceLocator;
-import org.jcontainer.loom.components.ParameterConstants;
 import org.jcontainer.loom.interfaces.Deployer;
 import org.realityforge.salt.i18n.ResourceManager;
 import org.realityforge.salt.i18n.Resources;
@@ -121,26 +117,16 @@
  */
 public class DefaultDeploymentMonitor
     extends AbstractLogEnabled
-    implements Parameterizable, Configurable, Composable, Active, PropertyChangeListener
+    implements Configurable, Composable, Active, PropertyChangeListener
 {
     private final static Resources REZ =
         ResourceManager.getPackageResources( DefaultDeploymentMonitor.class );
 
-    private String m_appsDir;
+    private File m_appsDir;
     private ActiveMonitor m_monitor;
     private Deployer m_deployer;
     private long m_frequency;
 
-    /**
-     * requires parameter "loom.apps.dir" to be set to directory
-     * that the component is to scanner.
-     */
-    public void parameterize( final Parameters parameters )
-        throws ParameterException
-    {
-        m_appsDir = parameters.getParameter( ParameterConstants.APPS_DIR );
-    }
-
     public void configure( Configuration configuration )
         throws ConfigurationException
     {
@@ -149,11 +135,13 @@
 
     /**
      * @dna.dependency type="Deployer"
+     * @dna.dependency type="File" qualifier="apps"
      */
     public void compose( final ResourceLocator locator )
         throws MissingResourceException
     {
         m_deployer = (Deployer)locator.lookup( Deployer.class.getName() );
+        m_appsDir = (File)locator.lookup( File.class.getName() + "/apps" );
     }
 
     /**
@@ -163,7 +151,7 @@
         throws Exception
     {
         final DirectoryResource resource =
-            new DirectoryResource( m_appsDir );
+            new DirectoryResource( m_appsDir.getPath() );
         resource.addPropertyChangeListener( this );
         m_monitor = new ActiveMonitor();
         m_monitor.setFrequency( m_frequency );
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.