Brooklyn

brooklyn.location.basic
[Java] Class AbstractLocation

java.lang.Object
  brooklyn.location.basic.AbstractLocation
All Implemented Interfaces:
Configurable, HasHostGeoInfo, LocationInternal

public abstract class AbstractLocation

A basic implementation of the Location interface. This provides an implementation which works according to the requirements of the interface documentation, and is ready to be extended to make more specialized locations. Override configure(Map) to add special initialization logic.


Field Summary
static Logger LOG

@deprecated since 0.7.0 shouldn't be public

static ConfigKey PARENT_LOCATION

 
Constructor Summary
AbstractLocation()

Construct a new instance of an AbstractLocation.

AbstractLocation(java.util.Map properties)

Construct a new instance of an AbstractLocation.

 
Method Summary
protected java.lang.Object addChild(LocationSpec spec)

void addChild(Location child)

void addExtension(java.lang.Class extensionType, java.lang.Object extension)

protected void assertNotYetManaged()

void configure(java.util.Map properties)

boolean containsLocation(Location potentialDescendent)

boolean equals(java.lang.Object o)

java.util.Map getAllConfig(boolean includeInherited)

@deprecated since 0.7; use getLocalConfigBag()

ConfigBag getAllConfigBag()

Since:
0.6.0 (?)

java.util.Collection getChildren()

java.lang.Object getConfig(HasConfigKey key)

java.lang.Object getConfig(ConfigKey key)

java.lang.String getDisplayName()

java.lang.Object getExtension(java.lang.Class extensionType)

HostGeoInfo getHostGeoInfo()

java.lang.String getId()

ConfigBag getLocalConfigBag()

ManagementContext getManagementContext()

Location getParent()

ConfigBag getRawLocalConfigBag()

RebindSupport getRebindSupport()

boolean hasConfig(ConfigKey key, boolean includeInherited)

boolean hasExtension(java.lang.Class extensionType)

int hashCode()

void init()

Called by framework (in new-style locations) on rebind, after configuring, setting parent, etc.

protected boolean isDisplayNameAutoGenerated()

protected boolean isLegacyConstruction()

boolean isManaged()

void onManagementStarted()

void onManagementStopped()

void rebind()

protected boolean removeChild(Location child)

Default String representation is simplified name of class, together with selected fields.

java.lang.Object setConfig(ConfigKey key, java.lang.Object value)

void setDisplayName(java.lang.String newName)

void setHostGeoInfo(HostGeoInfo hostGeoInfo)

void setManagementContext(ManagementContextInternal managementContext)

void setName(java.lang.String newName)

void setParent(Location newParent)

protected ToStringHelper string()

java.util.Map toMetadataRecord()

java.lang.String toString()

java.lang.String toVerboseString()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), 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

LOG

@java.lang.Deprecated
public static final Logger LOG
deprecated:
since 0.7.0 shouldn't be public


PARENT_LOCATION

public static final ConfigKey PARENT_LOCATION


 
Constructor Detail

AbstractLocation

public AbstractLocation()
Construct a new instance of an AbstractLocation.


AbstractLocation

public AbstractLocation(java.util.Map properties)
Construct a new instance of an AbstractLocation. The properties map recognizes the following keys: Other common properties (retrieved via get/findLocationProperty) include:


 
Method Detail

addChild

protected java.lang.Object addChild(LocationSpec spec)


addChild

public void addChild(Location child)


addExtension

@java.lang.Override
public void addExtension(java.lang.Class extensionType, java.lang.Object extension)


assertNotYetManaged

protected void assertNotYetManaged()


configure

public void configure(java.util.Map properties)


containsLocation

@java.lang.Override// don't re-add; no-op
public boolean containsLocation(Location potentialDescendent)


equals

@java.lang.Overridereturn child;
public boolean equals(java.lang.Object o)


getAllConfig

@java.lang.Overridepublic  T setConfig(ConfigKey key, T value) {
public java.util.Map getAllConfig(boolean includeInherited)
deprecated:
since 0.7; use getLocalConfigBag()
Since:
0.6


getAllConfigBag

@java.lang.OverridesetDisplayName(newName);
public ConfigBag getAllConfigBag()
Since:
0.6.0 (?) - use getDisplayName


getChildren

@java.lang.Overrideif (newParent != null) {
public java.util.Collection getChildren()


getConfig

@java.lang.Override
public java.lang.Object getConfig(HasConfigKey key)


getConfig

@java.lang.Override
public java.lang.Object getConfig(ConfigKey key)


getDisplayName

@java.lang.Overridepublic void setParent(Location newParent) {
public java.lang.String getDisplayName()


getExtension

@java.lang.Override
@java.lang.SuppressWarnings
public java.lang.Object getExtension(java.lang.Class extensionType)


getHostGeoInfo

@java.lang.Overrideextensions.put(extensionType, extension);
public HostGeoInfo getHostGeoInfo()


getId

@java.lang.Overridereturn ImmutableList.copyOf(children);
public java.lang.String getId()


getLocalConfigBag

@java.lang.Override
public ConfigBag getLocalConfigBag()


getManagementContext

public ManagementContext getManagementContext()


getParent

@java.lang.Overrideif (parent.get() != null) {
public Location getParent()


getRawLocalConfigBag

public ConfigBag getRawLocalConfigBag()


getRebindSupport

@java.lang.Override
public RebindSupport getRebindSupport()


hasConfig

@java.lang.Override/**
public boolean hasConfig(ConfigKey key, boolean includeInherited)


hasExtension

@java.lang.Override
public boolean hasExtension(java.lang.Class extensionType)


hashCode

@java.lang.Override// instances.
public int hashCode()


init

public void init()
Called by framework (in new-style locations) on rebind, after configuring, setting parent, etc. Note that a future change to Brooklyn is that init() will not be called when rebinding.


isDisplayNameAutoGenerated

protected boolean isDisplayNameAutoGenerated()


isLegacyConstruction

protected boolean isLegacyConstruction()


isManaged

public boolean isManaged()


onManagementStarted

public void onManagementStarted()


onManagementStopped

public void onManagementStopped()


rebind

public void rebind()


removeChild

protected boolean removeChild(Location child)
Default String representation is simplified name of class, together with selected fields.


setConfig

@java.lang.Overridereturn getId().hashCode();
public java.lang.Object setConfig(ConfigKey key, java.lang.Object value)


setDisplayName

public void setDisplayName(java.lang.String newName)


setHostGeoInfo

public void setHostGeoInfo(HostGeoInfo hostGeoInfo)


setManagementContext

public void setManagementContext(ManagementContextInternal managementContext)


setName

public void setName(java.lang.String newName)


setParent

@java.lang.Overridepublic  T getConfig(HasConfigKey key) {
public void setParent(Location newParent)


string

protected ToStringHelper string()


toMetadataRecord

@java.lang.Override
public java.util.Map toMetadataRecord()


toString

@java.lang.Override
public java.lang.String toString()


toVerboseString

@java.lang.Overridethrow new IllegalArgumentException("No extension of type "+extensionType+" registered for location "+this);
public java.lang.String toVerboseString()


 

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