Class JBoss3x4xStandaloneLocalConfiguration
- 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.jboss.JBoss3x4xStandaloneLocalConfiguration
-
- All Implemented Interfaces:
Configuration
,LocalConfiguration
,StandaloneLocalConfiguration
,ContainerConfiguration
,Loggable
- Direct Known Subclasses:
JBoss42xStandaloneLocalConfiguration
public class JBoss3x4xStandaloneLocalConfiguration extends AbstractStandaloneLocalConfiguration
Implementation of a standaloneConfiguration
for JBoss 3.x series and JBoss 4.x series.
-
-
Field Summary
Fields Modifier and Type Field Description protected JBossInstalledLocalContainer
jbossContainer
JBoss container instance.protected String
log4jFileName
Name of the JBoss log4j configuration file.-
Fields inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
RESOURCE_PATH
-
-
Constructor Summary
Constructors Constructor Description JBoss3x4xStandaloneLocalConfiguration(String dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
copyExternalResources(File sourceDir, File destDir)
Copy external resources to cargo configuration directory.protected void
copyExternalResources(File sourceDir, File destDir, String[] cargoFiles)
Copy external resources to cargo configuration directory.protected Map<String,String>
createJBossReplacements(JBossInstalledLocalContainer container)
Create token replacement in configuration file with user defined token.protected void
deployDatasources(String deployDir)
Deploys the JBoss datasources.protected void
doConfigure(LocalContainer container)
Implementation ofLocalConfiguration.configure(LocalContainer)
that all local configuration using this class must implement.ConfigurationCapability
getCapability()
JBossInstalledLocalContainer
getJbossContainer()
protected String
getSharedClasspathXml(JBossInstalledLocalContainer container)
Construct the shared classpath XML based on the container.String
toString()
void
verify()
Verify that the configuration is valid.-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
addXmlReplacement, addXmlReplacement, addXmlReplacement, addXmlReplacement, configureFiles, getType, getXmlReplacements, performXmlReplacements, removeXmlReplacement, removeXmlReplacement, replaceInFile, setupConfigurationDir
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
addDataSource, addDataSourcesFromProperties, addDeployable, addResource, addResourcesFromProperties, addUser, addUsersFromProperties, applyPortOffset, applyPortOffset, collectUnsupportedDataSourcesAndThrowException, collectUnsupportedResourcesAndThrowException, configure, flagOffsetApplied, getDataSources, getDeployables, getDestDirectoryLocation, getDestFileLocation, getFileHandler, getFileProperties, getHome, getPropertyValue, getReplacements, getResources, getResourceUtils, getUsers, isOffsetApplied, isOffsetApplied, parsePropertiesForPendingConfiguration, revertPortOffset, revertPortOffset, setConfigFileProperty, setFileHandler, 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, setProperty
-
Methods inherited from interface org.codehaus.cargo.container.configuration.LocalConfiguration
addDataSource, addDeployable, addResource, addUser, applyPortOffset, configure, getDataSources, getDeployables, getFileHandler, getFileProperties, getHome, getResources, getUsers, isOffsetApplied, revertPortOffset, setConfigFileProperty, setFileHandler, setFileProperty
-
-
-
-
Field Detail
-
jbossContainer
protected JBossInstalledLocalContainer jbossContainer
JBoss container instance.
-
log4jFileName
protected String log4jFileName
Name of the JBoss log4j configuration file.
-
-
Constructor Detail
-
JBoss3x4xStandaloneLocalConfiguration
public JBoss3x4xStandaloneLocalConfiguration(String dir)
-
-
Method Detail
-
getCapability
public ConfigurationCapability getCapability()
- Returns:
- the
ConfigurationCapability
of the configuration in term of properties it supports, etc
-
getJbossContainer
public JBossInstalledLocalContainer getJbossContainer()
- Returns:
- Returns the jbossContainer.
-
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
-
deployDatasources
protected void deployDatasources(String deployDir) throws IOException
Deploys the JBoss datasources.- Parameters:
deployDir
- The JBossdeploy
directory.- Throws:
IOException
- If copying the datasource XMLs fail.
-
verify
public void verify()
Verify that the configuration is valid. The checks to be performed may vay whether this is standalone or existing configuration. This method should also be used to verify that the configuration properties specified by the user are valid and that the required ones are set.- Specified by:
verify
in interfaceContainerConfiguration
- Overrides:
verify
in classAbstractStandaloneLocalConfiguration
-
copyExternalResources
protected void copyExternalResources(File sourceDir, File destDir) throws IOException
Copy external resources to cargo configuration directory. This method will copy entire resources in the sourceDir (recursive), if it's a directory.- Parameters:
sourceDir
- resource file / directory to be copieddestDir
- cargo configuration directory- Throws:
IOException
- If an error occurs during the copy.
-
copyExternalResources
protected void copyExternalResources(File sourceDir, File destDir, String[] cargoFiles) throws IOException
Copy external resources to cargo configuration directory. This method will copy entire resources in the sourceDir (recursive), if it's a directory.- Parameters:
sourceDir
- resource file / directory to be copieddestDir
- cargo configuration directorycargoFiles
- list of cargo resources file that will excluded- Throws:
IOException
- If an error occurs during the copy.
-
createJBossReplacements
protected Map<String,String> createJBossReplacements(JBossInstalledLocalContainer container) throws MalformedURLException
Create token replacement in configuration file with user defined token.- Parameters:
container
- the JBoss container instance from which we'll find the JBoss installed files to reference- Returns:
- token with all the user-defined token value
- Throws:
MalformedURLException
- If an URL is malformed.
-
getSharedClasspathXml
protected String getSharedClasspathXml(JBossInstalledLocalContainer container) throws MalformedURLException
Construct the shared classpath XML based on the container.- Parameters:
container
- the JBoss container instance from which we'll find the JBoss installed files to reference- Returns:
- Shared classpath XML based on the container.
- Throws:
MalformedURLException
- If URL building fails.
-
-