|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cactus.integration.ant.container.ContainerWrapper
org.apache.cactus.integration.ant.container.GenericContainer
public final class GenericContainer
A generic container that can be nested in the
CactusTask
to support complete
customization of the container lifecycle from a build file.
Nested Class Summary | |
---|---|
class |
GenericContainer.Hook
Class that represents the nested 'startup' and 'shutdown' elements. |
Constructor Summary | |
---|---|
GenericContainer()
|
Method Summary | |
---|---|
protected org.apache.tools.ant.Task |
createAntTask(java.lang.String theName)
Creates and returns a new instance of the Ant task mapped to the specified logical name using the org.apache.cactus.integration.ant.util.AntTaskFactory set. |
GenericContainer.Hook |
createShutDown()
Creates a nested 'shutdown' element. |
GenericContainer.Hook |
createStartUp()
Creates a nested 'startup' element. |
java.lang.String |
getName()
|
int |
getPort()
Returns the port to which the container should listen. |
boolean |
isShutDownSet()
Returns whether a way to start the container has already been set, either as a target, or as a nested task container. |
boolean |
isStartUpSet()
Returns whether a way to stop the container has already been set, either as a target, or as a nested task container. |
void |
setAntTaskFactory(org.codehaus.cargo.util.AntTaskFactory theFactory)
|
void |
setName(java.lang.String theName)
Sets the name of the container for logging purposes. |
void |
setPort(int thePort)
Sets the port to which the container should listen. |
void |
setShutDownTarget(java.lang.String theShutDownTarget)
Sets the target to call to stop the server. |
void |
setStartUpTarget(java.lang.String theStartUpTarget)
Sets the target to call to start the server. |
void |
shutDown()
Shuts down the container by delegating to the shutdown hook. |
void |
startUp()
Starts up the container by delegating to the startup hook. |
Methods inherited from class org.apache.cactus.integration.ant.container.ContainerWrapper |
---|
getBaseURL, getContainerClasspath, getProtocol, getServer, getStartUpWait, getTestContext, getToDir, init, isEnabled, isExcluded, setContainer, setContainerClasspath, setLogger, setSystemProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericContainer()
Method Detail |
---|
public GenericContainer.Hook createStartUp() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
- If a startup hook has already been addedpublic GenericContainer.Hook createShutDown() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
- If a shutdown hook has already been addedpublic boolean isShutDownSet()
true
if the shut down procedure has been setpublic boolean isStartUpSet()
true
if the start up procedure has been setpublic void setName(java.lang.String theName)
theName
- The container namepublic void setPort(int thePort)
thePort
- The port to setpublic void setStartUpTarget(java.lang.String theStartUpTarget)
theStartUpTarget
- the Ant target to callpublic void setShutDownTarget(java.lang.String theShutDownTarget)
theShutDownTarget
- the Ant target to callpublic java.lang.String getName()
getName
in class ContainerWrapper
org.apache.cactus.integration.ant.container.Container#getName
public int getPort()
getPort
in class ContainerWrapper
Container#getPort()
public void startUp() throws org.apache.tools.ant.BuildException
startUp
in class ContainerWrapper
org.apache.tools.ant.BuildException
- If thrown by the startup hookContainer#startUp()
public void shutDown() throws org.apache.tools.ant.BuildException
shutDown
in class ContainerWrapper
org.apache.tools.ant.BuildException
- If thrown by the shutdown hookContainer#shutDown()
protected final org.apache.tools.ant.Task createAntTask(java.lang.String theName)
org.apache.cactus.integration.ant.util.AntTaskFactory
set.
theName
- The logical name of the task to create
AntTaskFactory.createTask(java.lang.String)
public final void setAntTaskFactory(org.codehaus.cargo.util.AntTaskFactory theFactory)
Container#setAntTaskFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |