public class BrooklynWebServer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BROOKLYN_WAR_URL |
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)
|
<T> BrooklynWebServer |
configure(ConfigKey<T> key,
T value) |
org.eclipse.jetty.webapp.WebAppContext |
deploy(java.lang.String pathSpec,
java.lang.String warUrl)
serve given WAR at the given pathSpec; if not yet started, it is simply remembered until start;
if server already running, the context for this WAR is started.
|
void |
deploy(org.eclipse.jetty.webapp.WebAppContext context) |
int |
getActualPort()
returns port where this is running, or -1 if not yet known
|
java.net.InetAddress |
getAddress()
interface/address where this server is 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() |
static void |
installAsServletFilter(org.eclipse.jetty.servlet.ServletContextHandler context) |
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 |
setSecurityFilter(java.lang.Class<BrooklynPropertiesSecurityFilter> filterClazz) |
BrooklynWebServer |
setWar(java.lang.String url)
sets the WAR to use as the root context (only if server not yet started);
cf deploy("/", url)
|
void |
start()
Starts the embedded web application server.
|
void |
stop()
Asks the app server to stop and waits for it to finish up.
|
public static final java.lang.String BROOKLYN_WAR_URL
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 void setSecurityFilter(java.lang.Class<BrooklynPropertiesSecurityFilter> filterClazz)
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 setBindAddress(java.net.InetAddress address)
public BrooklynWebServer setPublicAddress(java.net.InetAddress address)
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 static void installAsServletFilter(org.eclipse.jetty.servlet.ServletContextHandler 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 warUrl)
public void deploy(org.eclipse.jetty.webapp.WebAppContext context)
public org.eclipse.jetty.server.Server getServer()
public org.eclipse.jetty.webapp.WebAppContext getRootContext()