Class WebLogic9xStandaloneLocalConfiguration
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.configuration.AbstractConfiguration
-
- org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
-
- org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
-
- org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
-
- org.codehaus.cargo.container.weblogic.WebLogic9xStandaloneLocalConfiguration
-
- All Implemented Interfaces:
Configuration
,DataSourceSupport
,ResourceSupport
,LocalConfiguration
,StandaloneLocalConfiguration
,ContainerConfiguration
,WebLogicConfiguration
,Loggable
- Direct Known Subclasses:
WebLogic10xStandaloneLocalConfiguration
public class WebLogic9xStandaloneLocalConfiguration extends AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder implements WebLogicConfiguration
WebLogic standaloneContainerConfiguration
implementation.
-
-
Field Summary
-
Fields inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
RESOURCE_PATH
-
-
Constructor Summary
Constructors Constructor Description WebLogic9xStandaloneLocalConfiguration(String dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addDataSourceToDomain(DataSource ds, Element domain)
Insert the corresponding datasource element into the domain of the WebLogic server.protected String
buildDataSourceFileName(DataSource ds)
determines the full path to store the datasource configuration file.protected void
createBlankDataSourceFile(String path)
Create a blank datasource file with correct namespace.protected ConfigurationBuilder
createConfigurationBuilder(LocalContainer container)
protected void
deployCargoPing(WebLogicLocalContainer container)
Deploy the Cargo Ping utility to the container.protected void
doConfigure(LocalContainer container)
Implementation ofLocalConfiguration.configure(LocalContainer)
that all local configuration using this class must implement.ConfigurationCapability
getCapability()
protected String
getConfigXmlPath()
Return the absolute path of the config.xml file.String
getDomainHome()
The DOMAIN_HOME holds the configuration and runtime files of a WebLogic domain.protected Map<String,String>
getNamespaces()
Implementations should avoid passing null, and instead passCollections.EMPTY_MAP
, if the document is DTD bound.protected String
getOrCreateDataSourceConfigurationFile(DataSource ds, LocalContainer container)
note that this file could hold other configuration besides datasources.protected String
getOrCreateResourceConfigurationFile(Resource resource, LocalContainer container)
note that this file could hold other configuration besides Resources.protected String
getServerName()
return the running server's name.protected String
getXpathForDataSourcesParent()
DataSource entries must be stored in the xml configuration file.protected String
getXpathForResourcesParent()
Resource entries must be stored in the xml configuration file.protected void
linkDataSourceToConfigXml(DataSource ds)
This will add a reference to an externally defined datasource file into the config.xml file.Document
readConfigXml()
read the domain's config.xml file into a Document.void
setFileHandler(FileHandler fileHandler)
String
toString()
void
writeConfigXml(Document configXml)
write the domain's config.xml to disk.-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
configure, configure, configure, configureDataSources, configureResources, writeConfigurationToXpath
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
addXmlReplacement, addXmlReplacement, addXmlReplacement, addXmlReplacement, configureFiles, getType, getXmlReplacements, performXmlReplacements, removeXmlReplacement, removeXmlReplacement, replaceInFile, setupConfigurationDir, verify
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
addDataSource, addDataSourcesFromProperties, addDeployable, addResource, addResourcesFromProperties, addUser, addUsersFromProperties, applyPortOffset, applyPortOffset, collectUnsupportedDataSourcesAndThrowException, collectUnsupportedResourcesAndThrowException, flagOffsetApplied, getDataSources, getDeployables, getDestDirectoryLocation, getDestFileLocation, getFileHandler, getFileProperties, getHome, getPropertyValue, getReplacements, getResources, getResourceUtils, getUsers, isOffsetApplied, isOffsetApplied, parsePropertiesForPendingConfiguration, revertPortOffset, revertPortOffset, setConfigFileProperty, setFileProperty, setLogger
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractConfiguration
getProperties, setProperty
-
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.codehaus.cargo.container.configuration.Configuration
getProperties, getPropertyValue, getType, setProperty
-
Methods inherited from interface org.codehaus.cargo.container.configuration.LocalConfiguration
addDataSource, addDeployable, addResource, addUser, applyPortOffset, getDataSources, getDeployables, getFileHandler, getFileProperties, getHome, getResources, getUsers, isOffsetApplied, revertPortOffset, setConfigFileProperty, setFileProperty
-
-
-
-
Constructor Detail
-
WebLogic9xStandaloneLocalConfiguration
public WebLogic9xStandaloneLocalConfiguration(String dir)
-
-
Method Detail
-
getCapability
public ConfigurationCapability getCapability()
- Specified by:
getCapability
in interfaceConfiguration
- Returns:
- the
ConfigurationCapability
of the configuration in term of properties it supports, etc
-
doConfigure
protected void doConfigure(LocalContainer container) throws Exception
Implementation ofLocalConfiguration.configure(LocalContainer)
that all local configuration using this class must implement. This provides the ability to perform generic actions before and after the container-specific implementation. Another way would be to use AOP...- Specified by:
doConfigure
in classAbstractLocalConfiguration
- Parameters:
container
- the container to configure- Throws:
Exception
- if any error is raised during the configuration
-
deployCargoPing
protected void deployCargoPing(WebLogicLocalContainer container) throws IOException
Deploy the Cargo Ping utility to the container.- Parameters:
container
- the container to configure- Throws:
IOException
- if the cargo ping deployment fails
-
getDomainHome
public String getDomainHome()
The DOMAIN_HOME holds the configuration and runtime files of a WebLogic domain. One or more server processes execute from this directory and must have permissions to write to it.- Specified by:
getDomainHome
in interfaceWebLogicConfiguration
- Returns:
- The DOMAIN_HOME, or instance-specific installation of WebLogic
-
getXpathForDataSourcesParent
protected String getXpathForDataSourcesParent()
DataSource entries must be stored in the xml configuration file. Under which element do we insert the entries? example: //Engine/DefaultContext- Specified by:
getXpathForDataSourcesParent
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Returns:
- path the the parent element datasources should be inserted under.
-
getNamespaces
protected Map<String,String> getNamespaces()
Implementations should avoid passing null, and instead passCollections.EMPTY_MAP
, if the document is DTD bound.- Specified by:
getNamespaces
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Returns:
- a map of prefixes to the url namespaces used in the datasource configuration file.
-
createConfigurationBuilder
protected ConfigurationBuilder createConfigurationBuilder(LocalContainer container)
- Specified by:
createConfigurationBuilder
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Parameters:
container
- Container the dataSource will be configured on.- Returns:
- the object that produces xml entries for DataSource definitions.
-
getOrCreateDataSourceConfigurationFile
protected String getOrCreateDataSourceConfigurationFile(DataSource ds, LocalContainer container)
note that this file could hold other configuration besides datasources.- Specified by:
getOrCreateDataSourceConfigurationFile
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Parameters:
ds
- the DataSource configuration you wish to install on the container.container
- the container whose configuration you wish to affect.- Returns:
- the file that holds datasource configuration.
-
linkDataSourceToConfigXml
protected void linkDataSourceToConfigXml(DataSource ds)
This will add a reference to an externally defined datasource file into the config.xml file.- Parameters:
ds
- - datasource to reference
-
addDataSourceToDomain
protected void addDataSourceToDomain(DataSource ds, Element domain)
Insert the corresponding datasource element into the domain of the WebLogic server.- Parameters:
ds
- - datasource component to configuredomain
- - Domain element of the WebLogic server
-
getServerName
protected String getServerName()
return the running server's name.- Returns:
- the WebLogic server's name
-
writeConfigXml
public void writeConfigXml(Document configXml)
write the domain's config.xml to disk.- Parameters:
configXml
- document to write to disk
-
readConfigXml
public Document readConfigXml()
read the domain's config.xml file into a Document.- Returns:
- Document corresponding with config.xml
-
createBlankDataSourceFile
protected void createBlankDataSourceFile(String path)
Create a blank datasource file with correct namespace.- Parameters:
path
- where to create the base file.
-
getConfigXmlPath
protected String getConfigXmlPath()
Return the absolute path of the config.xml file.- Returns:
- path including config.xml
-
buildDataSourceFileName
protected String buildDataSourceFileName(DataSource ds)
determines the full path to store the datasource configuration file.- Parameters:
ds
- datasource to determine the filename of- Returns:
- full path to the datasource configuration file
-
setFileHandler
public void setFileHandler(FileHandler fileHandler)
- Specified by:
setFileHandler
in interfaceLocalConfiguration
- Overrides:
setFileHandler
in classAbstractLocalConfiguration
- Parameters:
fileHandler
- the file utility class to use for performing all file I/O.
-
getOrCreateResourceConfigurationFile
protected String getOrCreateResourceConfigurationFile(Resource resource, LocalContainer container)
note that this file could hold other configuration besides Resources. This implementation throws an UnsupportedOperationException as Resource configuration is not supported in WebLogic.- Specified by:
getOrCreateResourceConfigurationFile
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Parameters:
resource
- the Resource configuration you wish to install on the container.container
- the container whose configuration you wish to affect.- Returns:
- the file that holds Resource configuration.
-
getXpathForResourcesParent
protected String getXpathForResourcesParent()
Resource entries must be stored in the xml configuration file. Under which element do we insert the entries? example: //Engine/DefaultContext This implementation throws an UnsupportedOperationException as Resource configuration is not supported in WebLogic.- Specified by:
getXpathForResourcesParent
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Returns:
- path the the parent element Resources should be inserted under.
-
-