org.codehaus.cargo.container.weblogic
Class WebLogic9xConfigXmlInstalledLocalDeployer

java.lang.Object
  extended by org.codehaus.cargo.util.log.LoggedObject
      extended by org.codehaus.cargo.container.spi.deployer.AbstractDeployer
          extended by org.codehaus.cargo.container.spi.deployer.AbstractLocalDeployer
              extended by org.codehaus.cargo.container.spi.deployer.AbstractInstalledLocalDeployer
                  extended by org.codehaus.cargo.container.weblogic.WebLogic9xConfigXmlInstalledLocalDeployer
All Implemented Interfaces:
Deployer, Loggable

public class WebLogic9xConfigXmlInstalledLocalDeployer
extends AbstractInstalledLocalDeployer

Static deployer that manages deployment configuration by manipulating the WebLogic config.xml file.

Version:
$Id: $

Field Summary
protected static java.lang.String RESOURCE_PATH
          The path under which the container resources are stored in the JAR.
 
Constructor Summary
WebLogic9xConfigXmlInstalledLocalDeployer(InstalledLocalContainer container)
          
 
Method Summary
protected  void addDeployableToDomain(Deployable deployable, org.dom4j.Element domain)
          Create and insert an app-deployment element into the domain of the WebLogic server.
protected  org.dom4j.Element createElementForDeployableInDomain(Deployable deployable, org.dom4j.Element domain)
          create the config.xml element representing the Deployable.
protected  java.lang.String createIdForDeployable(Deployable deployable)
          Get a string name for the configuration of this deployable.
protected  java.lang.String createIdFromFileName(Deployable deployable)
          Get a string name for the configuration of this deployable based on its filename.
 void deploy(Deployable deployable)
           deploys files by adding their configuration to the config.xml file of the WebLogic server.
protected  java.lang.String getConfigXmlPath()
          Return the absolute path of the config.xml file.
protected  java.lang.String getDomainHome()
          get the DOMAIN_HOME of the server.
protected  java.lang.String getServerName()
          return the running server's name.
 org.dom4j.Document readConfigXml()
          read the domain's config.xml file into a Document.
protected  void removeDeployableFromDomain(Deployable deployable, org.dom4j.Element domain)
          Remove the corresponding app-deployment element from the domain of the WebLogic server.
protected  void reorderAppDeploymentsAfterConfigurationVersion(org.dom4j.Element domain)
          Per current schema of the weblogic domain, app-deployment elements need to come directly after the configuration-version element.
protected  java.util.List selectAppDeployments(Deployable deployable, org.dom4j.Element domain)
          this will select the node(s) that match the below deployment.
 void undeploy(Deployable deployable)
           undeploys files by removing their configuration to the config.xml file of the WebLogic server.
 void writeConfigXml(org.dom4j.Document configXml)
          write the domain's config.xml to disk.
 
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractInstalledLocalDeployer
getType
 
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractLocalDeployer
getContainer, getFileHandler, setFileHandler
 
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractDeployer
deploy, deploy, redeploy, start, stop, undeploy
 
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.cargo.util.log.Loggable
getLogger, setLogger
 

Field Detail

RESOURCE_PATH

protected static final java.lang.String RESOURCE_PATH
The path under which the container resources are stored in the JAR.

See Also:
Constant Field Values
Constructor Detail

WebLogic9xConfigXmlInstalledLocalDeployer

public WebLogic9xConfigXmlInstalledLocalDeployer(InstalledLocalContainer container)

Parameters:
container - container to configure
Method Detail

readConfigXml

public org.dom4j.Document readConfigXml()
read the domain's config.xml file into a Document.

Returns:
Document corresponding with config.xml

getConfigXmlPath

protected java.lang.String getConfigXmlPath()
Return the absolute path of the config.xml file.

Returns:
path including config.xml

writeConfigXml

public void writeConfigXml(org.dom4j.Document configXml)
write the domain's config.xml to disk.

Parameters:
configXml - document to write to disk

getDomainHome

protected java.lang.String getDomainHome()
get the DOMAIN_HOME of the server.

Returns:
location to find files like config.xml

deploy

public void deploy(Deployable deployable)
deploys files by adding their configuration to the config.xml file of the WebLogic server.

Specified by:
deploy in interface Deployer
Overrides:
deploy in class AbstractDeployer
See Also:
AbstractDeployer.deploy(org.codehaus.cargo.container.deployable.Deployable)

undeploy

public void undeploy(Deployable deployable)
undeploys files by removing their configuration to the config.xml file of the WebLogic server.

Specified by:
undeploy in interface Deployer
Overrides:
undeploy in class AbstractDeployer
See Also:
AbstractDeployer.undeploy(org.codehaus.cargo.container.deployable.Deployable)

removeDeployableFromDomain

protected void removeDeployableFromDomain(Deployable deployable,
                                          org.dom4j.Element domain)
Remove the corresponding app-deployment element from the domain of the WebLogic server.

Parameters:
deployable - - application component to remove
domain - - Domain element of the WebLogic server

selectAppDeployments

protected java.util.List selectAppDeployments(Deployable deployable,
                                              org.dom4j.Element domain)
this will select the node(s) that match the below deployment.

Parameters:
deployable - what to search for
domain - root element to search in
Returns:
list of child elements that match the deployment

addDeployableToDomain

protected void addDeployableToDomain(Deployable deployable,
                                     org.dom4j.Element domain)
Create and insert an app-deployment element into the domain of the WebLogic server. Ensure that schema ordering is correct.

Parameters:
deployable - - application component to configure
domain - - Domain element of the WebLogic server

createElementForDeployableInDomain

protected org.dom4j.Element createElementForDeployableInDomain(Deployable deployable,
                                                               org.dom4j.Element domain)
create the config.xml element representing the Deployable. In WebLogic 9x, this is the element app-deployment.

Parameters:
deployable - to configure
domain - root element of the config.xml file
Returns:
app-deployment element

reorderAppDeploymentsAfterConfigurationVersion

protected void reorderAppDeploymentsAfterConfigurationVersion(org.dom4j.Element domain)
Per current schema of the weblogic domain, app-deployment elements need to come directly after the configuration-version element.

Parameters:
domain - - domain to re-order

createIdForDeployable

protected java.lang.String createIdForDeployable(Deployable deployable)
Get a string name for the configuration of this deployable. This should be XML friendly. For example, the String returned will have no slashes or colons, and be as short as possible.

Parameters:
deployable - used to construct the id
Returns:
a string that can be used to name this configuration

createIdFromFileName

protected java.lang.String createIdFromFileName(Deployable deployable)
Get a string name for the configuration of this deployable based on its filename.

Parameters:
deployable - used to construct the id
Returns:
a string that can be used to name this configuration

getServerName

protected java.lang.String getServerName()
return the running server's name.

Returns:
the WebLogic server's name


Copyright © 2004-2011 Codehaus. All Rights Reserved.