Brooklyn

brooklyn.entity.basic
[Java] Class AbstractSoftwareProcessDriver

java.lang.Object
  brooklyn.entity.basic.AbstractSoftwareProcessDriver
All Implemented Interfaces:
SoftwareProcessDriver

public abstract class AbstractSoftwareProcessDriver

An abstract implementation of the SoftwareProcessDriver.


Field Summary
protected EntityLocal entity

protected Location location

protected ResourceUtils resource

 
Constructor Summary
AbstractSoftwareProcessDriver(EntityLocal entity, Location location)

 
Method Summary
void customize()

protected boolean doFullStartOnRestart()

EntityLocal getEntity()

Location getLocation()

java.io.InputStream getResource(java.lang.String url)

java.lang.String getResourceAsString(java.lang.String url)

void install()

void kill()

void launch()

void postLaunch()

Implement this method in child classes to add some post-launch behavior

java.lang.String processTemplate(java.io.File templateConfigFile, java.util.Map extraSubstitutions)

java.lang.String processTemplate(java.io.File templateConfigFile)

java.lang.String processTemplate(java.lang.String templateConfigUrl)

Takes the contents of a template file from the given URL (often a classpath://com/myco/myprod/myfile.conf or .sh) and replaces "${entity.xxx}" with the result of entity.getXxx() and similar for other driver, location; as well as replacing config keys on the management context

java.lang.String processTemplate(java.lang.String templateConfigUrl, java.util.Map extraSubstitutions)

java.lang.String processTemplateContents(java.lang.String templateContents)

java.lang.String processTemplateContents(java.lang.String templateContents, java.util.Map extraSubstitutions)

void rebind()

void restart()

void start()

Start the entity.

void stop()

protected void waitForConfigKey(ConfigKey configKey)

 
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

entity

protected final EntityLocal entity


location

protected final Location location


resource

protected final ResourceUtils resource


 
Constructor Detail

AbstractSoftwareProcessDriver

public AbstractSoftwareProcessDriver(EntityLocal entity, Location location)


 
Method Detail

customize

public void customize()


doFullStartOnRestart

ally restart() would take options, e.g. whether to do full start, skip installs, etc;
	 * however in the absence here is a toggle - not sure how well it works;
	 * default is false which is similar to previous behaviour (with some seemingly-obvious tidies),
	 * meaning install and configure will NOT be done on restart. */
	protected boolean doFullStartOnRestart() {
	    ret
protected boolean doFullStartOnRestart()


getEntity

ic EntityLocal getEntity() { return entity; }
public EntityLocal getEntity()


getLocation

ic Location getLocation() { return location; }
public Location getLocation()


getResource

public java.io.InputStream getResource(java.lang.String url)


getResourceAsString

public java.lang.String getResourceAsString(java.lang.String url)


install

public void install()


kill

public void kill() {
public void kill()


launch

public void launch()


postLaunch

public void postLaunch()
Implement this method in child classes to add some post-launch behavior


processTemplate

public java.lang.String processTemplate(java.io.File templateConfigFile, java.util.Map extraSubstitutions)


processTemplate

public java.lang.String processTemplate(java.io.File templateConfigFile)


processTemplate

public java.lang.String processTemplate(java.lang.String templateConfigUrl)
Takes the contents of a template file from the given URL (often a classpath://com/myco/myprod/myfile.conf or .sh) and replaces "${entity.xxx}" with the result of entity.getXxx() and similar for other driver, location; as well as replacing config keys on the management context

uses Freemarker templates under the covers


processTemplate

public java.lang.String processTemplate(java.lang.String templateConfigUrl, java.util.Map extraSubstitutions)


processTemplateContents

public java.lang.String processTemplateContents(java.lang.String templateContents)


processTemplateContents

public java.lang.String processTemplateContents(java.lang.String templateContents, java.util.Map extraSubstitutions)


rebind

@Override
public void rebind()


restart

void restart() {
	    Dyn
public void restart()


start

void start() {
	    Dyn
public void start()
Start the entity. this installs, configures and launches the application process. However, users can also call the install(), customize() and launch() steps independently. The postLaunch() will be called after the launch() metheod is executed, but the process may not be completely initialised at this stage, so care is required when implementing these stages.
See Also:
stop()


stop

abstract void stop();
public void stop()


waitForConfigKey

protected void waitForConfigKey(ConfigKey configKey)


 

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