org.jboss.services.deployment
Interface DeploymentServiceMBean

All Superinterfaces:
ListenerServiceMBean, Service, ServiceMBean
All Known Implementing Classes:
DeploymentService

public interface DeploymentServiceMBean
extends ListenerServiceMBean

MBean interface.

Version:
$Revision: 81038 $
Author:
Dimitris Andreadis, Peter Johnson

Field Summary
 
Fields inherited from interface org.jboss.system.ListenerServiceMBean
SL_FILTER_ELEMENT, SL_FILTER_FACTORY_ATTRIBUTE, SL_MBEAN_ELEMENT, SL_MBEAN_HANDBACK_ATTRIBUTE, SL_MBEAN_NAME_ATTRIBUTE, SL_NOTIFICATION_ELEMENT, SL_NOTIFICATION_TYPE_ATTRIBUTE, SL_ROOT_ELEMENT
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Method Summary
 String createModule(String module, String template, HashMap properties)
          Generate a new module based on the specified template and the input properties
 String createModule(String module, String template, String[] properties)
          Used primarily for testing through the jmx-console
 void deployModuleAsynch(String module)
          Move a module to the deploy directory
 String getDeployDir()
          Gets the directory where modules should be deployed
 URL getDeployedURL(String module)
          Get the URL of a deployed module
 String getTemplateDir()
          Gets the directory where templates are stored
 List getTemplatePropertyInfo(String template)
          Get property metadata information for a particular template List
 String getUndeployDir()
          Gets the directory where new deployments are produced
 URL getUndeployedURL(String module)
          Get the URL of an undeployed module
 Set listModuleTemplates()
          Return the set of available deployment templates Set
 String removeDataSource(String module, String template, HashMap properties)
          Remove an existing data source based on the specified template and the input properties.
 boolean removeModule(String module)
          Remove a module if exists
 void setDeployDir(String deployDir)
          Sets the directory where modules should be deployed
 void setTemplateDir(String templateDir)
          Sets the directory where templates are stored
 void setUndeployDir(String undeployDir)
          Sets the directory where new deployments are produced
 void undeployModuleAsynch(String module)
          Move a module to the undeploy directory
 String updateDataSource(String module, String template, HashMap properties)
          Update an existing data source based on the specified template and the input properties.
 boolean updateMBean(MBeanData data)
          Update an existing module based on the specified template and the input properties
 boolean uploadLibrary(URL src, String filename)
          Upload a new library to server lib dir.
 
Methods inherited from interface org.jboss.system.ListenerServiceMBean
setSubscriptionList
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Method Detail

setTemplateDir

void setTemplateDir(String templateDir)
Sets the directory where templates are stored


getTemplateDir

String getTemplateDir()
Gets the directory where templates are stored


setUndeployDir

void setUndeployDir(String undeployDir)
Sets the directory where new deployments are produced


getUndeployDir

String getUndeployDir()
Gets the directory where new deployments are produced


setDeployDir

void setDeployDir(String deployDir)
Sets the directory where modules should be deployed


getDeployDir

String getDeployDir()
Gets the directory where modules should be deployed


listModuleTemplates

Set listModuleTemplates()
Return the set of available deployment templates Set


getTemplatePropertyInfo

List getTemplatePropertyInfo(String template)
                             throws Exception
Get property metadata information for a particular template List

Throws:
Exception

createModule

String createModule(String module,
                    String template,
                    HashMap properties)
                    throws Exception
Generate a new module based on the specified template and the input properties

Throws:
Exception

createModule

String createModule(String module,
                    String template,
                    String[] properties)
                    throws Exception
Used primarily for testing through the jmx-console

Throws:
Exception

removeModule

boolean removeModule(String module)
Remove a module if exists


updateMBean

boolean updateMBean(MBeanData data)
                    throws Exception
Update an existing module based on the specified template and the input properties

Parameters:
data - Data used to update the mbean descriptor. The name and templateName properties are required.
Returns:
True if MBean successfully updated, false otherwise.
Throws:
Exception

updateDataSource

String updateDataSource(String module,
                        String template,
                        HashMap properties)
                        throws Exception
Update an existing data source based on the specified template and the input properties. Note that this method takes the exact same parameters as the createModule method. Thus the client code for creating a new data source or updating an existing data source can be the same, and only the code that makes the deployment service call needs to differentiate between calling createModule and updateDataSource.

Before updating a data source, you will need to gather the properties for the existing data source. The properties can be found in the following MBeans (where XXX is the data source jndi name, and YYY corresponds to the transaction type: NoTxCM, LocalTxCM, XATxCM):

The service=metadata MBean provides the type-mapping, which should be provided as a property named "type-mapping".

To find the dependencies, get the jboss.system:service=ServiceController MBean and invoke the listDeployed method. Then search through the returned results for the jboss.jca:name=XXX,service=ManagedConnectionFactory MBean. That entry will contain the dependecies. Note that there will be an extra implied dependency named "jboss.jca:service=RARDeployment,name='jboss-ZZZ-jdbc.rar'", where ZZZ is 'local' (local and no transaction types) or 'xa'. Ignore this extra dependency, do not provide it when doing an update.

Parameters:
module - The name of the model that contains the data source definition. For example, the default data source, DefaultDS, is typically found in a module named "hsqldb-ds.xml", with "hsqldb" being an acceptable abbreviation.
template - The name of the template to use to update the data source. You must select the proper template based on the data source transaction type. Use one of the following: "local-tx-datasource", "no-tx-datasource", or "xa-datasource". Alternatively, you could add the "-update" suffix; for example, "local-tx-datasource-update" is the same as "local-tx-datasource".
MashMap - The collection of properties used for the data source. See the template-config.xml file for the given template (in template directory) for expected property names.
Returns:
The full module name, with the suffix. For example, "hsqldb-ds.xml".
Throws:
Exception

removeDataSource

String removeDataSource(String module,
                        String template,
                        HashMap properties)
                        throws Exception
Remove an existing data source based on the specified template and the input properties. This method takes the same parameters as the updateDataSource method. Refer to the comments of the updateDataSource method for more descriptions.

Parameters:
module - The name of the model that contains the data source definition. See the module parameter under updateDataSource for more information.
template - There is only one delete template: "datasource". Optionally, you can use the template name "datasource-remove".
properties - The key property to provide is "jndi-name". This property if used to determine which data source to remove.
Returns:
The full module name, with the suffix.
Throws:
Exception
See Also:
updateDataSource(String, String, HashMap)

deployModuleAsynch

void deployModuleAsynch(String module)
                        throws Exception
Move a module to the deploy directory

Throws:
Exception

getDeployedURL

URL getDeployedURL(String module)
                   throws Exception
Get the URL of a deployed module

Throws:
Exception

undeployModuleAsynch

void undeployModuleAsynch(String module)
                          throws Exception
Move a module to the undeploy directory

Throws:
Exception

getUndeployedURL

URL getUndeployedURL(String module)
                     throws Exception
Get the URL of an undeployed module

Throws:
Exception

uploadLibrary

boolean uploadLibrary(URL src,
                      String filename)
Upload a new library to server lib dir. A different filename may be specified, when writing the library. If the target filename exists, upload is not performed.

Parameters:
src - the source url to copy
filename - the filename to use when copying (optional)
Returns:
true if upload was succesful, false otherwise


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.