Brooklyn

brooklyn.entity.basic
[Java] Class SoftwareProcessImpl

java.lang.Object
  groovy.lang.GroovyObjectSupport
      brooklyn.entity.basic.AbstractEntity
          brooklyn.entity.basic.SoftwareProcessImpl
All Implemented Interfaces:
DriverDependentEntity, SoftwareProcess

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 SensorRegistry sensorRegistry

 
Fields inherited from class AbstractEntity
LOG, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, attributesInternal, configsInternal, 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 disconneting from the running app.

protected void disconnectServiceUpIsRunning()

For disconneting the SERVICE_UP feed.

protected SoftwareProcessDriver doInitDriver(MachineLocation machine)

Creates the driver (if does not already exist or needs replaced for some reason).

SoftwareProcessDriver getDriver()

java.lang.String getLocalHostname()

protected MachineLocation getMachineOrNull()

protected java.util.Map getProvisioningFlags(MachineProvisioningLocation location)

deprecated:
in 0.4.0. use obtainProvisioningFlags.

protected MachineProvisioningLocation getProvisioningLocation()

protected java.util.Collection getRequiredOpenPorts()

returns the ports that this entity wants to use; default implementation returns 22 plus first value for each PortAttributeSensorAndConfigKey config key PortRange.

protected SoftwareProcessDriver newDriver(MachineLocation loc)

protected java.util.Map obtainProvisioningFlags(MachineProvisioningLocation location)

void onManagementStarted()

void onManagementStarting()

protected void postDriverRestart()

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

protected void postStart()

Called after the rest of start has completed.

protected void preStart()

Called before driver.start; guarantees the driver will exist, locations will have been set and sensorRegistry will be set (but not yet activated).

protected void preStop()

protected void rebind()

void restart()

protected void setProvisioningLocation(MachineProvisioningLocation val)

void start(java.util.Collection locations)

protected void startInLocation(java.util.Collection locations)

protected void startInLocation(Location location)

protected void startInLocation(MachineProvisioningLocation location)

protected void startInLocation(MachineLocation machine)

void stop()

void stopInLocation(MachineLocation machine)

void waitForEntityStart()

void waitForServiceUp()

void waitForServiceUp(groovy.time.TimeDuration duration)

void waitForServiceUp(long duration, java.util.concurrent.TimeUnit units)

 
Methods inherited from class AbstractEntity
addChild, addChild, addEnricher, addGroup, addLocations, addOwnedChild, addPolicy, assertNotYetOwned, clearOwner, clearParent, configure, configure, configure, configure, configure, createManagementSupport, destroy, emit, emitInternal, equals, finalize, firstLocation, getAllAttributes, getAllConfig, getApplication, getApplicationId, getAttribute, getAttributeByNameParts, getChildren, getChildrenReference, getConfig, getConfig, getConfig, getConfig, getConfigMap, getDisplayName, getEffector, getEnrichers, getEntityManager, getEntityType, getEntityTypeName, getExecutionContext, getGroups, getId, getLocations, getManagementContext, getManagementSupport, getMutableEntityType, getOwnedChildren, getOwnedChildrenReference, getOwner, getParent, getPolicies, getProxy, getProxyIfAvailable, getRebindSupport, getSubscriptionContext, getSubscriptionTracker, hasEverBeenManaged, hashCode, init, invalidateReferences, invoke, invoke, invokeFromJava, invokeMethod, isLegacyConstruction, onManagementBecomingMaster, onManagementNoLongerMaster, onManagementStarted, onManagementStarting, refreshInheritedConfig, refreshInheritedConfigOfChildren, removeAllEnrichers, removeAllPolicies, removeAttribute, removeChild, removeEnricher, removeLocations, removeOwnedChild, removePolicy, setApplication, setAttribute, setAttribute, setAttributeWithoutPublishing, setBeingManaged, setConfig, setConfig, setConfig, setConfig, setConfig, setConfig, setConfigEvenIfOwned, setConfigEvenIfOwned, setConfigIfValNonNull, setConfigIfValNonNull, setDisplayName, setManagementContext, setOwner, setParent, setProxy, subscribe, subscribeToChildren, subscribeToMembers, toString, toStringFieldsToInclude, toStringHelper, unsubscribe, unsubscribe
 
Methods inherited from class groovy.lang.GroovyObjectSupport
groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()
 

Field Detail

sensorRegistry

protected SensorRegistry sensorRegistry


 
Constructor Detail

SoftwareProcessImpl

public SoftwareProcessImpl()


SoftwareProcessImpl

public SoftwareProcessImpl(Entity parent)


SoftwareProcessImpl

public SoftwareProcessImpl(java.util.Map properties)


SoftwareProcessImpl

public SoftwareProcessImpl(java.util.Map properties, Entity parent)


 
Method Detail

callRebindHooks

protected void callRebindHooks()


callStartHooks

protected void callStartHooks()


checkModifiable

public void checkModifiable()


connectSensors

protected void connectSensors()
For binding to the running app (e.g. connecting sensors to registry). Will be called on start() and on rebind().


connectServiceUpIsRunning

protected void connectServiceUpIsRunning()
For connecting the SERVICE_UP sensor to the value of the getDriver().isRunning() expression.

Should be called inside connectSensors().

See Also:
disconnectServiceUpIsRunning()


disconnectSensors

protected void disconnectSensors()
For disconneting from the running app. Will be called on stop.


disconnectServiceUpIsRunning

protected void disconnectServiceUpIsRunning()
For disconneting the SERVICE_UP feed.

Should be called from disconnectSensors().

See Also:
connectServiceUpIsRunning()


doInitDriver

protected SoftwareProcessDriver doInitDriver(MachineLocation machine)
Creates the driver (if does not already exist or needs replaced for some reason). Returns either the existing driver or a new driver. Must not return null.


getDriver

public SoftwareProcessDriver getDriver()


getLocalHostname

public java.lang.String getLocalHostname()


getMachineOrNull

protected MachineLocation getMachineOrNull()


getProvisioningFlags

protected java.util.Map getProvisioningFlags(MachineProvisioningLocation location)
deprecated:
in 0.4.0. use obtainProvisioningFlags. introduced in a branch which duplicates changes in master where it is called "obtainPF". will remove as soon as those uses are updated.


getProvisioningLocation

protected MachineProvisioningLocation getProvisioningLocation()


getRequiredOpenPorts

protected java.util.Collection getRequiredOpenPorts()
returns the ports that this entity wants to use; default implementation returns 22 plus first value for each PortAttributeSensorAndConfigKey config key PortRange.


newDriver

protected SoftwareProcessDriver newDriver(MachineLocation loc)


obtainProvisioningFlags

protected java.util.Map obtainProvisioningFlags(MachineProvisioningLocation location)


onManagementStarted

@Override
public void onManagementStarted()


onManagementStarting

@Override
public void onManagementStarting()


postDriverRestart

protected void postDriverRestart()


postDriverStart

protected void postDriverStart()
Called after driver.start(). Default implementation is to wait to confirm the driver definitely started the process.


postRebind

protected void postRebind()
Called after this entity is fully rebound (i.e. it is fully managed).


postRestart

protected void postRestart()


postStart

protected void postStart()
Called after the rest of start has completed.


preStart

protected void preStart()
Called before driver.start; guarantees the driver will exist, locations will have been set and sensorRegistry will be set (but not yet activated).


preStop

protected void preStop()


rebind

protected void rebind()


restart

public void restart()


setProvisioningLocation

protected void setProvisioningLocation(MachineProvisioningLocation val)


start

@Override
	public
public void start(java.util.Collection locations)


startInLocation

protected void startInLocation(java.util.Collection locations)


startInLocation

protected void startInLocation(Location location)


startInLocation

protected void startInLocation(MachineProvisioningLocation location)


startInLocation

protected void startInLocation(MachineLocation machine)


stop

public void stop()


stopInLocation

public void stopInLocation(MachineLocation machine)


waitForEntityStart

public void waitForEntityStart()


waitForServiceUp

public void waitForServiceUp()


waitForServiceUp

public void waitForServiceUp(groovy.time.TimeDuration duration)


waitForServiceUp

public void waitForServiceUp(long duration, java.util.concurrent.TimeUnit units)


 

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