public class BrooklynWebServer
extends java.lang.Object
Constructor and Description |
---|
BrooklynWebServer(ManagementContext managementContext) |
BrooklynWebServer(ManagementContext managementContext,
int port) |
BrooklynWebServer(ManagementContext managementContext,
int port,
java.lang.String warUrl) |
BrooklynWebServer(java.util.Map<?,?> flags,
ManagementContext managementContext)
accepts flags: port,
war (url of war file which is the root),
wars (map of context-prefix to url),
attrs (map of attribute-name : object pairs passed to the servlet)
|
Modifier and Type | Method and Description |
---|---|
BrooklynWebServer |
addAttribute(java.lang.String field,
java.lang.Object value)
Deprecated.
use setAttribute
|
BrooklynWebServer |
addWar(java.lang.String path,
java.lang.String warUrl)
specifies a WAR to use at a given context path (only if server not yet started);
cf deploy(path, url)
|
BrooklynWebServer |
addWar(WebAppContextProvider contextProvider) |
<T> BrooklynWebServer |
configure(ConfigKey<T> key,
T value) |
org.eclipse.jetty.webapp.WebAppContext |
deploy(java.lang.String pathSpec,
java.lang.String war) |
void |
deploy(org.eclipse.jetty.webapp.WebAppContext context) |
org.eclipse.jetty.webapp.WebAppContext |
deploy(WebAppContextProvider contextProvider)
Serve the given WAR at the given pathSpec.
|
int |
getActualPort()
returns port where this is running, or -1 if not yet known
|
java.net.InetAddress |
getAddress()
interface/address where this server is or will be listening;
if bound to 0.0.0.0 (all NICs, e.g.
|
boolean |
getHttpsEnabled() |
PortRange |
getRequestedPort() |
org.eclipse.jetty.webapp.WebAppContext |
getRootContext() |
java.lang.String |
getRootUrl()
URL for accessing this web server (root context)
|
org.eclipse.jetty.server.Server |
getServer() |
BrooklynWebServer |
putAttributes(java.util.Map newAttrs)
Specifies attributes passed to deployed webapps
(in addition to
BrooklynServiceAttributes.BROOKLYN_MANAGEMENT_CONTEXT |
BrooklynWebServer |
setAttribute(java.lang.String field,
java.lang.Object value)
Specifies an attribute passed to deployed webapps
(in addition to
BrooklynServiceAttributes.BROOKLYN_MANAGEMENT_CONTEXT |
BrooklynWebServer |
setBindAddress(java.net.InetAddress address)
InetAddress to which server should bind;
defaults to 0.0.0.0 (although common call path is to set to 127.0.0.1 when security is not set)
|
BrooklynWebServer |
setHttpsEnabled(java.lang.Boolean httpsEnabled) |
BrooklynWebServer |
setPort(java.lang.Object port) |
BrooklynWebServer |
setPublicAddress(java.net.InetAddress address)
Sets the public address that the server's management context's REST API will be available on
|
void |
setShutdownHandler(ShutdownHandler shutdownHandler) |
BrooklynWebServer |
setWar(java.lang.String url)
sets the WAR to use as the root context (only if server not yet started);
cf deploy("/", url)
|
BrooklynWebServer |
skipSecurity() |
BrooklynWebServer |
skipSecurity(boolean skipSecurity) |
void |
start()
Starts the embedded web application server.
|
void |
stop()
Asks the app server to stop and waits for it to finish up.
|
public BrooklynWebServer(ManagementContext managementContext)
public BrooklynWebServer(java.util.Map<?,?> flags, ManagementContext managementContext)
public BrooklynWebServer(ManagementContext managementContext, int port)
public BrooklynWebServer(ManagementContext managementContext, int port, java.lang.String warUrl)
public BrooklynWebServer skipSecurity()
public BrooklynWebServer skipSecurity(boolean skipSecurity)
public void setShutdownHandler(@Nullable ShutdownHandler shutdownHandler)
public BrooklynWebServer setPort(java.lang.Object port)
public BrooklynWebServer setHttpsEnabled(java.lang.Boolean httpsEnabled)
public boolean getHttpsEnabled()
public PortRange getRequestedPort()
public int getActualPort()
public java.net.InetAddress getAddress()
public java.lang.String getRootUrl()
public BrooklynWebServer setWar(java.lang.String url)
public BrooklynWebServer addWar(java.lang.String path, java.lang.String warUrl)
public BrooklynWebServer addWar(WebAppContextProvider contextProvider)
public BrooklynWebServer setBindAddress(java.net.InetAddress address)
public BrooklynWebServer setPublicAddress(java.net.InetAddress address)
@Deprecated public BrooklynWebServer addAttribute(java.lang.String field, java.lang.Object value)
public BrooklynWebServer setAttribute(java.lang.String field, java.lang.Object value)
BrooklynServiceAttributes.BROOKLYN_MANAGEMENT_CONTEXT
public <T> BrooklynWebServer configure(ConfigKey<T> key, T value)
public BrooklynWebServer putAttributes(java.util.Map newAttrs)
BrooklynServiceAttributes.BROOKLYN_MANAGEMENT_CONTEXT
public void start() throws java.lang.Exception
java.lang.Exception
public void stop() throws java.lang.Exception
java.lang.Exception
public org.eclipse.jetty.webapp.WebAppContext deploy(java.lang.String pathSpec, java.lang.String war)
public org.eclipse.jetty.webapp.WebAppContext deploy(WebAppContextProvider contextProvider)
public void deploy(org.eclipse.jetty.webapp.WebAppContext context)
public org.eclipse.jetty.server.Server getServer()
public org.eclipse.jetty.webapp.WebAppContext getRootContext()