org.rhq.plugins.jbossas.util
Class DeploymentUtility

java.lang.Object
  extended by org.rhq.plugins.jbossas.util.DeploymentUtility

public class DeploymentUtility
extends Object

Accesses the MainDeployer mbean to find the deployment files behind services.

Author:
Greg Hinkle, Heiko W. Rupp

Field Summary
protected static String MAIN_DEPLOYER
          The object name of the JBoss main deployer MBean.
 
Constructor Summary
DeploymentUtility()
           
 
Method Summary
static File getDescriptorFile(org.mc4j.ems.connection.EmsConnection connection, String objectName)
          This will attempt to find the deployment descriptor file where the ObjectName MBean was deployed.
static Map<String,String> getEarDeploymentPath(org.mc4j.ems.connection.EmsConnection connection, List<String> fileNames)
          Return the path where the passed objectnames are deployed
static String getJndiNameBinding(org.mc4j.ems.connection.bean.EmsBean bean)
           
protected static org.mc4j.ems.connection.bean.operation.EmsOperation getListDeployedOperation(org.mc4j.ems.connection.EmsConnection connection)
           
static List<org.mc4j.ems.connection.bean.EmsBean> getVHostsFromClusterManager(String contextRoot, org.mc4j.ems.connection.EmsConnection emsConnection)
          Retrieves the virtual host MBeans for the webapp with the specified context root.
static List<org.mc4j.ems.connection.bean.EmsBean> getVHostsFromLocalManager(String contextRoot, org.mc4j.ems.connection.EmsConnection emsConnection)
          Retrieves the virtual host MBeans for the webapp with the specified context root.
static Map<String,List<WarDeploymentInformation>> getWarDeploymentInformation(org.mc4j.ems.connection.EmsConnection connection, List<String> jbossManMBeanNames)
          Retrieves all the discovery information for a War resources.
static boolean isDuplicateJndiName(org.mc4j.ems.connection.EmsConnection connection, String mbeanType, String jndiName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAIN_DEPLOYER

protected static final String MAIN_DEPLOYER
The object name of the JBoss main deployer MBean.

See Also:
Constant Field Values
Constructor Detail

DeploymentUtility

public DeploymentUtility()
Method Detail

getListDeployedOperation

protected static org.mc4j.ems.connection.bean.operation.EmsOperation getListDeployedOperation(org.mc4j.ems.connection.EmsConnection connection)

getDescriptorFile

public static File getDescriptorFile(org.mc4j.ems.connection.EmsConnection connection,
                                     String objectName)
This will attempt to find the deployment descriptor file where the ObjectName MBean was deployed.

Parameters:
connection - the connection to the JBoss instance
objectName - The objectname to look for
Returns:
the path to the file where the MBean was deployed, or null if it could not be found

getWarDeploymentInformation

public static Map<String,List<WarDeploymentInformation>> getWarDeploymentInformation(org.mc4j.ems.connection.EmsConnection connection,
                                                                                     List<String> jbossManMBeanNames)
Retrieves all the discovery information for a War resources. We are retrieving all the information so that there is only ever one call to the MBeanServer to get the deployed mbeans, therefore saving some performance if it did this for each and every war resource one at a time.

Parameters:
connection - EmsConnection to get the mbean information
jbossManMBeanNames - Name of the main jboss.management mbeans for a collection of wars.
Returns:
map holds all the war deployment information for the objects passed in the objectNames collection

getEarDeploymentPath

public static Map<String,String> getEarDeploymentPath(org.mc4j.ems.connection.EmsConnection connection,
                                                      List<String> fileNames)
Return the path where the passed objectnames are deployed

Parameters:
connection -
fileNames - The objectNames of the EAR files we are interested in
Returns:
a Map with objectname as key and path as value. This map may be empty on error.

isDuplicateJndiName

public static boolean isDuplicateJndiName(org.mc4j.ems.connection.EmsConnection connection,
                                          String mbeanType,
                                          String jndiName)

getJndiNameBinding

public static String getJndiNameBinding(org.mc4j.ems.connection.bean.EmsBean bean)

getVHostsFromLocalManager

public static List<org.mc4j.ems.connection.bean.EmsBean> getVHostsFromLocalManager(String contextRoot,
                                                                                   org.mc4j.ems.connection.EmsConnection emsConnection)
Retrieves the virtual host MBeans for the webapp with the specified context root. VHost MBeans have the pattern "jboss.web:host=*,path=/,type=Manager".

Parameters:
contextRoot - the context root
emsConnection - valid connection to the remote MBeanServer
Returns:
the list of VHost MBeans for this webapp

getVHostsFromClusterManager

public static List<org.mc4j.ems.connection.bean.EmsBean> getVHostsFromClusterManager(String contextRoot,
                                                                                     org.mc4j.ems.connection.EmsConnection emsConnection)
Retrieves the virtual host MBeans for the webapp with the specified context root. VHost MBeans have the pattern "jboss.web:WebModule=//snert.home.pilhuhn.de/dist-vhost,service=ClusterManager".

Parameters:
contextRoot - the context root
emsConnection - valid connection to the remote MBeanServer
Returns:
the list of VHost MBeans for this webapp


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