Package com.google.gwt.core.ext
Class ServletContainerLauncher
java.lang.Object
com.google.gwt.core.ext.ServletContainerLauncher
Defines the service provider interface for launching servlet containers that
can be used by the GWT development mode.
Subclasses should be careful about calling any methods defined on this class or else they risk failing when used with a version of GWT that did not have those methods.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getName()
boolean
isSecure()
Return true if this servlet container launcher is configured for secure operation (ie, HTTPS).boolean
processArguments
(TreeLogger logger, String arguments) Process any supplied arguments.void
setBindAddress
(String bindAddress) Set the bind address for the web server socket.abstract ServletContainer
start
(TreeLogger logger, int port, File appRootDir) Start an embedded HTTP servlet container.
-
Constructor Details
-
ServletContainerLauncher
public ServletContainerLauncher()
-
-
Method Details
-
getIconBytes
public byte[] getIconBytes()- Returns:
- byte array containing an icon (fitting into 24x24) to use for the server, or null if only the name should be used
-
getName
- Returns:
- a short human-readable name of this servlet container, or null if no name should be displayed.
-
isSecure
public boolean isSecure()Return true if this servlet container launcher is configured for secure operation (ie, HTTPS). This value is only queried after arguments, if any, have been processed. The default implementation just returns false.- Returns:
- true if HTTPS is in use
-
processArguments
Process any supplied arguments.Will be called before
start(TreeLogger, int, File)
, if at all.- Parameters:
logger
- logger to use for warnings/errorsarguments
- single string containing the arguments for this SCL, the format to be defined by the SCL- Returns:
- true if the arguments were processed successfully
-
setBindAddress
Set the bind address for the web server socket.Will be called before
start(TreeLogger, int, File)
, if at all. If not called, the SCL should listen on all addresses.- Parameters:
bindAddress
- host name or IP address, suitable for use withInetAddress.getByName(String)
-
start
public abstract ServletContainer start(TreeLogger logger, int port, File appRootDir) throws BindException, Exception Start an embedded HTTP servlet container.- Parameters:
logger
- the server loggerport
- the TCP port to serve on; if 0 is requested, a port should be automatically selectedappRootDir
- the base WAR directory- Returns:
- the launched servlet container
- Throws:
BindException
- if the requested port is already in useException
- if the server fails to start for any other reason
-