Class AbstractWildFlyInstalledLocalContainer
- 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.wildfly.internal.AbstractWildFlyInstalledLocalContainer
-
- All Implemented Interfaces:
Container
,InstalledLocalContainer
,RunnableContainer
,SpawnedContainer
,LocalContainer
,ScriptingCapableContainer
,Loggable
- Direct Known Subclasses:
WildFly8xInstalledLocalContainer
,WildFly9xInstalledLocalContainer
public abstract class AbstractWildFlyInstalledLocalContainer extends AbstractInstalledLocalContainer implements ScriptingCapableContainer
WildFly container implementation.
-
-
Constructor Summary
Constructors Constructor Description AbstractWildFlyInstalledLocalContainer(LocalConfiguration configuration)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addRuntimeArgs(JvmLauncher java)
Add command line arguments to the java command.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.void
executeScript(List<ScriptCommand> configurationScript)
Writes CLI configuration script.void
executeScriptFiles(List<String> scriptFilePaths)
Executes CLI scripts.ContainerCapability
getCapability()
protected File
getConfigAdminDirectory()
protected abstract String
getDefaultName()
String
getName()
protected void
setProperties(JvmLauncher java)
Set the properties on the JVM launcher.protected void
waitForCompletion(boolean waitForStarting)
Ping the WAR CPC to verify if the container is started or stopped.-
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
executePostStartTasks, getConfiguration, getFileHandler, getOutput, getState, getTimeout, isAppend, restart, setAppend, setConfiguration, setFileHandler, setOutput, setState, setTimeout, start, stop, 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
-
version
protected String version
WildFly version.
-
-
Constructor Detail
-
AbstractWildFlyInstalledLocalContainer
public AbstractWildFlyInstalledLocalContainer(LocalConfiguration configuration)
-
-
Method Detail
-
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).
-
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
-
setProperties
protected void setProperties(JvmLauncher java)
Set the properties on the JVM launcher.- Parameters:
java
- JVM launcher to set the properties on.
-
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
-
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.
-
getName
public String getName()
-
getDefaultName
protected abstract String getDefaultName()
- Returns:
- Default name of the container, including the JBoss EAP version when relevant. For
example:
WildFly 10.x (JBoss EAP 7.0)
-
getConfigAdminDirectory
protected File getConfigAdminDirectory()
- Returns:
- Config admin directory.
-
addRuntimeArgs
protected void addRuntimeArgs(JvmLauncher java)
Add command line arguments to the java command.. As WildFly 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
-
waitForCompletion
protected void waitForCompletion(boolean waitForStarting) throws InterruptedException
Ping the WAR CPC to verify if the container is started or stopped.- Overrides:
waitForCompletion
in classAbstractLocalContainer
- Parameters:
waitForStarting
- iftrue
then wait for container start, iffalse
wait for container stop- Throws:
InterruptedException
- if the thread sleep is interrupted
-
-