Class JBoss7xInstalledLocalContainer
- 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.JBoss7xInstalledLocalContainer
-
- All Implemented Interfaces:
Container,InstalledLocalContainer,RunnableContainer,SpawnedContainer,LocalContainer,ScriptingCapableContainer,Loggable
- Direct Known Subclasses:
JBoss71xInstalledLocalContainer
public class JBoss7xInstalledLocalContainer extends AbstractInstalledLocalContainer implements ScriptingCapableContainer
JBoss 7.x series container implementation.
-
-
Constructor Summary
Constructors Constructor Description JBoss7xInstalledLocalContainer(LocalConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddRuntimeArgs(JvmLauncher java)Add command line arguments to the java command.protected voidcopyExtraClasspathJars()Cope extra classpath JARs.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.protected voidexecutePostStartTasks()Some containers may require some extra steps after startup.voidexecuteScript(List<ScriptCommand> configurationScript)Writes CLI configuration script.voidexecuteScriptFiles(List<String> scriptFilePaths)Executes CLI scripts.ContainerCapabilitygetCapability()protected FilegetConfigAdminDirectory()StringgetId()StringgetName()protected StringgetVersion(String defaultVersion)Parse installed JBoss version.booleanisOnline()protected voidsetProperties(JvmLauncher java)Set the properties on the JVM launcher.-
Methods inherited from class org.codehaus.cargo.container.spi.AbstractInstalledLocalContainer
addExtraClasspath, addExtraClasspath, addMemoryArguments, addSharedClasspath, addToolsJarToClasspath, createJvmLauncher, forceStopInternal, getExtraClasspath, getHome, getHttpUtils, getJavaHome, getJvmLauncherFactory, getResourceUtils, getSharedClasspath, getSystemProperties, getType, ifPresentAddPathToList, setExtraClasspath, setHome, setJvmLauncherFactory, setJvmToLaunchContainerIn, setLogger, setSharedClasspath, setSystemProperties, startInternal, stopInternal, verify
-
Methods inherited from class org.codehaus.cargo.container.spi.AbstractLocalContainer
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.LocalContainer
getConfiguration, getFileHandler, setConfiguration, setFileHandler
-
Methods inherited from interface org.codehaus.cargo.container.internal.RunnableContainer
getOutput, getTimeout, isAppend, restart, setAppend, setOutput, setTimeout, start, stop
-
-
-
-
Field Detail
-
ID
public static final String ID
JBoss 7.x series unique id.- See Also:
- Constant Field Values
-
version
protected String version
JBoss version.
-
-
Constructor Detail
-
JBoss7xInstalledLocalContainer
public JBoss7xInstalledLocalContainer(LocalConfiguration configuration)
-
-
Method Detail
-
getId
public String getId()
-
getName
public String getName()
-
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
-
getConfigAdminDirectory
protected File getConfigAdminDirectory()
- Returns:
- Config admin directory.
-
addRuntimeArgs
protected void addRuntimeArgs(JvmLauncher java)
Add command line arguments to the java command.. As JBoss 7.x needs to have the runtime AFTER the arguments passed to the main class, we need to set the associated argument line when starting container (and not when initializing the JVM launcher).- Overrides:
addRuntimeArgsin classAbstractInstalledLocalContainer- Parameters:
java- The java command
-
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
-
executePostStartTasks
protected void executePostStartTasks() throws ExceptionSome containers may require some extra steps after startup.- Overrides:
executePostStartTasksin classAbstractLocalContainer- Throws:
Exception- if any error is raised during these executions
-
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
-
setProperties
protected void setProperties(JvmLauncher java)
Set the properties on the JVM launcher.- Parameters:
java- JVM launcher to set the properties on.
-
copyExtraClasspathJars
protected void copyExtraClasspathJars() throws IOExceptionCope extra classpath JARs.- Throws:
IOException- If creating the JARs'module.xmlfails.
-
executeScript
public void executeScript(List<ScriptCommand> configurationScript)
Writes CLI configuration script.- Specified by:
executeScriptin interfaceScriptingCapableContainer- Parameters:
configurationScript- Script containing CLI configuration to be executed.
-
executeScriptFiles
public void executeScriptFiles(List<String> scriptFilePaths)
Executes CLI scripts.- Specified by:
executeScriptFilesin interfaceScriptingCapableContainer- Parameters:
scriptFilePaths- List of file paths containing CLI scripts.
-
isOnline
public boolean isOnline()
- Returns:
- True if WildFly is started and has cargocpc deployed.
-
-