org.rhq.enterprise.server.core.plugin
Class PluginDeploymentScanner

java.lang.Object
  extended by org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner
All Implemented Interfaces:
PluginDeploymentScannerMBean

public class PluginDeploymentScanner
extends Object
implements PluginDeploymentScannerMBean

This looks at both the file system and the database for new agent and server plugins.

Author:
John Mazzitelli

Field Summary
 
Fields inherited from interface org.rhq.enterprise.server.core.plugin.PluginDeploymentScannerMBean
OBJECT_NAME
 
Constructor Summary
PluginDeploymentScanner()
           
 
Method Summary
 File getAgentPluginDir()
          Gets the directory name where the agent plugin jars are located.
 Long getScanPeriod()
          Gets the amount of time (in milliseconds) between scans.
 File getServerPluginDir()
          Gets the directory name where the server plugin jars are located.
 File getUserPluginDir()
          Gets the directory name where the user can place agent or server plugin jars.
 void scan()
          This will scan the database for new/updated plugins and if it finds any, will write the content as plugin files in the file system.
 void scanAndRegister()
          This will scan the database for new/updated plugins and if it finds any, will write the content as plugin files in the file system.
 void setAgentPluginDir(File dir)
          Sets the directory where the agent plugin jars are located.
 void setScanPeriod(Long ms)
          Sets the amount of time (in milliseconds) between scans.
 void setServerPluginDir(File dir)
          Sets the directory where the server plugin jars are located.
 void setUserPluginDir(File dir)
          Sets the directory where the user can place agent or server plugin jars.
 void start()
           
 void startDeployment()
          This is called separately from the start/stop lifecycle methods.
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginDeploymentScanner

public PluginDeploymentScanner()
Method Detail

getScanPeriod

@NotNull
public Long getScanPeriod()
Description copied from interface: PluginDeploymentScannerMBean
Gets the amount of time (in milliseconds) between scans.

Specified by:
getScanPeriod in interface PluginDeploymentScannerMBean
Returns:
the time in millis between each scans

setScanPeriod

public void setScanPeriod(@Nullable
                          Long ms)
Description copied from interface: PluginDeploymentScannerMBean
Sets the amount of time (in milliseconds) between scans.

Specified by:
setScanPeriod in interface PluginDeploymentScannerMBean
Parameters:
ms - time in millis between each scans

getUserPluginDir

public File getUserPluginDir()
Description copied from interface: PluginDeploymentScannerMBean
Gets the directory name where the user can place agent or server plugin jars. If null, do not look for any user plugins.

Specified by:
getUserPluginDir in interface PluginDeploymentScannerMBean
Returns:
plugin directory name where the user puts plugins

setUserPluginDir

public void setUserPluginDir(File dir)
Description copied from interface: PluginDeploymentScannerMBean
Sets the directory where the user can place agent or server plugin jars. The scanner will move plugins found here to their appropriate internal locations based on the kind of plugins it finds.

Specified by:
setUserPluginDir in interface PluginDeploymentScannerMBean
Parameters:
dir - the name of the plugins dir where the user can copy plugins

getServerPluginDir

public File getServerPluginDir()
Description copied from interface: PluginDeploymentScannerMBean
Gets the directory name where the server plugin jars are located.

Specified by:
getServerPluginDir in interface PluginDeploymentScannerMBean
Returns:
server plugin directory name

setServerPluginDir

public void setServerPluginDir(File dir)
Description copied from interface: PluginDeploymentScannerMBean
Sets the directory where the server plugin jars are located.

Specified by:
setServerPluginDir in interface PluginDeploymentScannerMBean
Parameters:
dir - the name of the server plugins dir

getAgentPluginDir

public File getAgentPluginDir()
Description copied from interface: PluginDeploymentScannerMBean
Gets the directory name where the agent plugin jars are located.

Specified by:
getAgentPluginDir in interface PluginDeploymentScannerMBean
Returns:
agent plugin directory name

setAgentPluginDir

public void setAgentPluginDir(File dir)
Description copied from interface: PluginDeploymentScannerMBean
Sets the directory where the agent plugin jars are located.

Specified by:
setAgentPluginDir in interface PluginDeploymentScannerMBean
Parameters:
dir - the name of the agent plugins dir

start

public void start()
           throws Exception
Specified by:
start in interface PluginDeploymentScannerMBean
Throws:
Exception

stop

public void stop()
Specified by:
stop in interface PluginDeploymentScannerMBean

startDeployment

public void startDeployment()
Description copied from interface: PluginDeploymentScannerMBean
This is called separately from the start/stop lifecycle methods. It should only be called when we know the EJB/SLSB layer is fully initialized and ready to accept requests.

Specified by:
startDeployment in interface PluginDeploymentScannerMBean

scan

public void scan()
          throws Exception
Description copied from interface: PluginDeploymentScannerMBean
This will scan the database for new/updated plugins and if it finds any, will write the content as plugin files in the file system. This will also delete old, obsolete plugins.

Specified by:
scan in interface PluginDeploymentScannerMBean
Throws:
Exception
See Also:
PluginDeploymentScannerMBean.scanAndRegister()

scanAndRegister

public void scanAndRegister()
                     throws Exception
Description copied from interface: PluginDeploymentScannerMBean
This will scan the database for new/updated plugins and if it finds any, will write the content as plugin files in the file system. This will also delete old, obsolete plugins. Once finished, this will register agent plugins and update the database as appropriate.

Specified by:
scanAndRegister in interface PluginDeploymentScannerMBean
Throws:
Exception


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.