Package org.eclipse.jetty.ant
Class JettyRunTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.eclipse.jetty.ant.JettyRunTask
-
- All Implemented Interfaces:
java.lang.Cloneable
public class JettyRunTask extends org.apache.tools.ant.Task
Ant task for running a Jetty server.
-
-
Field Summary
Fields Modifier and Type Field Description private Connectors
connectors
List of server connectors.private ContextHandlers
contextHandlers
List of other contexts to deployprivate boolean
daemon
private int
jettyPort
Port Jetty will use for the default connectorprivate java.io.File
jettyXml
Location of jetty.xml file.private LoginServices
loginServices
List of login services.private RequestLog
requestLog
Server request logger object.private int
scanIntervalSeconds
private java.lang.String
stopKey
private int
stopPort
private SystemProperties
systemProperties
List of system properties to be set.private java.io.File
tempDirectory
Temporary files directory.private java.util.List<AntWebAppContext>
webapps
List of web applications to be deployed.
-
Constructor Summary
Constructors Constructor Description JettyRunTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConnectors(Connectors connectors)
Adds a new Ant's connector tag object if it have not been created yet.void
addContextHandlers(ContextHandlers handlers)
void
addLoginServices(LoginServices services)
void
addSystemProperties(SystemProperties systemProperties)
void
addWebApp(AntWebAppContext webapp)
Creates a newWebApp
Ant object.void
execute()
Executes this Ant task.java.io.File
getJettyXml()
java.lang.String
getRequestLog()
int
getScanIntervalSeconds()
java.lang.String
getStopKey()
int
getStopPort()
java.io.File
getTempDirectory()
boolean
isDaemon()
void
setDaemon(boolean daemon)
void
setJettyPort(int jettyPort)
Sets the port Jetty uses for the default connector.void
setJettyXml(java.io.File jettyXml)
void
setRequestLog(java.lang.String className)
void
setScanIntervalSeconds(int secs)
void
setStopKey(java.lang.String stopKey)
void
setStopPort(int stopPort)
private void
setSystemProperties()
Sets the system properties.void
setTempDirectory(java.io.File tempDirectory)
-
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
-
-
-
-
Field Detail
-
scanIntervalSeconds
private int scanIntervalSeconds
-
tempDirectory
private java.io.File tempDirectory
Temporary files directory.
-
webapps
private java.util.List<AntWebAppContext> webapps
List of web applications to be deployed.
-
jettyXml
private java.io.File jettyXml
Location of jetty.xml file.
-
connectors
private Connectors connectors
List of server connectors.
-
requestLog
private RequestLog requestLog
Server request logger object.
-
loginServices
private LoginServices loginServices
List of login services.
-
systemProperties
private SystemProperties systemProperties
List of system properties to be set.
-
contextHandlers
private ContextHandlers contextHandlers
List of other contexts to deploy
-
jettyPort
private int jettyPort
Port Jetty will use for the default connector
-
stopPort
private int stopPort
-
stopKey
private java.lang.String stopKey
-
daemon
private boolean daemon
-
-
Method Detail
-
addWebApp
public void addWebApp(AntWebAppContext webapp)
Creates a newWebApp
Ant object.- Parameters:
webapp
- the webapp context
-
addConnectors
public void addConnectors(Connectors connectors)
Adds a new Ant's connector tag object if it have not been created yet.- Parameters:
connectors
- the connectors
-
addLoginServices
public void addLoginServices(LoginServices services)
-
addSystemProperties
public void addSystemProperties(SystemProperties systemProperties)
-
addContextHandlers
public void addContextHandlers(ContextHandlers handlers)
-
getTempDirectory
public java.io.File getTempDirectory()
-
setTempDirectory
public void setTempDirectory(java.io.File tempDirectory)
-
getJettyXml
public java.io.File getJettyXml()
-
setJettyXml
public void setJettyXml(java.io.File jettyXml)
-
setRequestLog
public void setRequestLog(java.lang.String className)
-
getRequestLog
public java.lang.String getRequestLog()
-
setJettyPort
public void setJettyPort(int jettyPort)
Sets the port Jetty uses for the default connector.- Parameters:
jettyPort
- The port Jetty will use for the default connector
-
execute
public void execute() throws org.apache.tools.ant.BuildException
Executes this Ant task. The build flow is being stopped until Jetty server stops.- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
- if unable to build
-
getStopPort
public int getStopPort()
-
setStopPort
public void setStopPort(int stopPort)
-
getStopKey
public java.lang.String getStopKey()
-
setStopKey
public void setStopKey(java.lang.String stopKey)
-
isDaemon
public boolean isDaemon()
- Returns:
- the daemon
-
setDaemon
public void setDaemon(boolean daemon)
- Parameters:
daemon
- the daemon to set
-
getScanIntervalSeconds
public int getScanIntervalSeconds()
-
setScanIntervalSeconds
public void setScanIntervalSeconds(int secs)
-
setSystemProperties
private void setSystemProperties()
Sets the system properties.
-
-