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 voiddoStart(JvmLauncher java)Implementation ofRunnableContainer.start()that all containers extending this class must implement.protected voiddoStop(JvmLauncher java)Implementation ofRunnableContainer.stop()that all containers extending this class must implement.ContainerCapabilitygetCapability()StringgetConfDir(String configurationName)StringgetDeployDir(String configurationName)protected StringgetJBossLogLevel(String cargoLogLevel)Translate Cargo logging levels into JBoss logging levels.StringgetLibDir(String configurationName)protected StringgetSpecificConfigurationDir(String location, String configurationName)protected StringgetVersion(String defaultVersion)Parse installed JBoss version.protected voidverify()Verify required properties have been set before executing any action.protected voidverifyJBossHome()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:
doStartin 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:
doStopin 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:
verifyin classAbstractInstalledLocalContainer
-
getCapability
public ContainerCapability getCapability()
- Specified by:
getCapabilityin interfaceContainer- Returns:
- the
ContainerCapabilityof the container in term of ability to deploy such and such type ofDeployables (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
defaultVersionif the version number could not be determined
-
getConfDir
public String getConfDir(String configurationName)
- Specified by:
getConfDirin 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:
getLibDirin 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:
getDeployDirin 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
-
-