Package org.eclipse.jetty.ant
Class ServerProxyImpl
java.lang.Object
org.eclipse.jetty.ant.ServerProxyImpl
- All Implemented Interfaces:
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 ClassesModifier and TypeClassDescriptionstatic class
WebAppScannerListener Handle notifications that files we are interested in have changed during execution. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
List of connectors.private ContextHandlers
other contexts to deployprivate ContextHandlerCollection
Collection of context handlers (web application contexts).private boolean
wait for all jetty threads to exit or continueprivate File
Location of jetty.xml file.private List<LoginService>
User realms.private RequestLog
Request logger.private int
scan interval for changed filesprivate Server
Proxied Jetty server object.private String
security key for stop commandprivate int
port to listen for stop commandprivate File
Temporary files directory.private List<AntWebAppContext>
List of added web applications. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addWebApplication
(AntWebAppContext webApp) Adds a new web application to this server.private void
Applies jetty.xml configuration to the Jetty server instance.private void
Configures Jetty server before adding any web applications to it.private void
private void
int
int
boolean
isDaemon()
void
setConnectors
(List<Connector> connectors) void
setContextHandlers
(ContextHandlers contextHandlers) void
setDaemon
(boolean daemon) void
setJettyXml
(File jettyXml) void
setLoginServices
(List<LoginService> loginServices) void
setRequestLog
(RequestLog requestLog) void
setScanIntervalSecs
(int scanIntervalSecs) void
setStopKey
(String stopKey) void
setStopPort
(int stopPort) void
setTempDirectory
(File tempDirectory) void
setWebApplications
(List<AntWebAppContext> webApplications) void
start()
Starts this server.private void
Starts web applications' scanners.
-
Field Details
-
server
Proxied Jetty server object. -
tempDirectory
Temporary files directory. -
contexts
Collection of context handlers (web application contexts). -
jettyXml
Location of jetty.xml file. -
connectors
List of connectors. -
requestLog
Request logger. -
loginServices
User realms. -
webApplications
List of added web applications. -
contextHandlers
other contexts to deploy -
scanIntervalSecs
private int scanIntervalSecsscan interval for changed files -
stopPort
private int stopPortport to listen for stop command -
stopKey
security key for stop command -
daemon
private boolean daemonwait for all jetty threads to exit or continue -
configured
private boolean configured
-
-
Constructor Details
-
ServerProxyImpl
public ServerProxyImpl()Default constructor. Creates a new Jetty server with a standard connector listening on a given port.
-
-
Method Details
-
addWebApplication
Description copied from interface:ServerProxy
Adds a new web application to this server.- Specified by:
addWebApplication
in interfaceServerProxy
- Parameters:
webApp
- a AntWebAppContext object.
-
getStopPort
public int getStopPort() -
setStopPort
public void setStopPort(int stopPort) -
getStopKey
-
setStopKey
-
getJettyXml
-
setJettyXml
-
getConnectors
-
setConnectors
-
getRequestLog
-
setRequestLog
-
getLoginServices
-
setLoginServices
-
getWebApplications
-
setWebApplications
-
getTempDirectory
-
setTempDirectory
-
start
public void start()Description copied from interface:ServerProxy
Starts this server.- Specified by:
start
in interfaceServerProxy
- See Also:
-
getProxiedObject
- Specified by:
getProxiedObject
in interfaceServerProxy
- See Also:
-
isDaemon
public boolean isDaemon()- Returns:
- the daemon
-
setDaemon
public void setDaemon(boolean daemon) - Parameters:
daemon
- the daemon to set
-
getContextHandlers
- Returns:
- the contextHandlers
-
setContextHandlers
- 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
Starts web applications' scanners.- Throws:
Exception
-
configureWebApps
private void configureWebApps()
-