|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.entity.basic.AbstractEntity
brooklyn.entity.basic.SoftwareProcessImpl
public abstract class SoftwareProcessImpl extends AbstractEntity
An Entity representing a piece of software which can be installed, run, and controlled. A single such entity can only run on a single MachineLocation at a time (you can have multiple on the machine). It typically takes config keys for suggested versions, filesystem locations to use, and environment variables to set.
It exposes sensors for service state (Lifecycle) and status (String), and for host info, log file location.
Field Summary | |
---|---|
protected boolean |
connectedSensors
|
Fields inherited from class AbstractEntity | |
---|---|
EFFECTOR_ADDED, EFFECTOR_CHANGED, EFFECTOR_REMOVED, LOG, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, managementSupport, tempWorkings |
Constructor Summary | |
SoftwareProcessImpl()
|
|
SoftwareProcessImpl(Entity parent)
|
|
SoftwareProcessImpl(java.util.Map properties)
|
|
SoftwareProcessImpl(java.util.Map properties, Entity parent)
|
Method Summary | |
---|---|
protected void
|
callRebindHooks()
|
protected void
|
callStartHooks()
|
void
|
checkModifiable()
|
protected void
|
connectSensors()
For binding to the running app (e.g. connecting sensors to registry). |
protected void
|
connectServiceUpIsRunning()
For connecting the SERVICE_UP sensor to the value of the getDriver().isRunning() expression. |
protected void
|
disconnectSensors()
For disconnecting from the running app. |
protected void
|
disconnectServiceUpIsRunning()
For disconneting the SERVICE_UP feed. |
protected SoftwareProcessDriver
|
doInitDriver(MachineLocation machine)
|
void
|
doRestart()
|
protected void
|
doStart(java.util.Collection locations)
To be overridden instead of doRestart(); sub-classes should call super.doRestart() and should add do additional work via tasks, executed using DynamicTasks#queue(String, Callable)#queue(String, Callable). |
protected void
|
doStop()
|
SoftwareProcessDriver
|
getDriver()
|
java.lang.String
|
getLocalHostname()
@deprecated since 0.6.0 use Machines#findSubnetHostname(this)#findSubnetHostname(this) |
protected MachineLocation
|
getMachineOrNull()
|
protected java.util.Map
|
getProvisioningFlags(MachineProvisioningLocation location)
|
protected MachineProvisioningLocation
|
getProvisioningLocation()
|
protected java.util.Collection
|
getRequiredOpenPorts()
|
protected SoftwareProcessDriver
|
newDriver(MachineLocation loc)
|
protected java.util.Map
|
obtainProvisioningFlags(MachineProvisioningLocation location)
|
void
|
onManagementStarted()
|
void
|
onManagementStarting()
|
protected void
|
postDriverStart()
Called after driver.start(). |
protected void
|
postRebind()
Called after this entity is fully rebound (i.e. it is fully managed). |
protected void
|
postStart()
Called after the rest of start has completed (after connectSensors() and waitForServiceUp()) |
protected void
|
preStart()
Called before driver.start; guarantees the driver will exist, and locations will have been set. |
protected void
|
preStop()
|
protected void
|
rebind()
|
void
|
restart()
If custom behaviour is required by sub-classes, consider overriding doStop(). |
protected void
|
setProvisioningLocation(MachineProvisioningLocation val)
|
void
|
start(java.util.Collection locations)
If custom behaviour is required by sub-classes, consider overriding doStart(). |
protected void
|
startInLocation(java.util.Collection locations)
@deprecated since 0.6.0 use/override method in SoftwareProcessDriverStartEffectorTask |
protected void
|
startInLocation(Location location)
@deprecated since 0.6.0 use/override method in SoftwareProcessDriverStartEffectorTask |
protected void
|
startInLocation(MachineProvisioningLocation location)
|
protected void
|
startInLocation(MachineLocation machine)
|
void
|
stop()
|
void
|
waitForEntityStart()
|
void
|
waitForServiceUp()
|
void
|
waitForServiceUp(Duration duration)
|
void
|
waitForServiceUp(groovy.time.TimeDuration duration)
|
void
|
waitForServiceUp(long duration, java.util.concurrent.TimeUnit units)
|
Field Detail |
---|
protected boolean connectedSensors
Constructor Detail |
---|
public SoftwareProcessImpl()
public SoftwareProcessImpl(Entity parent)
public SoftwareProcessImpl(java.util.Map properties)
public SoftwareProcessImpl(java.util.Map properties, Entity parent)
Method Detail |
---|
protected void callRebindHooks()
protected final void callStartHooks()
public void checkModifiable()
protected void connectSensors()
Implementations should be idempotent (ie tell whether sensors already connected), though the framework is pretty good about not calling when already connected. TODO improve the framework's feed system to detect duplicate additions
protected void connectServiceUpIsRunning()
Should be called inside connectSensors().
protected void disconnectSensors()
protected void disconnectServiceUpIsRunning()
Should be called from disconnectSensors().
protected SoftwareProcessDriver doInitDriver(MachineLocation machine)
public void doRestart()
protected void doStart(java.util.Collection locations)
protected void doStop()
public SoftwareProcessDriver getDriver()
} public java.lang.String getLocalHostname()
protected MachineLocation getMachineOrNull()
protected final java.util.Map getProvisioningFlags(MachineProvisioningLocation location)
protected MachineProvisioningLocation getProvisioningLocation()
protected java.util.Collection getRequiredOpenPorts()
protected SoftwareProcessDriver newDriver(MachineLocation loc)
protected java.util.Map obtainProvisioningFlags(MachineProvisioningLocation location)
if (state != null && state != Lifecycle.CREATED) { public void onManagementStarted()
Lifecycle state = getAttribute(SERVICE_STATE); public void onManagementStarting()
protected void postDriverStart()
protected void postRebind()
protected void postStart()
protected void preStart()
protected void preStop()
protected void rebind()
* To be overridden instead of {@link #stop()}; sub-classes should call {@code super.doStop()} and should public final void restart()
protected void setProvisioningLocation(MachineProvisioningLocation val)
@Override pub public final void start(java.util.Collection locations)
protected final void startInLocation(java.util.Collection locations)
protected final void startInLocation(Location location)
protected final void startInLocation(MachineProvisioningLocation location)
protected final void startInLocation(MachineLocation machine)
Task> task = Tasks.builder().name("stop").body(new Runnable() { public void run() { doStop(); } }).build(); public final void stop()
public void waitForEntityStart()
public void waitForServiceUp()
public void waitForServiceUp(Duration duration)
public void waitForServiceUp(groovy.time.TimeDuration duration)
public void waitForServiceUp(long duration, java.util.concurrent.TimeUnit units)
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.