Brooklyn

brooklyn.launcher
[Java] Class BrooklynLauncher

java.lang.Object
  brooklyn.launcher.BrooklynLauncher

public class BrooklynLauncher

Example usage is: *

 {
code:
BrooklynLauncher launcher = BrooklynLauncher.newInstance() .application(new WebClusterDatabaseExample().appDisplayName("Web-cluster example")) .location("localhost") .start(); Entities.dumpInfo(launcher.getApplications());


Method Summary
BrooklynLauncher application(Application app)

Specifies that the launcher should manage the given Brooklyn application.

BrooklynLauncher application(ApplicationBuilder appBuilder)

Specifies that the launcher should build and manage the given Brooklyn application.

BrooklynLauncher application(EntitySpec appSpec)

Specifies that the launcher should build and manage the Brooklyn application described by the given spec.

BrooklynLauncher bindAddress(java.net.InetAddress bindAddress)

Specifies the NIC where the web console (and any additional webapps specified) will be bound; default 0.0.0.0, unless no security is specified (e.g. users) in which case it is localhost.

BrooklynLauncher brooklynProperties(BrooklynProperties brooklynProperties)

Specifies the brooklyn properties to be used.

BrooklynLauncher brooklynProperties(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

protected BrooklynLauncher doLaunch()

For backwards compatibility, to implement launch(); will be deleted when that deprecated code is deleted.

java.util.List getApplications()

BrooklynServerDetails getServerDetails()

BrooklynLauncher globalBrooklynPropertiesFile(java.lang.String file)

BrooklynLauncher installSecurityFilter(java.lang.Boolean val)

BrooklynServerDetails launch()

BrooklynLauncher localBrooklynPropertiesFile(java.lang.String file)

BrooklynLauncher location(Location location)

Adds a location to be passed in on start(), when that calls application.start(locations).

BrooklynLauncher location(java.lang.String spec)

Give the spec of an application, to be created.

BrooklynLauncher locations(java.util.List specs)

static ManagementContext manage(AbstractApplication app)

Launches the web console on port 8081, and a Brooklyn application, with a single command, in such a way that the web console is launched and the application is shutdown on server termination.

static ManagementContext manage(AbstractApplication app, int port)

static ManagementContext manage(AbstractApplication app, int port, boolean shutdownApp, boolean startWebConsole)

BrooklynLauncher management(ManagementContext context)

BrooklynLauncher managementContext(ManagementContext context)

Specifies the management context this launcher should use.

BrooklynLauncher managing(Application app)

BrooklynLauncher managing(ApplicationBuilder app)

static BrooklynLauncher newInstance()

Creates a configurable (fluent API) launcher for use starting the web console and Brooklyn applications.

static BrooklynLauncher newLauncher()

Creates a configurable (fluent API) launcher for use starting the web console and Brooklyn applications.

BrooklynLauncher 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

BrooklynLauncher shutdownOnExit(boolean val)

BrooklynLauncher start()

Starts the web server (with web console) and Brooklyn applications, as per the specifications configured.

void terminate()

Terminates this launch, but does not stop the applications (i.e. external processes are left running, etc).

BrooklynLauncher webServerFlags(java.util.Map webServerFlags)

Specifies additional flags to be passed to BrooklynWebServer.

BrooklynLauncher webapp(java.lang.String contextPath, java.lang.String warUrl)

Specifies an additional webapp to host on the webconsole port.

BrooklynLauncher webconsole(boolean startWebApps)

Specifies whether the launcher will start the Brooklyn web console (and any additional webapps specified); default true.

BrooklynLauncher webconsolePort(int port)

Specifies the port where the web console (and any additional webapps specified) will listen; default "8081+" being the first available >= 8081.

BrooklynLauncher webconsolePort(java.lang.String port)

Specifies the port where the web console (and any additional webapps specified) will listen; default "8081+" being the first available >= 8081.

BrooklynLauncher webconsolePort(PortRange port)

Specifies the port where the web console (and any additional webapps specified) will listen; default "8081+" being the first available >= 8081.

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

Method Detail

application

public BrooklynLauncher application(Application app)
Specifies that the launcher should manage the given Brooklyn application. The application must not yet be managed. The application will not be started as part of this call (callers can subsequently call start() or getApplications().
See Also:
application(brooklyn.entity.basic.ApplicationBuilder)


application

public BrooklynLauncher application(ApplicationBuilder appBuilder)
Specifies that the launcher should build and manage the given Brooklyn application. The application must not yet be managed. The application will not be started as part of this call (callers can subsequently call start() or getApplications().
See Also:
application(brooklyn.entity.Application)


application

public BrooklynLauncher application(EntitySpec appSpec)
Specifies that the launcher should build and manage the Brooklyn application described by the given spec. The application will not be started as part of this call (callers can subsequently call start() or getApplications().
See Also:
application(brooklyn.entity.Application)


bindAddress

public BrooklynLauncher bindAddress(java.net.InetAddress bindAddress)
Specifies the NIC where the web console (and any additional webapps specified) will be bound; default 0.0.0.0, unless no security is specified (e.g. users) in which case it is localhost.


brooklynProperties

public BrooklynLauncher brooklynProperties(BrooklynProperties brooklynProperties)
Specifies the brooklyn properties to be used. Must not be set if managementContext is explicitly set.


brooklynProperties

public BrooklynLauncher brooklynProperties(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


doLaunch

protected BrooklynLauncher doLaunch()
For backwards compatibility, to implement launch(); will be deleted when that deprecated code is deleted.


getApplications

public java.util.List getApplications()


getServerDetails

public BrooklynServerDetails getServerDetails()


globalBrooklynPropertiesFile

public BrooklynLauncher globalBrooklynPropertiesFile(java.lang.String file)


installSecurityFilter

public BrooklynLauncher installSecurityFilter(java.lang.Boolean val)


launch

return getServerDetails();
public BrooklynServerDetails launch()


localBrooklynPropertiesFile

public BrooklynLauncher localBrooklynPropertiesFile(java.lang.String file)


location

public BrooklynLauncher location(Location location)
Adds a location to be passed in on start(), when that calls application.start(locations).


location

public BrooklynLauncher location(java.lang.String spec)
Give the spec of an application, to be created.
See Also:
location(brooklyn.location.Location)


locations

public BrooklynLauncher locations(java.util.List specs)


manage

* in such a way that the web console is launched and the application is shutdown on server termination.
public static ManagementContext manage(AbstractApplication app)
Launches the web console on port 8081, and a Brooklyn application, with a single command, in such a way that the web console is launched and the application is shutdown on server termination. For readability and flexibility, clients may prefer the newLauncher() fluent syntax.
deprecated:
in 0.5; use newInstance().application(app).start()


manage

* For readability and flexibility, clients may prefer the {@link #newLauncher()} builder-style syntax.
public static ManagementContext manage(AbstractApplication app, int port)


manage

if (startWebConsole) {
public static ManagementContext manage(AbstractApplication app, int port, boolean shutdownApp, boolean startWebConsole)


management

* The application must not yet be managed.
public BrooklynLauncher management(ManagementContext context)


managementContext

public BrooklynLauncher managementContext(ManagementContext context)
Specifies the management context this launcher should use. If not specified a new one is created automatically.


managing

* The application must not yet be managed.
public BrooklynLauncher managing(Application app)


managing

*
public BrooklynLauncher managing(ApplicationBuilder app)


newInstance

public static BrooklynLauncher newInstance()
Creates a configurable (fluent API) launcher for use starting the web console and Brooklyn applications.


newLauncher

*
public static BrooklynLauncher newLauncher()
Creates a configurable (fluent API) launcher for use starting the web console and Brooklyn applications.
deprecated:
in 0.5; use newInstance();


setAttribute

@Deprecated
public BrooklynLauncher 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
deprecated:
in 0.5; use brooklynProperties(String, Object)


shutdownOnExit

public BrooklynLauncher shutdownOnExit(boolean val)


start

public BrooklynLauncher start()
Starts the web server (with web console) and Brooklyn applications, as per the specifications configured.
Returns:
An object containing details of the web server and the management context.


terminate

public void terminate()
Terminates this launch, but does not stop the applications (i.e. external processes are left running, etc). However, by terminating the management console the brooklyn applications become unusable.


webServerFlags

public BrooklynLauncher webServerFlags(java.util.Map webServerFlags)
Specifies additional flags to be passed to BrooklynWebServer.


webapp

public BrooklynLauncher webapp(java.lang.String contextPath, java.lang.String warUrl)
Specifies an additional webapp to host on the webconsole port.
Parameters:
contextPath - The context path (e.g. "/hello", or equivalently just "hello") where the webapp will be hosted. "/" will override the brooklyn console webapp.
warUrl - The URL from which the WAR should be loaded, supporting classpath:// protocol in addition to file:// and http(s)://.


webconsole

public BrooklynLauncher webconsole(boolean startWebApps)
Specifies whether the launcher will start the Brooklyn web console (and any additional webapps specified); default true.


webconsolePort

public BrooklynLauncher webconsolePort(int port)
Specifies the port where the web console (and any additional webapps specified) will listen; default "8081+" being the first available >= 8081.


webconsolePort

public BrooklynLauncher webconsolePort(java.lang.String port)
Specifies the port where the web console (and any additional webapps specified) will listen; default "8081+" being the first available >= 8081.


webconsolePort

public BrooklynLauncher webconsolePort(PortRange port)
Specifies the port where the web console (and any additional webapps specified) will listen; default "8081+" being the first available >= 8081.


 

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