public class LocalManagementContext extends AbstractManagementContext
ManagementContext
API.ManagementContext.PropertiesReloadListener
Modifier and Type | Field and Description |
---|---|
java.lang.Throwable |
constructionStackTrace |
EFFECTOR_TAG, EMPTY_CATALOG_URL, NON_TRANSIENT_TASK_TAG, SUB_TASK_TAG, TRANSIENT_TASK_TAG
Constructor and Description |
---|
LocalManagementContext()
Creates a LocalManagement with default BrooklynProperties.
|
LocalManagementContext(BrooklynProperties.Factory.Builder builder) |
LocalManagementContext(BrooklynProperties.Factory.Builder builder,
DataGridFactory datagridFactory) |
LocalManagementContext(BrooklynProperties.Factory.Builder builder,
java.util.Map<java.lang.String,java.lang.Object> brooklynAdditionalProperties) |
LocalManagementContext(BrooklynProperties.Factory.Builder builder,
java.util.Map<java.lang.String,java.lang.Object> brooklynAdditionalProperties,
DataGridFactory datagridFactory) |
LocalManagementContext(BrooklynProperties brooklynProperties) |
LocalManagementContext(BrooklynProperties brooklynProperties,
DataGridFactory datagridFactory)
Creates a new LocalManagementContext.
|
LocalManagementContext(BrooklynProperties brooklynProperties,
java.util.Map<java.lang.String,java.lang.Object> brooklynAdditionalProperties) |
Modifier and Type | Method and Description |
---|---|
void |
addEntitySetListener(CollectionChangeListener<Entity> listener) |
void |
addPropertiesReloadListener(ManagementContext.PropertiesReloadListener listener)
Registers a listener to be notified when brooklyn.properties is reloaded
|
void |
clearLocationRegistry() |
AccessController |
getAccessController()
For controlling access to operations - can be queried to find if an operation is allowed.
|
LocalAccessManager |
getAccessManager() |
java.util.Collection<Application> |
getApplications()
All applications under control of this management plane
|
InternalEntityFactory |
getEntityFactory() |
LocalEntityManager |
getEntityManager()
Returns the
EntityManager instance for managing/querying entities. |
ExecutionManager |
getExecutionManager()
Returns the
ExecutionManager instance for entities and users in this management realm
to submit tasks and to observe what tasks are occurring |
InternalLocationFactory |
getLocationFactory() |
LocalLocationManager |
getLocationManager() |
java.lang.String |
getManagementNodeId()
UID for this
ManagementContext node (as part of a single management plane). |
java.lang.String |
getManagementPlaneId()
UID for the Brooklyn management plane which this
ManagementContext node is a part of. |
Maybe<OsgiManager> |
getOsgiManager() |
InternalPolicyFactory |
getPolicyFactory() |
SubscriptionManager |
getSubscriptionManager()
Returns the
SubscriptionManager instance for entities and users of this management realm
to subscribe to sensor events (and, in the case of entities, to emit sensor events) |
LocalUsageManager |
getUsageManager() |
boolean |
isManagedLocally(Entity e)
Whether the master entity record is local, and sensors and effectors can be properly accessed locally.
|
static void |
logAll(org.slf4j.Logger logger) |
void |
noteStartupComplete() |
void |
prePreManage(Entity entity)
Registers an entity that has been created, but that has not yet begun to be managed.
|
void |
prePreManage(Location location)
Registers a location that has been created, but that has not yet begun to be managed.
|
void |
reloadBrooklynProperties()
Reloads locations from
brooklyn.properties . |
void |
removeEntitySetListener(CollectionChangeListener<Entity> listener) |
void |
removePropertiesReloadListener(ManagementContext.PropertiesReloadListener listener)
Deregisters a listener from brooklyn.properties reload notifications
|
<T> Task<T> |
runAtEntity(java.util.Map flags,
Entity entity,
java.util.concurrent.Callable<T> c)
Causes the indicated runnable to be run at the right location for the given entity.
|
void |
terminate() |
static int |
terminateAll()
terminates all (best effort); returns count of sessions closed; if exceptions thrown, returns negative number.
|
java.lang.String |
toString() |
errors, getBaseClassLoader, getBaseClassPathForScanning, getBrooklynProperties, getCatalog, getCatalogClassLoader, getCatalogInitialization, getConfig, getEntitlementManager, getEntityDownloadsManager, getEntityDriverManager, getExecutionContext, getGarbageCollector, getHighAvailabilityManager, getLocationRegistry, getManagementNodeUri, getRebindManager, getServerExecutionContext, getStorage, getSubscriptionContext, getTotalEffectorInvocations, invokeEffector, invokeEffectorMethodSync, isRunning, isStartupComplete, lookup, lookup, setBaseClassLoader, setBaseClassPathForScanning, setCatalogInitialization, setManagementNodeUri
public LocalManagementContext()
public LocalManagementContext(BrooklynProperties brooklynProperties)
public LocalManagementContext(BrooklynProperties brooklynProperties, DataGridFactory datagridFactory)
brooklynProperties
- the BrooklynProperties.datagridFactory
- the DataGridFactory to use. If this instance is null, it means that the system
is going to use BrooklynProperties to figure out which instance to load or otherwise
use a default instance.public LocalManagementContext(BrooklynProperties.Factory.Builder builder)
public LocalManagementContext(BrooklynProperties.Factory.Builder builder, DataGridFactory datagridFactory)
public LocalManagementContext(BrooklynProperties.Factory.Builder builder, java.util.Map<java.lang.String,java.lang.Object> brooklynAdditionalProperties)
public LocalManagementContext(BrooklynProperties brooklynProperties, java.util.Map<java.lang.String,java.lang.Object> brooklynAdditionalProperties)
public LocalManagementContext(BrooklynProperties.Factory.Builder builder, java.util.Map<java.lang.String,java.lang.Object> brooklynAdditionalProperties, DataGridFactory datagridFactory)
public static void logAll(org.slf4j.Logger logger)
@Beta public static int terminateAll()
public java.lang.String getManagementPlaneId()
ManagementContext
ManagementContext
node is a part of.
Each Brooklyn entity is actively managed by a unique management plane
whose ID which should not normally change for the duration of that entity,
even though the nodes in that plane might, and the plane may go down and come back up.
In other words the value of Application#getManagementContext()#getManagementPlaneId()
will generally be constant (in contrast to ManagementContext.getManagementNodeId()
).
This value should not be null unless the management context is a non-functional (non-deployment) instance.
public java.lang.String getManagementNodeId()
ManagementContext
ManagementContext
node (as part of a single management plane).
No two instances of ManagementContext
should ever have the same node UID.
The value of Application#getManagementContext()#getManagementNodeId()
may
change many times (in contrast to ManagementContext.getManagementPlaneId()
).
This value should not be null unless the management context is a non-functional (non-deployment) instance.
public void prePreManage(Entity entity)
ManagementContextInternal
This differs from the idea of "preManaged" where the entities are in the process of being managed, but where management is not yet complete.
public void prePreManage(Location location)
ManagementContextInternal
public java.util.Collection<Application> getApplications()
ManagementContext
public void addEntitySetListener(CollectionChangeListener<Entity> listener)
addEntitySetListener
in interface ManagementContextInternal
addEntitySetListener
in class AbstractManagementContext
public void removeEntitySetListener(CollectionChangeListener<Entity> listener)
removeEntitySetListener
in interface ManagementContextInternal
removeEntitySetListener
in class AbstractManagementContext
public LocalEntityManager getEntityManager()
ManagementContext
EntityManager
instance for managing/querying entities.public InternalEntityFactory getEntityFactory()
public InternalLocationFactory getLocationFactory()
public InternalPolicyFactory getPolicyFactory()
public LocalLocationManager getLocationManager()
public LocalAccessManager getAccessManager()
public LocalUsageManager getUsageManager()
public Maybe<OsgiManager> getOsgiManager()
public AccessController getAccessController()
ManagementContext
AccessController
.public SubscriptionManager getSubscriptionManager()
ManagementContext
SubscriptionManager
instance for entities and users of this management realm
to subscribe to sensor events (and, in the case of entities, to emit sensor events)public ExecutionManager getExecutionManager()
ManagementContext
ExecutionManager
instance for entities and users in this management realm
to submit tasks and to observe what tasks are occurringpublic void terminate()
terminate
in interface ManagementContextInternal
terminate
in class AbstractManagementContext
public <T> Task<T> runAtEntity(java.util.Map flags, Entity entity, java.util.concurrent.Callable<T> c)
AbstractManagementContext
runAtEntity
in class AbstractManagementContext
public boolean isManagedLocally(Entity e)
AbstractManagementContext
isManagedLocally
in class AbstractManagementContext
public java.lang.String toString()
toString
in class java.lang.Object
public void reloadBrooklynProperties()
ManagementContext
brooklyn.properties
. Any changes will apply only to newly created applicationspublic void clearLocationRegistry()
public void addPropertiesReloadListener(ManagementContext.PropertiesReloadListener listener)
ManagementContext
public void removePropertiesReloadListener(ManagementContext.PropertiesReloadListener listener)
ManagementContext
public void noteStartupComplete()