Brooklyn

brooklyn.launcher
[Java] Class BrooklynWebServer

java.lang.Object
  brooklyn.launcher.BrooklynWebServer

public class BrooklynWebServer

Starts the web-app running, connected to the given management context


Field Summary
static java.lang.String BROOKLYN_WAR_URL

protected int actualPort

protected PortRange httpsPort

protected PortRange port

protected Server server

protected java.lang.String war

 
Constructor Summary
BrooklynWebServer(ManagementContext managementContext)

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)

BrooklynWebServer(ManagementContext managementContext, int port)

BrooklynWebServer(ManagementContext managementContext, int port, java.lang.String warUrl)

 
Method Summary
BrooklynWebServer addAttribute(java.lang.String field, java.lang.Object value)

@deprecated use setAttribute

protected void addShutdownHook()

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)

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(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 binds

PortRange getRequestedPort()

java.lang.String getRootUrl()

URL for accessing this web server (root context)

Server getServer()

BrooklynWebServer putAttributes(java.util.Map newAttrs)

Specifies attributes passed to deployed webapps (in addition to BrooklynServiceAttributes#BROOKLYN_MANAGEMENT_CONTEXT#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#BROOKLYN_MANAGEMENT_CONTEXT

BrooklynWebServer setPort(java.lang.Object port)

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.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

BROOKLYN_WAR_URL

public static final java.lang.String BROOKLYN_WAR_URL


actualPort

protected int actualPort


httpsPort

@SetFromFlag
protected PortRange httpsPort


port

@SetFromFlag
protected PortRange port


server

protected Server server


war

@SetFromFlag
protected java.lang.String war


 
Constructor Detail

BrooklynWebServer

public BrooklynWebServer(ManagementContext managementContext)


BrooklynWebServer

public 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)


BrooklynWebServer

public BrooklynWebServer(ManagementContext managementContext, int port)


BrooklynWebServer

public BrooklynWebServer(ManagementContext managementContext, int port, java.lang.String warUrl)


 
Method Detail

addAttribute

public BrooklynWebServer addAttribute(java.lang.String field, java.lang.Object value)
deprecated:
use setAttribute


addShutdownHook

protected void addShutdownHook()


addWar

public 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)


deploy

public 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.
Returns:
the context created and added as a handler (and possibly already started if server is started, so be careful with any changes you make to it!)


deploy

public void deploy(WebAppContext context)


getActualPort

public int getActualPort()
returns port where this is running, or -1 if not yet known


getAddress

public java.net.InetAddress getAddress()
interface/address where this server binds


getRequestedPort

public PortRange getRequestedPort()


getRootUrl

public java.lang.String getRootUrl()
URL for accessing this web server (root context)


getServer

public Server getServer()


putAttributes

public BrooklynWebServer putAttributes(java.util.Map newAttrs)
Specifies attributes passed to deployed webapps (in addition to BrooklynServiceAttributes#BROOKLYN_MANAGEMENT_CONTEXT#BROOKLYN_MANAGEMENT_CONTEXT


setAttribute

public BrooklynWebServer setAttribute(java.lang.String field, java.lang.Object value)
Specifies an attribute passed to deployed webapps (in addition to BrooklynServiceAttributes#BROOKLYN_MANAGEMENT_CONTEXT#BROOKLYN_MANAGEMENT_CONTEXT


setPort

public BrooklynWebServer setPort(java.lang.Object port)


setWar

public BrooklynWebServer setWar(java.lang.String url)
sets the WAR to use as the root context (only if server not yet started); cf deploy("/", url)


start

public void start()
Starts the embedded web application server.


stop

public void stop()
Asks the app server to stop and waits for it to finish up.


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.