|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.location.basic.AbstractLocation
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
|
static ConfigKey |
PARENT_LOCATION
|
protected HostGeoInfo |
hostGeoInfo
|
protected java.lang.String |
name
|
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
|
addChildLocation(Location child)
|
void
|
addExtension(java.lang.Class extensionType, java.lang.Object extension)
|
protected void
|
assertNotYetManaged()
|
void
|
configure(java.util.Map properties)
Will set fields from flags. |
boolean
|
containsLocation(Location potentialDescendent)
|
boolean
|
equals(java.lang.Object o)
|
java.lang.Object
|
findLocationProperty(java.lang.String key)
override this, adding to the returned value, to supply additional fields to include in the toString |
java.util.Map
|
getAllConfig()
|
java.util.Map
|
getAllConfig(boolean includeInherited)
@deprecated since 0.6.0 use getRawLocalConfigBag() |
java.util.Collection
|
getChildLocations()
|
java.util.Collection
|
getChildren()
|
java.lang.Object
|
getConfig(ConfigKey key)
|
ConfigBag
|
getConfigBag()
|
java.lang.String
|
getDisplayName()
|
java.lang.Object
|
getExtension(java.lang.Class extensionType)
|
HostGeoInfo
|
getHostGeoInfo()
|
java.lang.String
|
getId()
|
java.lang.Object
|
getLocationProperty(java.lang.String key)
|
protected ManagementContext
|
getManagementContext()
|
java.lang.String
|
getName()
|
Location
|
getParent()
|
Location
|
getParentLocation()
|
ConfigBag
|
getRawLocalConfigBag()
|
RebindSupport
|
getRebindSupport()
|
boolean
|
hasConfig(ConfigKey key)
|
boolean
|
hasConfig(ConfigKey key, boolean includeInherited)
|
boolean
|
hasExtension(java.lang.Class extensionType)
|
boolean
|
hasLocationProperty(java.lang.String key)
Default String representation is simplified name of class, together with selected fields. |
int
|
hashCode()
|
void
|
init()
|
protected boolean
|
isLegacyConstruction()
|
boolean
|
isManaged()
|
void
|
onManagementStarted()
|
void
|
onManagementStopped()
|
protected boolean
|
removeChild(Location child)
|
protected boolean
|
removeChildLocation(Location child)
@deprecated since 0.6 |
java.lang.Object
|
setConfig(ConfigKey key, java.lang.Object value)
|
void
|
setHostGeoInfo(HostGeoInfo hostGeoInfo)
|
void
|
setManagementContext(ManagementContext managementContext)
|
void
|
setName(java.lang.String name)
|
void
|
setParent(Location parent)
|
void
|
setParentLocation(Location parent)
|
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(), 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 |
---|
public static final Logger LOG
public static final ConfigKey PARENT_LOCATION
protected HostGeoInfo hostGeoInfo
protected java.lang.String name
Constructor Detail |
---|
public AbstractLocation()
public AbstractLocation(java.util.Map properties)
Method Detail |
---|
protected java.lang.Object addChild(LocationSpec spec)
public void addChild(Location child)
// instances. public void addChildLocation(Location child)
public void addExtension(java.lang.Class extensionType, java.lang.Object extension)
protected void assertNotYetManaged()
public void configure(java.util.Map properties)
For new-style locations (i.e. not calling constructor directly, this will be invoked automatically by brooklyn-core post-construction).
For legacy location use, this will be invoked by the constructor in this class. Therefore if over-riding you must *not* rely on field initializers because they may not run until *after* this method (this method is invoked by the constructor in this class, so initializers in subclasses will not have run when this overridden method is invoked.) If you require fields to be initialized you must do that in this method with a guard (as in FixedListMachineProvisioningLocation).
public boolean containsLocation(Location potentialDescendent)
while (loc != null) { public boolean equals(java.lang.Object o)
return Objects.toStringHelper(getClass()).add("id", id).add("name", name); } public java.lang.Object findLocationProperty(java.lang.String key)
/** @deprecated since 0.6.0 use {@link #getRawLocalConfigBag()} */ public java.util.Map getAllConfig()
public ConfigBag getRawLocalConfigBag() { public java.util.Map getAllConfig(boolean includeInherited)
@Override @Deprecated public java.util.Collection getChildLocations()
} public java.util.Collection getChildren()
} public java.lang.Object getConfig(ConfigKey key)
public ConfigBag getConfigBag()
return parentLocation; public java.lang.String getDisplayName()
public java.lang.Object getExtension(java.lang.Class extensionType)
public HostGeoInfo getHostGeoInfo()
return getDisplayName(); public java.lang.String getId()
} public java.lang.Object getLocationProperty(java.lang.String key)
protected ManagementContext getManagementContext()
synchronized (childLocations) { return ImmutableList.copyOf(childLocations); } public java.lang.String getName()
if (parent == this) { public Location getParent()
@Override publicT getConfig(ConfigKey key) { public Location getParentLocation()
public ConfigBag getRawLocalConfigBag()
builder.put("id", getId()); public RebindSupport getRebindSupport()
} @Override public boolean hasConfig(ConfigKey key)
Location p = getParent(); public boolean hasConfig(ConfigKey key, boolean includeInherited)
public boolean hasExtension(java.lang.Class extensionType)
@Override public boolean hasLocationProperty(java.lang.String key)
*/ public int hashCode()
public void init()
protected boolean isLegacyConstruction()
public boolean isManaged()
public void onManagementStarted()
public void onManagementStopped()
protected boolean removeChild(Location child)
protected boolean removeChildLocation(Location child)
public java.lang.Object setConfig(ConfigKey key, java.lang.Object value)
public void setHostGeoInfo(HostGeoInfo hostGeoInfo)
public void setManagementContext(ManagementContext managementContext)
public void setName(java.lang.String name)
} public void setParent(Location parent)
public boolean hasConfig(ConfigKey> key, boolean includeInherited) { boolean locally = getRawLocalConfigBag().containsKey(key); public void setParentLocation(Location parent)
protected ToStringHelper string()
public java.util.Map toMetadataRecord()
public java.lang.String toString()
public java.lang.String toVerboseString()
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.