org.apache.geronimo.deployment.hot
Class DirectoryHotDeployer

java.lang.Object
  extended by org.apache.geronimo.deployment.hot.DirectoryHotDeployer
All Implemented Interfaces:
DirectoryMonitor.Listener, HotDeployer, org.apache.geronimo.gbean.GBeanLifecycle, org.apache.geronimo.kernel.config.DeploymentWatcher

public class DirectoryHotDeployer
extends Object
implements HotDeployer, org.apache.geronimo.kernel.config.DeploymentWatcher, org.apache.geronimo.gbean.GBeanLifecycle

A directory-scanning hot deployer


Field Summary
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Constructor Summary
DirectoryHotDeployer(String path, int pollIntervalMillis, org.apache.geronimo.system.serverinfo.ServerInfo serverInfo, org.apache.geronimo.kernel.config.ConfigurationManager configManager, org.apache.geronimo.kernel.Kernel kernel)
           
 
Method Summary
 void deployed(org.apache.geronimo.kernel.repository.Artifact id)
           
 void doFail()
           
 void doStart()
           
 void doStop()
           
 String fileAdded(File file)
           
 boolean fileRemoved(File file, String configId)
           
 void fileUpdated(File file, String configId)
           
 String getDeploymentPassword()
           
 long getDeploymentTime(File file, String configId)
          Called during initialization on previously deployed files.
 String getDeploymentURI()
           
 String getDeploymentUser()
           
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 String getPath()
           
 int getPollIntervalMillis()
           
 org.apache.geronimo.system.serverinfo.ServerInfo getServerInfo()
           
 boolean isFileDeployed(File file, String configId)
          Called during initialization on all files in the hot deploy directory.
 boolean isServerRunning()
          The directory monitor doesn't take any action unless this method returns true (to avoid deploying before the deploy GBeans are running, etc.).
 void setDeploymentPassword(String deploymentPassword)
           
 void setDeploymentURI(String deploymentURI)
           
 void setDeploymentUser(String deploymentUser)
           
 void setPath(String path)
           
 void setPollIntervalMillis(int pollIntervalMillis)
           
 void setServerInfo(org.apache.geronimo.system.serverinfo.ServerInfo serverInfo)
           
 void started()
          Called to indicate that the monitor has fully initialized and will be doing normal deployment operations from now on.
 void undeployed(org.apache.geronimo.kernel.repository.Artifact id)
           
 boolean validateFile(File file, String configId)
          Called to check whether a file passes the smell test before attempting to deploy it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

DirectoryHotDeployer

public DirectoryHotDeployer(String path,
                            int pollIntervalMillis,
                            org.apache.geronimo.system.serverinfo.ServerInfo serverInfo,
                            org.apache.geronimo.kernel.config.ConfigurationManager configManager,
                            org.apache.geronimo.kernel.Kernel kernel)
Method Detail

deployed

public void deployed(org.apache.geronimo.kernel.repository.Artifact id)
Specified by:
deployed in interface org.apache.geronimo.kernel.config.DeploymentWatcher

undeployed

public void undeployed(org.apache.geronimo.kernel.repository.Artifact id)
Specified by:
undeployed in interface org.apache.geronimo.kernel.config.DeploymentWatcher

getPath

public String getPath()

setPath

public void setPath(String path)

getServerInfo

public org.apache.geronimo.system.serverinfo.ServerInfo getServerInfo()

setServerInfo

public void setServerInfo(org.apache.geronimo.system.serverinfo.ServerInfo serverInfo)

getPollIntervalMillis

public int getPollIntervalMillis()
Specified by:
getPollIntervalMillis in interface HotDeployer

setPollIntervalMillis

public void setPollIntervalMillis(int pollIntervalMillis)
Specified by:
setPollIntervalMillis in interface HotDeployer

getDeploymentURI

public String getDeploymentURI()

setDeploymentURI

public void setDeploymentURI(String deploymentURI)

getDeploymentUser

public String getDeploymentUser()

setDeploymentUser

public void setDeploymentUser(String deploymentUser)

getDeploymentPassword

public String getDeploymentPassword()

setDeploymentPassword

public void setDeploymentPassword(String deploymentPassword)

doStart

public void doStart()
             throws Exception
Specified by:
doStart in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
Exception

doStop

public void doStop()
            throws Exception
Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
Exception

doFail

public void doFail()
Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

isFileDeployed

public boolean isFileDeployed(File file,
                              String configId)
Description copied from interface: DirectoryMonitor.Listener
Called during initialization on all files in the hot deploy directory.

Specified by:
isFileDeployed in interface DirectoryMonitor.Listener
Returns:
true if the file in question is already available in the server, false if it should be deployed on the next pass.

isServerRunning

public boolean isServerRunning()
Description copied from interface: DirectoryMonitor.Listener
The directory monitor doesn't take any action unless this method returns true (to avoid deploying before the deploy GBeans are running, etc.).

Specified by:
isServerRunning in interface DirectoryMonitor.Listener

getDeploymentTime

public long getDeploymentTime(File file,
                              String configId)
Description copied from interface: DirectoryMonitor.Listener
Called during initialization on previously deployed files.

Specified by:
getDeploymentTime in interface DirectoryMonitor.Listener
Returns:
The time that the file was deployed. If the current version in the directory is newer, the file will be updated on the first pass.

started

public void started()
Description copied from interface: DirectoryMonitor.Listener
Called to indicate that the monitor has fully initialized and will be doing normal deployment operations from now on.

Specified by:
started in interface DirectoryMonitor.Listener

validateFile

public boolean validateFile(File file,
                            String configId)
Description copied from interface: DirectoryMonitor.Listener
Called to check whether a file passes the smell test before attempting to deploy it.

Specified by:
validateFile in interface DirectoryMonitor.Listener
Returns:
true if there's nothing obviously wrong with this file. false if there is (for example, it's clearly not deployable).

fileAdded

public String fileAdded(File file)
Specified by:
fileAdded in interface DirectoryMonitor.Listener
Returns:
A configId for the deployment if the addition was processed successfully (or an empty String if the addition was OK but the configId could not be determined). null if the addition failed, in which case the file will be added again next time it changes.

fileRemoved

public boolean fileRemoved(File file,
                           String configId)
Specified by:
fileRemoved in interface DirectoryMonitor.Listener
Returns:
true if the removal was processed successfully. If not the file will be removed again on the next pass.

fileUpdated

public void fileUpdated(File file,
                        String configId)
Specified by:
fileUpdated in interface DirectoryMonitor.Listener

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


Copyright © 2006 Apache Software Foundation. All Rights Reserved.