org.gradle.api.plugins.jetty
Class AbstractJettyRunTask

java.lang.Object
  extended by org.gradle.api.internal.AbstractTask
      extended by org.gradle.api.DefaultTask
          extended by org.gradle.api.internal.ConventionTask
              extended by org.gradle.api.plugins.jetty.AbstractJettyRunTask
All Implemented Interfaces:
groovy.lang.GroovyObject, java.lang.Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, Task
Direct Known Subclasses:
AbstractJettyRunWarTask, JettyRun

public abstract class AbstractJettyRunTask
extends org.gradle.api.internal.ConventionTask


Field Summary
protected  java.lang.Thread consoleScanner
          A scanner to check ENTER hits on the console
 java.lang.String PORT_SYSPROPERTY
           
protected  java.lang.String reload
          reload can be set to either 'automatic' or 'manual'

if 'manual' then the context can be reloaded by a linefeed in the console if 'automatic' then traditional reloading on changed files is enabled.

protected  java.util.ArrayList scannerListeners
          List of Listeners for the scanner
 
Fields inherited from interface org.gradle.api.Task
AUTOSKIP_PROPERTY_PREFIX, TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
 
Constructor Summary
AbstractJettyRunTask()
           
 
Method Summary
abstract  void applyJettyXml()
           
abstract  void configureScanner()
           
 void configureWebApplication()
          Subclasses should invoke this to setup basic info on the webapp
abstract  JettyPluginServer createServer()
          create a proxy that wraps a particular jetty version Server object
 java.io.File findJettyWebXmlFile(java.io.File webInfDir)
          Try and find a jetty-web.xml file, using some historical naming conventions if necessary.
abstract  void finishConfigurationBeforeStart()
           
 java.lang.Iterable<java.io.File> getAdditionalRuntimeJars()
           
 org.mortbay.jetty.Connector[] getConnectors()
           
 java.lang.String getContextPath()
           
 java.lang.Integer getHttpPort()
           
 java.io.File getJettyConfig()
           
 java.io.File getOverrideWebXml()
           
 java.lang.String getReload()
           
 org.mortbay.jetty.RequestLog getRequestLog()
           
 int getScanIntervalSeconds()
           
 org.mortbay.util.Scanner getScanner()
           
 java.util.ArrayList getScannerListeners()
           
 JettyPluginServer getServer()
           
 java.lang.String getStopKey()
           
 java.lang.Integer getStopPort()
           
 java.io.File getTmpDirectory()
           
 org.mortbay.jetty.security.UserRealm[] getUserRealms()
           
 JettyPluginWebAppContext getWebAppConfig()
           
 java.io.File getWebDefaultXml()
           
 boolean isDaemon()
           
abstract  void restartWebApp(boolean reconfigureScanner)
           
 void setAdditionalRuntimeJars(java.lang.Iterable<java.io.File> additionalRuntimeJars)
           
 void setConnectors(org.mortbay.jetty.Connector[] connectors)
           
 void setContextPath(java.lang.String contextPath)
           
 void setDaemon(boolean daemon)
           
 void setHttpPort(java.lang.Integer httpPort)
           
 void setJettyConfig(java.io.File jettyConfig)
           
 void setOverrideWebXml(java.io.File overrideWebXml)
           
 void setReload(java.lang.String reload)
           
 void setRequestLog(org.mortbay.jetty.RequestLog requestLog)
           
 void setScanIntervalSeconds(int scanIntervalSeconds)
           
 void setScannerListeners(java.util.ArrayList listeners)
           
 void setServer(JettyPluginServer server)
           
 void setStopKey(java.lang.String stopKey)
           
 void setStopPort(java.lang.Integer stopPort)
           
 void setTmpDirectory(java.io.File tmpDirectory)
           
 void setUserRealms(org.mortbay.jetty.security.UserRealm[] userRealms)
           
 void setWebAppConfig(JettyPluginWebAppContext webAppConfig)
           
 void setWebDefaultXml(java.io.File webDefaultXml)
           
protected  void start()
           
protected  void startConsoleScanner()
          Run a thread that monitors the console input to detect ENTER hits.
 void startJetty()
           
 void startJettyInternal()
           
abstract  void validateConfiguration()
           
 
Methods inherited from class org.gradle.api.internal.ConventionTask
conventionMapping, getConventionMapping, setConventionMapping
 
Methods inherited from class org.gradle.api.DefaultTask
configure, doFirst, doLast, leftShift
 
Methods inherited from class org.gradle.api.internal.AbstractTask
captureStandardOutput, compareTo, defineProperty, deleteAllActions, dependsOn, dependsOnTaskDidWork, disableStandardOutputCapture, doFirst, doLast, equals, execute, getActions, getAdditionalProperties, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getDynamicObjectHelper, getEnabled, getExecuted, getLogger, getName, getOutput, getPath, getProject, getStandardOutputCapture, getTaskDependencies, hashCode, hasProperty, injectIntoNextInstance, isDidWork, isEnabled, isExecuted, onlyIf, onlyIf, property, setActions, setAdditionalProperties, setConvention, setDependsOn, setDescription, setDidWork, setEnabled, setExecuted, setName, setOutputHandler, setProject, setProperty, setStandardOutputCapture, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface groovy.lang.GroovyObject
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty
 

Field Detail

reload

protected java.lang.String reload
reload can be set to either 'automatic' or 'manual'

if 'manual' then the context can be reloaded by a linefeed in the console if 'automatic' then traditional reloading on changed files is enabled.


scannerListeners

protected java.util.ArrayList scannerListeners
List of Listeners for the scanner


consoleScanner

protected java.lang.Thread consoleScanner
A scanner to check ENTER hits on the console


PORT_SYSPROPERTY

public java.lang.String PORT_SYSPROPERTY
Constructor Detail

AbstractJettyRunTask

public AbstractJettyRunTask()
Method Detail

validateConfiguration

public abstract void validateConfiguration()

configureScanner

public abstract void configureScanner()

applyJettyXml

public abstract void applyJettyXml()
                            throws java.lang.Exception
Throws:
java.lang.Exception

createServer

public abstract JettyPluginServer createServer()
                                        throws java.lang.Exception
create a proxy that wraps a particular jetty version Server object

Returns:
The Jetty Plugin Server
Throws:
java.lang.Exception

finishConfigurationBeforeStart

public abstract void finishConfigurationBeforeStart()
                                             throws java.lang.Exception
Throws:
java.lang.Exception

start

protected void start()

getServer

public JettyPluginServer getServer()

setServer

public void setServer(JettyPluginServer server)

setScannerListeners

public void setScannerListeners(java.util.ArrayList listeners)

getScannerListeners

public java.util.ArrayList getScannerListeners()

getScanner

public org.mortbay.util.Scanner getScanner()

startJetty

public void startJetty()

startJettyInternal

public void startJettyInternal()

restartWebApp

public abstract void restartWebApp(boolean reconfigureScanner)
                            throws java.lang.Exception
Throws:
java.lang.Exception

configureWebApplication

public void configureWebApplication()
                             throws java.lang.Exception
Subclasses should invoke this to setup basic info on the webapp

Throws:
java.lang.Exception

startConsoleScanner

protected void startConsoleScanner()
Run a thread that monitors the console input to detect ENTER hits.


findJettyWebXmlFile

public java.io.File findJettyWebXmlFile(java.io.File webInfDir)
Try and find a jetty-web.xml file, using some historical naming conventions if necessary.

Parameters:
webInfDir -
Returns:
File object to the location of the jetty-web.xml

getTmpDirectory

public java.io.File getTmpDirectory()

setTmpDirectory

public void setTmpDirectory(java.io.File tmpDirectory)

getWebDefaultXml

public java.io.File getWebDefaultXml()

setWebDefaultXml

public void setWebDefaultXml(java.io.File webDefaultXml)

getOverrideWebXml

public java.io.File getOverrideWebXml()

setOverrideWebXml

public void setOverrideWebXml(java.io.File overrideWebXml)

getScanIntervalSeconds

public int getScanIntervalSeconds()

setScanIntervalSeconds

public void setScanIntervalSeconds(int scanIntervalSeconds)

getContextPath

public java.lang.String getContextPath()

setContextPath

public void setContextPath(java.lang.String contextPath)

getWebAppConfig

public JettyPluginWebAppContext getWebAppConfig()

setWebAppConfig

public void setWebAppConfig(JettyPluginWebAppContext webAppConfig)

getReload

public java.lang.String getReload()

setReload

public void setReload(java.lang.String reload)

getJettyConfig

public java.io.File getJettyConfig()

setJettyConfig

public void setJettyConfig(java.io.File jettyConfig)

getStopPort

public java.lang.Integer getStopPort()

setStopPort

public void setStopPort(java.lang.Integer stopPort)

getStopKey

public java.lang.String getStopKey()

setStopKey

public void setStopKey(java.lang.String stopKey)

isDaemon

public boolean isDaemon()

setDaemon

public void setDaemon(boolean daemon)

getHttpPort

public java.lang.Integer getHttpPort()

setHttpPort

public void setHttpPort(java.lang.Integer httpPort)

getConnectors

public org.mortbay.jetty.Connector[] getConnectors()

setConnectors

public void setConnectors(org.mortbay.jetty.Connector[] connectors)

getUserRealms

public org.mortbay.jetty.security.UserRealm[] getUserRealms()

setUserRealms

public void setUserRealms(org.mortbay.jetty.security.UserRealm[] userRealms)

getRequestLog

public org.mortbay.jetty.RequestLog getRequestLog()

setRequestLog

public void setRequestLog(org.mortbay.jetty.RequestLog requestLog)

getAdditionalRuntimeJars

public java.lang.Iterable<java.io.File> getAdditionalRuntimeJars()

setAdditionalRuntimeJars

public void setAdditionalRuntimeJars(java.lang.Iterable<java.io.File> additionalRuntimeJars)