public abstract class AbstractBrooklynObject extends java.lang.Object implements BrooklynObjectInternal
BrooklynObjectInternal.ConfigurationSupportInternal
BrooklynObject.TagSupport
Configurable.ConfigurationSupport
Constructor and Description |
---|
AbstractBrooklynObject() |
AbstractBrooklynObject(java.util.Map<?,?> properties) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCatalogItemId()
The catalog item ID this object was loaded from.
|
java.lang.String |
getId() |
ManagementContext |
getManagementContext() |
BrooklynObject.TagSupport |
getTagSupport()
Deprecated.
|
void |
init()
Called by framework (in new-style instances where spec was used) after configuring etc,
but before a reference to this instance is shared.
|
void |
rebind()
Called by framework on rebind (in new-style instances):
after configuring, but
before the instance is managed, and
before adjuncts are attached to entities, and
before a reference to an object is shared.
|
void |
setCatalogItemId(java.lang.String id) |
abstract void |
setDisplayName(java.lang.String newName) |
void |
setManagementContext(ManagementContextInternal managementContext) |
BrooklynObject.TagSupport |
tags()
Tags are arbitrary objects which can be attached to an entity for subsequent reference.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
config, getRebindSupport
getDisplayName
setConfig
public AbstractBrooklynObject()
public AbstractBrooklynObject(java.util.Map<?,?> properties)
public abstract void setDisplayName(java.lang.String newName)
public void init()
To preserve backwards compatibility for if the instance is constructed directly, one can call the code below, but that means it will be called after references to this policy have been shared with other entities.
if (isLegacyConstruction()) {
init();
}
public void rebind()
init()
will not be called on rebind.
If you need to intercept behaviour after adjuncts are attached,
consider AbstractEntity.onManagementStarting()
(but probably worth raising a discussion on the mailing list!)
public void setManagementContext(ManagementContextInternal managementContext)
public ManagementContext getManagementContext()
public java.lang.String getId()
getId
in interface Identifiable
public void setCatalogItemId(java.lang.String id)
setCatalogItemId
in interface BrooklynObjectInternal
public java.lang.String getCatalogItemId()
BrooklynObject
This can be used to understand the appropriate classloading context, such as for versioning purposes, as well as meta-information such as branding (maybe you can even get an icon) and potentially things like resource lifecycle (if a software version is being sunsetted).
In some cases this may be set heuristically from context and so may not be accurate. Callers can set an explicit catalog item ID if inferencing is not correct.
getCatalogItemId
in interface BrooklynObject
public BrooklynObject.TagSupport tags()
BrooklynObject
ImmutableMap
may be used under the covers; also there is little point!);
and they should be amenable to our persistence (on-disk serialization) and our JSON serialization in the REST API.tags
in interface BrooklynObject
@Deprecated public BrooklynObject.TagSupport getTagSupport()
getTagSupport
in interface BrooklynObject