public abstract class AbstractBrooklynObject extends java.lang.Object implements BrooklynObjectInternal
BrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternalBrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupportConfigurable.ConfigurationSupport| Constructor and Description |
|---|
AbstractBrooklynObject() |
AbstractBrooklynObject(java.util.Map<?,?> properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSearchPath(java.util.List<java.lang.String> ids) |
java.lang.String |
getCatalogItemId()
The catalog item ID this object was loaded from.
|
java.util.List<java.lang.String> |
getCatalogItemIdSearchPath()
An immutable list of ids of catalog items that this item depends on in some way,
with the item that directly defines it implicit, but other items it references explicit.
|
java.lang.String |
getId() |
ManagementContext |
getManagementContext() |
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.
|
BrooklynObjectInternal.RelationSupportInternal<?> |
relations()
Relations specify a typed, directed connection between two entities.
|
void |
setCatalogItemId(java.lang.String id) |
void |
setCatalogItemIdAndSearchPath(java.lang.String catalogItemId,
java.util.List<java.lang.String> ids) |
abstract void |
setDisplayName(java.lang.String newName) |
void |
setManagementContext(ManagementContextInternal managementContext) |
void |
stackCatalogItemId(java.lang.String id)
Moves the current catalog item id onto the start of the search path,
then sets the catalog item id to the supplied value.
|
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, waitconfig, getRebindSupport, subscriptionsgetDisplayNamegetConfigpublic 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()
getManagementContext in interface BrooklynObjectInternalpublic java.lang.String getId()
getId in interface Identifiablepublic void setCatalogItemId(java.lang.String id)
setCatalogItemId in interface BrooklynObjectInternalpublic void setCatalogItemIdAndSearchPath(java.lang.String catalogItemId,
java.util.List<java.lang.String> ids)
setCatalogItemIdAndSearchPath in interface BrooklynObjectInternalpublic void addSearchPath(java.util.List<java.lang.String> ids)
addSearchPath in interface BrooklynObjectInternalpublic void stackCatalogItemId(java.lang.String id)
BrooklynObjectInternalstackCatalogItemId in interface BrooklynObjectInternalpublic java.util.List<java.lang.String> getCatalogItemIdSearchPath()
BrooklynObject
items:
- id: X
- id: Y
item: X
- id: Z
item: Y
the spec for Z will have getCatalogId() of Z and getCatalogItemIdSearchPath() of Y, X.
(The self catalog ID is implicit at the head of the search path.)getCatalogItemIdSearchPath in interface BrooklynObjectpublic java.lang.String getCatalogItemId()
BrooklynObjectThis 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.
This should conform to OSGi specs for symbolic_name:version
but weaker semantics are usually allowed so long as neither segment contains a : or whitespace.
getCatalogItemId in interface BrooklynObjectpublic BrooklynObject.TagSupport tags()
BrooklynObjectImmutableMap 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 BrooklynObjectpublic BrooklynObjectInternal.RelationSupportInternal<?> relations()
BrooklynObjectrelations in interface BrooklynObjectrelations in interface BrooklynObjectInternal