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 void
addRuntimeArgs(JvmLauncher java)
Add command line arguments to the java command.protected void
copyExtraClasspathJars()
Cope extra classpath JARs.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.protected void
executePostStartTasks()
Some containers may require some extra steps after startup.void
executeScript(List<ScriptCommand> configurationScript)
Writes CLI configuration script.void
executeScriptFiles(List<String> scriptFilePaths)
Executes CLI scripts.ContainerCapability
getCapability()
protected File
getConfigAdminDirectory()
String
getId()
String
getName()
protected String
getVersion(String defaultVersion)
Parse installed JBoss version.boolean
isOnline()
protected void
setProperties(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:
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
-
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:
addRuntimeArgs
in 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:
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
-
executePostStartTasks
protected void executePostStartTasks() throws Exception
Some containers may require some extra steps after startup.- Overrides:
executePostStartTasks
in 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:
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
-
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 IOException
Cope extra classpath JARs.- Throws:
IOException
- If creating the JARs'module.xml
fails.
-
executeScript
public void executeScript(List<ScriptCommand> configurationScript)
Writes CLI configuration script.- Specified by:
executeScript
in interfaceScriptingCapableContainer
- Parameters:
configurationScript
- Script containing CLI configuration to be executed.
-
executeScriptFiles
public void executeScriptFiles(List<String> scriptFilePaths)
Executes CLI scripts.- Specified by:
executeScriptFiles
in interfaceScriptingCapableContainer
- Parameters:
scriptFilePaths
- List of file paths containing CLI scripts.
-
isOnline
public boolean isOnline()
- Returns:
- True if WildFly is started and has cargocpc deployed.
-
-