org.apache.geronimo.deployment.plugin.jmx
Class RemoteDeploymentManager

java.lang.Object
  extended by org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager
      extended by org.apache.geronimo.deployment.plugin.jmx.RemoteDeploymentManager
All Implemented Interfaces:
DeploymentManager, GeronimoDeploymentManager, PluginInstaller, ServerArchiver

public class RemoteDeploymentManager
extends JMXDeploymentManager
implements GeronimoDeploymentManager, ServerArchiver

Connects to a Kernel in a remote VM (may or many not be on the same machine).


Field Summary
static GBeanInfo GBEAN_INFO
           
static String GBEAN_REF_MODULE_CONFIGURERS
           
 
Fields inherited from class org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager
commandContext, kernel
 
Constructor Summary
RemoteDeploymentManager(Collection<ModuleConfigurer> moduleConfigurers)
           
 
Method Summary
 File archive(String sourcePath, String destPath, Artifact artifact)
           
 DownloadResults checkOnInstall(Object key)
          Gets the current progress of a download operation.
 DownloadResults checkOnInstall(Object key, boolean remove)
          Gets the current progress of a download operation.
 Dependency[] checkPrerequisites(PluginType plugin)
          Ensures that a plugin's prerequisites are installed
protected  DistributeCommand createDistributeCommand(Target[] targetList, File moduleArchive, File deploymentPlan)
           
protected  DistributeCommand createDistributeCommand(Target[] targetList, ModuleType moduleType, InputStream moduleArchive, InputStream deploymentPlan)
           
 PluginListType createPluginListForRepositories(String repo)
           
protected  RedeployCommand createRedeployCommand(TargetModuleID[] moduleIDList, File moduleArchive, File deploymentPlan)
           
protected  RedeployCommand createRedeployCommand(TargetModuleID[] moduleIDList, InputStream moduleArchive, InputStream deploymentPlan)
           
static GBeanInfo getGBeanInfo()
           
 Map getInstalledPlugins()
          Lists the plugins installed in the local Geronimo server, by name and ID.
 JMXConnector getJMXConnector()
           
 PluginType getPluginMetadata(Artifact configId)
          Gets a CofigurationMetadata for a configuration installed in the local server.
 URL[] getRepositories()
           
 void init(JMXConnector jmxConnector, String hostname)
           
 DownloadResults install(PluginListType configsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password)
          Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies.
 void install(PluginListType configsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password, DownloadPoller poller)
          Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies.
 Artifact installLibrary(File libFile, String groupId)
           
 DownloadResults installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList)
           
 boolean isSameMachine()
           
 PluginListType listPlugins(URL mavenRepository, String username, String password)
          Lists the plugins available for download in a particular Geronimo repository.
 void mergeOverrides(String server, AttributesType overrides)
           
 void release()
           
 Object startInstall(File carFile, String defaultRepository, boolean restrictToDefaultRepository, String username, String password)
          Installs a configuration downloaded from a remote repository into the local Geronimo server, including all its dependencies.
 Object startInstall(PluginListType configsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password)
          Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies.
 void updatePluginMetadata(PluginType metadata)
          Saves a ConfigurationMetadata for a particular plugin, if the server is able to record it.
 void validatePlugin(PluginType plugin)
          Ensures that a plugin artifact is installable.
 
Methods inherited from class org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager
createConfiguration, distribute, distribute, distribute, getAvailableModules, getCurrentLocale, getDConfigBeanVersion, getDefaultLocale, getNonRunningModules, getRunningModules, getSupportedLocales, getTargets, initialize, isDConfigBeanVersionSupported, isLocaleSupported, isRedeploySupported, redeploy, redeploy, setAuthentication, setDConfigBeanVersion, setInPlace, setLocale, setLogConfiguration, start, stop, undeploy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.enterprise.deploy.spi.DeploymentManager
createConfiguration, distribute, distribute, getAvailableModules, getCurrentLocale, getDConfigBeanVersion, getDefaultLocale, getNonRunningModules, getRunningModules, getSupportedLocales, getTargets, isDConfigBeanVersionSupported, isLocaleSupported, isRedeploySupported, redeploy, redeploy, setDConfigBeanVersion, setLocale, start, stop, undeploy
 

Field Detail

GBEAN_INFO

public static final GBeanInfo GBEAN_INFO

GBEAN_REF_MODULE_CONFIGURERS

public static final String GBEAN_REF_MODULE_CONFIGURERS
See Also:
Constant Field Values
Constructor Detail

RemoteDeploymentManager

public RemoteDeploymentManager(Collection<ModuleConfigurer> moduleConfigurers)
Method Detail

init

public void init(JMXConnector jmxConnector,
                 String hostname)
          throws IOException
Throws:
IOException

getJMXConnector

public JMXConnector getJMXConnector()

isSameMachine

public boolean isSameMachine()

release

public void release()
Specified by:
release in interface DeploymentManager
Overrides:
release in class JMXDeploymentManager

createDistributeCommand

protected DistributeCommand createDistributeCommand(Target[] targetList,
                                                    File moduleArchive,
                                                    File deploymentPlan)
Overrides:
createDistributeCommand in class JMXDeploymentManager

createDistributeCommand

protected DistributeCommand createDistributeCommand(Target[] targetList,
                                                    ModuleType moduleType,
                                                    InputStream moduleArchive,
                                                    InputStream deploymentPlan)
Overrides:
createDistributeCommand in class JMXDeploymentManager

createRedeployCommand

protected RedeployCommand createRedeployCommand(TargetModuleID[] moduleIDList,
                                                File moduleArchive,
                                                File deploymentPlan)
Overrides:
createRedeployCommand in class JMXDeploymentManager

createRedeployCommand

protected RedeployCommand createRedeployCommand(TargetModuleID[] moduleIDList,
                                                InputStream moduleArchive,
                                                InputStream deploymentPlan)
Overrides:
createRedeployCommand in class JMXDeploymentManager

listPlugins

public PluginListType listPlugins(URL mavenRepository,
                                  String username,
                                  String password)
                           throws FailedLoginException,
                                  IOException
Description copied from interface: PluginInstaller
Lists the plugins available for download in a particular Geronimo repository.

Specified by:
listPlugins in interface PluginInstaller
Parameters:
mavenRepository - The base URL to the maven repository. This must contain the file geronimo-plugins.xml
username - Optional username, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
password - Optional password, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
Throws:
FailedLoginException
IOException

validatePlugin

public void validatePlugin(PluginType plugin)
                    throws MissingDependencyException
Description copied from interface: PluginInstaller
Ensures that a plugin artifact is installable. Checks the Geronimo version, JVM version, and whether or not the plugin is already installed.

Specified by:
validatePlugin in interface PluginInstaller
Parameters:
plugin - plugin artifact to check
Throws:
MissingDependencyException - if a dependency is not satisfied

checkPrerequisites

public Dependency[] checkPrerequisites(PluginType plugin)
Description copied from interface: PluginInstaller
Ensures that a plugin's prerequisites are installed

Specified by:
checkPrerequisites in interface PluginInstaller
Parameters:
plugin - plugin artifact to check
Returns:
array of missing depedencies

install

public DownloadResults install(PluginListType configsToInstall,
                               String defaultRepository,
                               boolean restrictToDefaultRepository,
                               String username,
                               String password)
Description copied from interface: PluginInstaller
Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies. The caller will get the results when the operation completes. Note that this method does not throw exceptions on failure, but instead sets the failure property of the DownloadResults.

Specified by:
install in interface PluginInstaller
Parameters:
configsToInstall - The list of configurations to install
username - Optional username, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
password - Optional password, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.

install

public void install(PluginListType configsToInstall,
                    String defaultRepository,
                    boolean restrictToDefaultRepository,
                    String username,
                    String password,
                    DownloadPoller poller)
Description copied from interface: PluginInstaller
Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies. The method blocks until the operation completes, but the caller will be notified of progress frequently along the way (using the supplied DownloadPoller). Therefore the caller is meant to create the poller and then call this method in a background thread. Note that this method does not throw exceptions on failure, but instead sets the failure property of the DownloadPoller.

Specified by:
install in interface PluginInstaller
Parameters:
configsToInstall - The list of configurations to install
username - Optional username, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
password - Optional password, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
poller - Will be notified with status updates as the download proceeds

startInstall

public Object startInstall(PluginListType configsToInstall,
                           String defaultRepository,
                           boolean restrictToDefaultRepository,
                           String username,
                           String password)
Description copied from interface: PluginInstaller
Installs a configuration from a remote repository into the local Geronimo server, including all its dependencies. The method returns immediately, providing a key that can be used to poll the status of the download operation. Note that the installation does not throw exceptions on failure, but instead sets the failure property of the DownloadResults that the caller can poll for.

Specified by:
startInstall in interface PluginInstaller
Parameters:
configsToInstall - The list of configurations to install
username - Optional username, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
password - Optional password, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
Returns:
A key that can be passed to checkOnInstall

startInstall

public Object startInstall(File carFile,
                           String defaultRepository,
                           boolean restrictToDefaultRepository,
                           String username,
                           String password)
Description copied from interface: PluginInstaller
Installs a configuration downloaded from a remote repository into the local Geronimo server, including all its dependencies. The method returns immediately, providing a key that can be used to poll the status of the download operation. Note that the installation does not throw exceptions on failure, but instead sets the failure property of the DownloadResults that the caller can poll for.

Specified by:
startInstall in interface PluginInstaller
Parameters:
carFile - A CAR file downloaded from a remote repository. This is a packaged configuration with included configuration information, but it may still have external dependencies that need to be downloaded separately. The metadata in the CAR file includes a repository URL for these downloads, and the username and password arguments are used in conjunction with that.
username - Optional username, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
password - Optional password, if the maven repo uses HTTP Basic authentication. Set this to null if no authentication is required.
Returns:
A key that can be passed to checkOnInstall

checkOnInstall

public DownloadResults checkOnInstall(Object key)
Description copied from interface: PluginInstaller
Gets the current progress of a download operation. Note that once the DownloadResults is returned for this operation shows isFinished = true, the operation will be forgotten, so the caller should be careful not to call this again after the download has finished.

Specified by:
checkOnInstall in interface PluginInstaller
Parameters:
key - Identifies the operation to check on

checkOnInstall

public DownloadResults checkOnInstall(Object key,
                                      boolean remove)
Description copied from interface: PluginInstaller
Gets the current progress of a download operation.

Specified by:
checkOnInstall in interface PluginInstaller
Parameters:
key - Identifies the operation to check on
remove - If true and the download operation has finished, the DownloadResults will be forgotten and the next call to this function will return null. Otherwise, the DownloadResults will be retained until this function is called with the remove parameter set to true. This parameter is only used when the download operation has finished (DownloadResults.isFinished() returns true).

createPluginListForRepositories

public PluginListType createPluginListForRepositories(String repo)
                                               throws NoSuchStoreException
Specified by:
createPluginListForRepositories in interface PluginInstaller
Throws:
NoSuchStoreException

getInstalledPlugins

public Map getInstalledPlugins()
Description copied from interface: PluginInstaller
Lists the plugins installed in the local Geronimo server, by name and ID.

Specified by:
getInstalledPlugins in interface PluginInstaller
Returns:
A Map with key type String (plugin name) and value type Artifact (config ID of the plugin).

getPluginMetadata

public PluginType getPluginMetadata(Artifact configId)
Description copied from interface: PluginInstaller
Gets a CofigurationMetadata for a configuration installed in the local server. Should load a saved one if available, or else create a new default one to the best of its abilities.

Specified by:
getPluginMetadata in interface PluginInstaller
Parameters:
configId - Identifies the configuration. This must match a configuration currently installed in the local server. The configId must be fully resolved (isResolved() == true)

updatePluginMetadata

public void updatePluginMetadata(PluginType metadata)
Description copied from interface: PluginInstaller
Saves a ConfigurationMetadata for a particular plugin, if the server is able to record it. This can be used if you later re-export the plugin, or just want to review the information for a particular installed plugin.

Specified by:
updatePluginMetadata in interface PluginInstaller
Parameters:
metadata - The data to save. The contained configId (which must be fully resolved) identifies the configuration to save this for.

getRepositories

public URL[] getRepositories()
Specified by:
getRepositories in interface GeronimoDeploymentManager

installLibrary

public Artifact installLibrary(File libFile,
                               String groupId)
                        throws IOException
Specified by:
installLibrary in interface PluginInstaller
Throws:
IOException

installPluginList

public DownloadResults installPluginList(String targetRepositoryPath,
                                         String relativeTargetServerPath,
                                         PluginListType pluginList)
                                  throws Exception
Specified by:
installPluginList in interface PluginInstaller
Throws:
Exception

mergeOverrides

public void mergeOverrides(String server,
                           AttributesType overrides)
                    throws InvalidGBeanException,
                           IOException
Specified by:
mergeOverrides in interface PluginInstaller
Throws:
InvalidGBeanException
IOException

archive

public File archive(String sourcePath,
                    String destPath,
                    Artifact artifact)
             throws org.codehaus.plexus.archiver.ArchiverException,
                    IOException
Specified by:
archive in interface ServerArchiver
Throws:
org.codehaus.plexus.archiver.ArchiverException
IOException

getGBeanInfo

public static GBeanInfo getGBeanInfo()


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.