|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.codehaus.cargo.ant.CargoTask
public class CargoTask
Ant task wrapper around the Cargo API to start/stop containers. This task is generic and can be
used with any container implementation that implements the Container
interface (either
the implementations provided by Cargo or your own ones).
Field Summary |
---|
Fields inherited from class org.apache.tools.ant.Task |
---|
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
CargoTask()
|
Method Summary | |
---|---|
void |
addConfiguredSysproperty(org.apache.tools.ant.types.Environment.Variable property)
Called by Ant when the Variable object has been properly initialized. |
void |
addConfiguredSyspropertyset(PropertySet propertySet)
Adds a set of properties that will be used as system properties in the executing container VM. |
void |
addSysproperty(org.apache.tools.ant.types.Environment.Variable property)
Adds a system property that will be set up in the executing container VM. |
ConfigurationElement |
createConfiguration()
|
org.apache.tools.ant.types.Path |
createExtraClasspath()
Adds extra classpath that will be used for starting the container. |
org.apache.tools.ant.types.Path |
createSharedClasspath()
Adds shared classpath that will be shared by container applications. |
ZipURLInstallerElement |
createZipURLInstaller()
|
void |
execute()
|
protected void |
executeActions()
Execute the action specified by the user. |
protected java.lang.String |
getAction()
|
protected ConfigurationElement |
getConfiguration()
|
protected Container |
getContainer()
|
protected java.lang.Class |
getContainerClass()
|
protected java.lang.String |
getContainerId()
|
protected org.apache.tools.ant.types.Path |
getExtraClasspath()
|
protected java.lang.String |
getHome()
|
protected java.lang.String |
getId()
|
protected java.io.File |
getLog()
|
protected Logger |
getLogger()
|
protected LogLevel |
getLogLevel()
|
protected java.lang.String |
getOutput()
|
protected org.apache.tools.ant.types.Reference |
getRefid()
|
protected org.apache.tools.ant.types.Path |
getSharedClasspath()
|
protected java.util.Map |
getSystemProperties()
|
protected long |
getTimeout()
|
boolean |
getWait()
|
protected ZipURLInstallerElement |
getZipURLInstaller()
|
protected boolean |
isAppend()
|
protected Container |
makeContainer()
|
void |
setAction(java.lang.String action)
Sets the action to execute (either "start" or "stop"). |
void |
setAppend(boolean isAppend)
|
void |
setClass(java.lang.Class containerClass)
|
void |
setContainerFactory(ContainerFactory containerFactory)
|
void |
setContainerId(java.lang.String containerId)
|
void |
setHint(java.lang.String hint)
Deprecated. see setType(ContainerType) |
void |
setHome(java.lang.String home)
Sets the home dir. |
void |
setId(java.lang.String id)
|
void |
setLog(java.io.File log)
|
void |
setLogLevel(java.lang.String logLevel)
|
void |
setOutput(java.lang.String output)
|
void |
setRefId(org.apache.tools.ant.types.Reference refid)
|
void |
setTimeout(long timeout)
|
void |
setType(ContainerType type)
|
protected void |
setupExtraClasspath()
Set up extra classpaths if defined. |
protected void |
setupHome()
Set up a home dir (possibly using a ZipURLInstaller). |
protected void |
setupLogger()
Set up a logger for the container. |
protected void |
setupOutput()
Set up an output file containing container's console output if defined. |
protected void |
setupSharedClasspath()
Set up shared classpath if defined. |
protected void |
setupSystemProperties()
Set up system properties if defined. |
protected void |
setupTimeout()
Set up a timeout if defined. |
void |
setWait(boolean wait)
|
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CargoTask()
Method Detail |
---|
public void setWait(boolean wait)
wait
- if true wait indefinitely after the container is started, if false return the
execution flow to the userpublic boolean getWait()
public final void setClass(java.lang.Class containerClass)
containerClass
- the container implementation class to useprotected final java.lang.Class getContainerClass()
setClass(Class)
public void setAction(java.lang.String action)
action
- the action that will be executed by this taskpublic void setContainerId(java.lang.String containerId)
containerId
- the container idpublic void setType(ContainerType type)
type
- the container's type (e.g. "installed", "embedded" or "remote")public void setHint(java.lang.String hint)
setType(ContainerType)
hint
- the container's type (e.g. "installed", "embedded" or "remote")public final void setHome(java.lang.String home)
home
- home dir to set.public final void setId(java.lang.String id)
id
- the Ant property name that will contain the container instance referencepublic final void setRefId(org.apache.tools.ant.types.Reference refid)
refid
- the Ant property name that contains an existing container instance referencepublic final ZipURLInstallerElement createZipURLInstaller()
ZipURLInstallerElement
elementpublic final ConfigurationElement createConfiguration()
ConfigurationElement
elementpublic final void setOutput(java.lang.String output)
RunnableContainer.setOutput(String)
public final void setLog(java.io.File log)
LoggedObject.setLogger(Logger)
public void setLogLevel(java.lang.String logLevel)
AbstractLogger.setLevel(org.codehaus.cargo.util.log.LogLevel)
public final void setAppend(boolean isAppend)
RunnableContainer.setAppend(boolean)
public void setTimeout(long timeout)
RunnableContainer.setTimeout(long)
public org.apache.tools.ant.types.Path createExtraClasspath()
public org.apache.tools.ant.types.Path createSharedClasspath()
public void addSysproperty(org.apache.tools.ant.types.Environment.Variable property)
property
- the system property to addpublic void addConfiguredSyspropertyset(PropertySet propertySet)
propertySet
- Ant element defining the property setpublic void addConfiguredSysproperty(org.apache.tools.ant.types.Environment.Variable property)
property
- the system property to setpublic void execute()
execute
in class org.apache.tools.ant.Task
Task.execute()
protected void executeActions()
protected void setupLogger()
protected void setupOutput()
protected void setupTimeout()
protected void setupHome()
protected void setupExtraClasspath()
protected void setupSharedClasspath()
protected void setupSystemProperties()
protected final java.util.Map getSystemProperties()
addSysproperty(Environment.Variable)
protected final ZipURLInstallerElement getZipURLInstaller()
createZipURLInstaller()
protected final ConfigurationElement getConfiguration()
createConfiguration()
protected final org.apache.tools.ant.types.Path getExtraClasspath()
createExtraClasspath()
protected final org.apache.tools.ant.types.Path getSharedClasspath()
createSharedClasspath()
protected final long getTimeout()
getTimeout()
protected final java.lang.String getOutput()
setOutput(String)
protected final java.io.File getLog()
setLog(File)
protected LogLevel getLogLevel()
setLogLevel(String)
protected final java.lang.String getHome()
setHome(String)
protected final boolean isAppend()
setAppend(boolean)
protected final java.lang.String getAction()
protected Container makeContainer()
protected java.lang.String getContainerId()
setContainerId(String)
protected java.lang.String getId()
setId(String)
protected org.apache.tools.ant.types.Reference getRefid()
setRefId(Reference)
public void setContainerFactory(ContainerFactory containerFactory)
containerFactory
- the new container factory to useprotected Container getContainer()
execute()
protected Logger getLogger()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |