Package org.eclipse.jetty.ant
Class ServerProxyImpl
- java.lang.Object
-
- org.eclipse.jetty.ant.ServerProxyImpl
-
- All Implemented Interfaces:
ServerProxy
public class ServerProxyImpl extends java.lang.Object implements ServerProxy
A proxy class for interaction with Jetty server object. Used to have some level of abstraction over standard Jetty classes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServerProxyImpl.WebAppScannerListenerWebAppScannerListener Handle notifications that files we are interested in have changed during execution.
-
Field Summary
Fields Modifier and Type Field Description private booleanconfiguredprivate java.util.List<Connector>connectorsList of connectors.private ContextHandlerscontextHandlersother contexts to deployprivate ContextHandlerCollectioncontextsCollection of context handlers (web application contexts).private booleandaemonwait for all jetty threads to exit or continueprivate java.io.FilejettyXmlLocation of jetty.xml file.private java.util.List<LoginService>loginServicesUser realms.private RequestLogrequestLogRequest logger.private intscanIntervalSecsscan interval for changed filesprivate ServerserverProxied Jetty server object.private java.lang.StringstopKeysecurity key for stop commandprivate intstopPortport to listen for stop commandprivate java.io.FiletempDirectoryTemporary files directory.private java.util.List<AntWebAppContext>webApplicationsList of added web applications.
-
Constructor Summary
Constructors Constructor Description ServerProxyImpl()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWebApplication(AntWebAppContext webApp)Adds a new web application to this server.private voidapplyJettyXml()Applies jetty.xml configuration to the Jetty server instance.private voidconfigure()Configures Jetty server before adding any web applications to it.private voidconfigureHandlers()private voidconfigureWebApps()java.util.List<Connector>getConnectors()ContextHandlersgetContextHandlers()java.io.FilegetJettyXml()java.util.List<LoginService>getLoginServices()java.lang.ObjectgetProxiedObject()RequestLoggetRequestLog()intgetScanIntervalSecs()java.lang.StringgetStopKey()intgetStopPort()java.io.FilegetTempDirectory()java.util.List<AntWebAppContext>getWebApplications()booleanisDaemon()voidsetConnectors(java.util.List<Connector> connectors)voidsetContextHandlers(ContextHandlers contextHandlers)voidsetDaemon(boolean daemon)voidsetJettyXml(java.io.File jettyXml)voidsetLoginServices(java.util.List<LoginService> loginServices)voidsetRequestLog(RequestLog requestLog)voidsetScanIntervalSecs(int scanIntervalSecs)voidsetStopKey(java.lang.String stopKey)voidsetStopPort(int stopPort)voidsetTempDirectory(java.io.File tempDirectory)voidsetWebApplications(java.util.List<AntWebAppContext> webApplications)voidstart()Starts this server.private voidstartScanners()Starts web applications' scanners.
-
-
-
Field Detail
-
server
private Server server
Proxied Jetty server object.
-
tempDirectory
private java.io.File tempDirectory
Temporary files directory.
-
contexts
private ContextHandlerCollection contexts
Collection of context handlers (web application contexts).
-
jettyXml
private java.io.File jettyXml
Location of jetty.xml file.
-
connectors
private java.util.List<Connector> connectors
List of connectors.
-
requestLog
private RequestLog requestLog
Request logger.
-
loginServices
private java.util.List<LoginService> loginServices
User realms.
-
webApplications
private java.util.List<AntWebAppContext> webApplications
List of added web applications.
-
contextHandlers
private ContextHandlers contextHandlers
other contexts to deploy
-
scanIntervalSecs
private int scanIntervalSecs
scan interval for changed files
-
stopPort
private int stopPort
port to listen for stop command
-
stopKey
private java.lang.String stopKey
security key for stop command
-
daemon
private boolean daemon
wait for all jetty threads to exit or continue
-
configured
private boolean configured
-
-
Method Detail
-
addWebApplication
public void addWebApplication(AntWebAppContext webApp)
Description copied from interface:ServerProxyAdds a new web application to this server.- Specified by:
addWebApplicationin interfaceServerProxy- Parameters:
webApp- a AntWebAppContext object.
-
getStopPort
public int getStopPort()
-
setStopPort
public void setStopPort(int stopPort)
-
getStopKey
public java.lang.String getStopKey()
-
setStopKey
public void setStopKey(java.lang.String stopKey)
-
getJettyXml
public java.io.File getJettyXml()
-
setJettyXml
public void setJettyXml(java.io.File jettyXml)
-
getConnectors
public java.util.List<Connector> getConnectors()
-
setConnectors
public void setConnectors(java.util.List<Connector> connectors)
-
getRequestLog
public RequestLog getRequestLog()
-
setRequestLog
public void setRequestLog(RequestLog requestLog)
-
getLoginServices
public java.util.List<LoginService> getLoginServices()
-
setLoginServices
public void setLoginServices(java.util.List<LoginService> loginServices)
-
getWebApplications
public java.util.List<AntWebAppContext> getWebApplications()
-
setWebApplications
public void setWebApplications(java.util.List<AntWebAppContext> webApplications)
-
getTempDirectory
public java.io.File getTempDirectory()
-
setTempDirectory
public void setTempDirectory(java.io.File tempDirectory)
-
start
public void start()
Description copied from interface:ServerProxyStarts this server.- Specified by:
startin interfaceServerProxy- See Also:
ServerProxy.start()
-
getProxiedObject
public java.lang.Object getProxiedObject()
- Specified by:
getProxiedObjectin interfaceServerProxy- See Also:
ServerProxy.getProxiedObject()
-
isDaemon
public boolean isDaemon()
- Returns:
- the daemon
-
setDaemon
public void setDaemon(boolean daemon)
- Parameters:
daemon- the daemon to set
-
getContextHandlers
public ContextHandlers getContextHandlers()
- Returns:
- the contextHandlers
-
setContextHandlers
public void setContextHandlers(ContextHandlers contextHandlers)
- Parameters:
contextHandlers- the contextHandlers to set
-
getScanIntervalSecs
public int getScanIntervalSecs()
-
setScanIntervalSecs
public void setScanIntervalSecs(int scanIntervalSecs)
-
configure
private void configure()
Configures Jetty server before adding any web applications to it.
-
configureHandlers
private void configureHandlers()
-
applyJettyXml
private void applyJettyXml()
Applies jetty.xml configuration to the Jetty server instance.
-
startScanners
private void startScanners() throws java.lang.ExceptionStarts web applications' scanners.- Throws:
java.lang.Exception
-
configureWebApps
private void configureWebApps()
-
-