Class AbstractJBossInstalledLocalContainer
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.AbstractContainer
-
- org.codehaus.cargo.container.spi.AbstractLocalContainer
-
- org.codehaus.cargo.container.spi.AbstractInstalledLocalContainer
-
- org.codehaus.cargo.container.jboss.internal.AbstractJBossInstalledLocalContainer
-
- All Implemented Interfaces:
Container
,InstalledLocalContainer
,RunnableContainer
,SpawnedContainer
,JBossInstalledLocalContainer
,LocalContainer
,Loggable
- Direct Known Subclasses:
AbstractJBoss5xInstalledLocalContainer
,JBoss3xInstalledLocalContainer
,JBoss4xInstalledLocalContainer
public abstract class AbstractJBossInstalledLocalContainer extends AbstractInstalledLocalContainer implements JBossInstalledLocalContainer
Abstract class for JBoss container family.
-
-
Constructor Summary
Constructors Constructor Description AbstractJBossInstalledLocalContainer(LocalConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doStart(JvmLauncher java)
Implementation ofRunnableContainer.start()
that all containers extending this class must implement.protected void
doStop(JvmLauncher java)
Implementation ofRunnableContainer.stop()
that all containers extending this class must implement.ContainerCapability
getCapability()
String
getConfDir(String configurationName)
String
getDeployDir(String configurationName)
protected String
getJBossLogLevel(String cargoLogLevel)
Translate Cargo logging levels into JBoss logging levels.String
getLibDir(String configurationName)
protected String
getSpecificConfigurationDir(String location, String configurationName)
protected String
getVersion(String defaultVersion)
Parse installed JBoss version.protected void
verify()
Verify required properties have been set before executing any action.protected void
verifyJBossHome()
Verify that the JBoss directory structure is valid and throw a ContainerException if not.-
Methods inherited from class org.codehaus.cargo.container.spi.AbstractInstalledLocalContainer
addExtraClasspath, addExtraClasspath, addMemoryArguments, addRuntimeArgs, addSharedClasspath, addToolsJarToClasspath, createJvmLauncher, forceStopInternal, getExtraClasspath, getHome, getHttpUtils, getJavaHome, getJvmLauncherFactory, getResourceUtils, getSharedClasspath, getSystemProperties, getType, ifPresentAddPathToList, setExtraClasspath, setHome, setJvmLauncherFactory, setJvmToLaunchContainerIn, setLogger, setSharedClasspath, setSystemProperties, startInternal, stopInternal
-
Methods inherited from class org.codehaus.cargo.container.spi.AbstractLocalContainer
executePostStartTasks, getConfiguration, getFileHandler, getOutput, getState, getTimeout, isAppend, restart, setAppend, setConfiguration, setFileHandler, setOutput, setState, setTimeout, start, stop, waitForCompletion, waitForPortShutdown, waitForStarting
-
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, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.cargo.container.Container
getId, getName, getState, getType
-
Methods inherited from interface org.codehaus.cargo.container.InstalledLocalContainer
getHome, setHome
-
Methods inherited from interface org.codehaus.cargo.container.LocalContainer
getConfiguration, getFileHandler, setConfiguration, setFileHandler
-
Methods inherited from interface org.codehaus.cargo.container.internal.RunnableContainer
getOutput, getTimeout, isAppend, restart, setAppend, setOutput, setTimeout, start, stop
-
Methods inherited from interface org.codehaus.cargo.container.internal.SpawnedContainer
addExtraClasspath, addSharedClasspath, getExtraClasspath, getJvmLauncherFactory, getSharedClasspath, getSystemProperties, setExtraClasspath, setJvmLauncherFactory, setSharedClasspath, setSystemProperties
-
-
-
-
Constructor Detail
-
AbstractJBossInstalledLocalContainer
public AbstractJBossInstalledLocalContainer(LocalConfiguration configuration)
-
-
Method Detail
-
doStart
protected void doStart(JvmLauncher java) throws Exception
Implementation ofRunnableContainer.start()
that all containers extending this class must implement.- Specified by:
doStart
in classAbstractInstalledLocalContainer
- Parameters:
java
- the predefined JVM launcher to use to start the container- Throws:
Exception
- if any error is raised during the container start
-
doStop
protected void doStop(JvmLauncher java) throws Exception
Implementation ofRunnableContainer.stop()
that all containers extending this class must implement.- Specified by:
doStop
in classAbstractInstalledLocalContainer
- Parameters:
java
- the predefined JVM launcher to use to stop the container- Throws:
Exception
- if any error is raised during the container stop
-
verify
protected final void verify()
Verify required properties have been set before executing any action.- Overrides:
verify
in classAbstractInstalledLocalContainer
-
getCapability
public ContainerCapability getCapability()
- Specified by:
getCapability
in interfaceContainer
- Returns:
- the
ContainerCapability
of the container in term of ability to deploy such and such type ofDeployable
s (eg WAR, EAR, etc).
-
getVersion
protected String getVersion(String defaultVersion)
Parse installed JBoss version.- Parameters:
defaultVersion
- the default version used if the exact JBoss version can't be determined- Returns:
- the JBoss version, or
defaultVersion
if the version number could not be determined
-
getConfDir
public String getConfDir(String configurationName)
- Specified by:
getConfDir
in interfaceJBossInstalledLocalContainer
- Parameters:
configurationName
- the JBoss server configuration name for which to return the conf dir- Returns:
- The conf directory located under the container's home installation directory
-
getLibDir
public String getLibDir(String configurationName)
- Specified by:
getLibDir
in interfaceJBossInstalledLocalContainer
- Parameters:
configurationName
- the JBoss server configuration name for which to return the conf dir- Returns:
- The lib directory located under the container's home installation directory
-
getDeployDir
public String getDeployDir(String configurationName)
- Specified by:
getDeployDir
in interfaceJBossInstalledLocalContainer
- Parameters:
configurationName
- the JBoss server configuration name for which to return the conf dir- Returns:
- The deploy directory located under the container's home installation directory
-
getSpecificConfigurationDir
protected String getSpecificConfigurationDir(String location, String configurationName)
- Parameters:
location
- the name of the directory to return inside the server configurationconfigurationName
- the server configuration name to use. A server configuration is located in theserver/
directory inside the JBoss installation dir.- Returns:
- the location of the passed directory name inside the server configuration, as a File
-
verifyJBossHome
protected void verifyJBossHome()
Verify that the JBoss directory structure is valid and throw a ContainerException if not.
-
getJBossLogLevel
protected String getJBossLogLevel(String cargoLogLevel)
Translate Cargo logging levels into JBoss logging levels. The default implementation is for log4j, but can be overridden by a sub-class should JBoss change logging framework.- Parameters:
cargoLogLevel
- Cargo logging level- Returns:
- the corresponding JBoss (log4j) logging level
-
-