public class NonDeploymentManagementContext extends java.lang.Object implements ManagementContextInternal
Modifier and Type | Class and Description |
---|---|
static class |
NonDeploymentManagementContext.NonDeploymentManagementContextMode |
ManagementContext.PropertiesReloadListener
EFFECTOR_TAG, EMPTY_CATALOG_URL, NON_TRANSIENT_TASK_TAG, SUB_TASK_TAG, TRANSIENT_TASK_TAG
Constructor and Description |
---|
NonDeploymentManagementContext(AbstractEntity entity,
NonDeploymentManagementContext.NonDeploymentManagementContextMode mode) |
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
|
java.util.List<java.lang.Throwable> |
errors()
Object which allows adding, removing, and clearing errors.
|
AccessController |
getAccessController()
For controlling access to operations - can be queried to find if an operation is allowed.
|
AccessManager |
getAccessManager() |
java.util.Collection<Application> |
getApplications()
All applications under control of this management plane
|
java.lang.ClassLoader |
getBaseClassLoader() |
java.lang.Iterable<java.net.URL> |
getBaseClassPathForScanning() |
BrooklynProperties |
getBrooklynProperties() |
BrooklynCatalog |
getCatalog()
Record of configured Brooklyn entities (and templates and policies) which can be loaded
|
java.lang.ClassLoader |
getCatalogClassLoader()
Returns the class loader to be used to load items.
|
CatalogInitialization |
getCatalogInitialization() |
StringConfigMap |
getConfig()
Returns the ConfigMap (e.g.
|
EntitlementManager |
getEntitlementManager()
Active entitlements checker instance.
|
DownloadResolverManager |
getEntityDownloadsManager()
Returns the
DownloadResolverManager for resolving things like which URL to download an installer from. |
EntityDriverManager |
getEntityDriverManager()
Returns the
EntityDriverManager entities can use to create drivers. |
InternalEntityFactory |
getEntityFactory() |
EntityManager |
getEntityManager()
Returns the
EntityManager instance for managing/querying entities. |
ExecutionContext |
getExecutionContext(Entity entity)
Returns an
ExecutionContext instance representing tasks
(from the ExecutionManager ) associated with this entity, and capable
of conveniently running such tasks which will be associated with that entity |
ExecutionManager |
getExecutionManager()
Returns the
ExecutionManager instance for entities and users in this management realm
to submit tasks and to observe what tasks are occurring |
HighAvailabilityManager |
getHighAvailabilityManager() |
InternalLocationFactory |
getLocationFactory() |
LocationManager |
getLocationManager() |
LocationRegistry |
getLocationRegistry()
Record of configured locations and location resolvers
|
java.lang.String |
getManagementNodeId()
UID for this
ManagementContext node (as part of a single management plane). |
Maybe<java.net.URI> |
getManagementNodeUri()
The URI that this management node's REST API is available at, or absent if the node's
API is unavailable.
|
java.lang.String |
getManagementPlaneId()
UID for the Brooklyn management plane which this
ManagementContext node is a part of. |
NonDeploymentManagementContext.NonDeploymentManagementContextMode |
getMode() |
Maybe<OsgiManager> |
getOsgiManager() |
InternalPolicyFactory |
getPolicyFactory() |
RebindManager |
getRebindManager() |
ExecutionContext |
getServerExecutionContext()
Returns an
ExecutionContext within the ExecutionManager for tasks
associated to the Brooklyn node's operation (not any entities). |
BrooklynStorage |
getStorage() |
SubscriptionContext |
getSubscriptionContext(Entity entity)
Returns a
SubscriptionContext instance representing subscriptions
(from the SubscriptionManager ) associated with this entity, and capable
of conveniently subscribing on behalf of that entity |
QueueingSubscriptionManager |
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) |
long |
getTotalEffectorInvocations() |
UsageManager |
getUsageManager() |
<T> Task<T> |
invokeEffector(Entity entity,
Effector<T> eff,
java.util.Map parameters) |
<T> T |
invokeEffectorMethodSync(Entity entity,
Effector<T> eff,
java.lang.Object args) |
boolean |
isRunning()
Whether the management context has been initialized and not yet terminated.
|
boolean |
isStartupComplete()
Whether all startup tasks have completed.
|
BrooklynObject |
lookup(java.lang.String id)
As
ManagementContext.lookup(String, Class) but not constraining the return type |
<T extends BrooklynObject> |
lookup(java.lang.String id,
java.lang.Class<T> type)
Finds an entity with the given ID known at this management context
|
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
|
void |
setBaseClassPathForScanning(java.lang.Iterable<java.net.URL> urls) |
void |
setCatalogInitialization(CatalogInitialization catalogInitialization) |
void |
setManagementContext(ManagementContextInternal val) |
void |
setManagementNodeUri(java.net.URI uri) |
void |
setMode(NonDeploymentManagementContext.NonDeploymentManagementContextMode mode) |
void |
terminate() |
java.lang.String |
toString() |
public NonDeploymentManagementContext(AbstractEntity entity, NonDeploymentManagementContext.NonDeploymentManagementContextMode mode)
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.
getManagementPlaneId
in interface ManagementContext
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.
getManagementNodeId
in interface ManagementContext
public Maybe<java.net.URI> getManagementNodeUri()
ManagementContext
getManagementNodeUri
in interface ManagementContext
public void setManagementContext(ManagementContextInternal val)
public java.lang.String toString()
toString
in class java.lang.Object
public void setMode(NonDeploymentManagementContext.NonDeploymentManagementContextMode mode)
public NonDeploymentManagementContext.NonDeploymentManagementContextMode getMode()
public java.util.Collection<Application> getApplications()
ManagementContext
getApplications
in interface ManagementContext
public boolean isRunning()
ManagementContext
ManagementContext.isStartupComplete()
.isRunning
in interface ManagementContext
public boolean isStartupComplete()
ManagementContext
ManagementContext.isRunning()
returns true immediately after construction)
but some subsystems (e.g. persistence, OSGi, webapps, entities started at startup)
may not be available until this returns true.
Also see ManagementContext.isStartupComplete()
.
isStartupComplete
in interface ManagementContext
public InternalEntityFactory getEntityFactory()
getEntityFactory
in interface ManagementContextInternal
public InternalLocationFactory getLocationFactory()
getLocationFactory
in interface ManagementContextInternal
public InternalPolicyFactory getPolicyFactory()
getPolicyFactory
in interface ManagementContextInternal
public EntityManager getEntityManager()
ManagementContext
EntityManager
instance for managing/querying entities.getEntityManager
in interface ManagementContext
public LocationManager getLocationManager()
getLocationManager
in interface ManagementContext
public AccessManager getAccessManager()
getAccessManager
in interface ManagementContextInternal
public UsageManager getUsageManager()
getUsageManager
in interface ManagementContextInternal
public Maybe<OsgiManager> getOsgiManager()
getOsgiManager
in interface ManagementContextInternal
public AccessController getAccessController()
ManagementContext
AccessController
.getAccessController
in interface ManagementContext
public ExecutionManager getExecutionManager()
ManagementContext
ExecutionManager
instance for entities and users in this management realm
to submit tasks and to observe what tasks are occurringgetExecutionManager
in interface ManagementContext
public QueueingSubscriptionManager 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)getSubscriptionManager
in interface ManagementContext
public SubscriptionContext getSubscriptionContext(Entity entity)
ManagementContext
SubscriptionContext
instance representing subscriptions
(from the SubscriptionManager
) associated with this entity, and capable
of conveniently subscribing on behalf of that entitygetSubscriptionContext
in interface ManagementContext
public ExecutionContext getExecutionContext(Entity entity)
ManagementContext
ExecutionContext
instance representing tasks
(from the ExecutionManager
) associated with this entity, and capable
of conveniently running such tasks which will be associated with that entitygetExecutionContext
in interface ManagementContext
public ExecutionContext getServerExecutionContext()
ManagementContext
ExecutionContext
within the ExecutionManager
for tasks
associated to the Brooklyn node's operation (not any entities).getServerExecutionContext
in interface ManagementContext
public EntityDriverManager getEntityDriverManager()
ManagementContext
EntityDriverManager
entities can use to create drivers. This
manager can also be used to programmatically customize which driver type to use
for entities in different locations.
The default strategy for choosing a driver is to use a naming convention:
DriverDependentEntity.getDriverInterface()
returns the interface that the
driver must implement; its name should end in "Driver". For example, this suffix is
replaced with "SshDriver" for SshMachineLocation, for example.getEntityDriverManager
in interface ManagementContext
public DownloadResolverManager getEntityDownloadsManager()
ManagementContext
DownloadResolverManager
for resolving things like which URL to download an installer from.
The default DownloadResolverManager
will retrieve entity.getAttribute(Attributes.DOWNLOAD_URL)
,
and substitute things like "${version}" etc.
However, additional resolvers can be registered to customize this behaviour (e.g. to always go to an
enterprise's repository).getEntityDownloadsManager
in interface ManagementContext
public StringConfigMap getConfig()
ManagementContext
getConfig
in interface ManagementContext
public BrooklynProperties getBrooklynProperties()
getBrooklynProperties
in interface ManagementContextInternal
public BrooklynStorage getStorage()
getStorage
in interface ManagementContextInternal
public RebindManager getRebindManager()
getRebindManager
in interface ManagementContext
public HighAvailabilityManager getHighAvailabilityManager()
getHighAvailabilityManager
in interface ManagementContext
public LocationRegistry getLocationRegistry()
ManagementContext
getLocationRegistry
in interface ManagementContext
public BrooklynCatalog getCatalog()
ManagementContext
getCatalog
in interface ManagementContext
public java.lang.ClassLoader getCatalogClassLoader()
ManagementContext
getCatalogClassLoader
in interface ManagementContext
public EntitlementManager getEntitlementManager()
ManagementContext
getEntitlementManager
in interface ManagementContext
public <T> T invokeEffectorMethodSync(Entity entity, Effector<T> eff, java.lang.Object args) throws java.util.concurrent.ExecutionException
invokeEffectorMethodSync
in interface ManagementContextInternal
java.util.concurrent.ExecutionException
public <T> Task<T> invokeEffector(Entity entity, Effector<T> eff, java.util.Map parameters)
invokeEffector
in interface ManagementContextInternal
public java.lang.ClassLoader getBaseClassLoader()
getBaseClassLoader
in interface ManagementContextInternal
public java.lang.Iterable<java.net.URL> getBaseClassPathForScanning()
getBaseClassPathForScanning
in interface ManagementContextInternal
public void addEntitySetListener(CollectionChangeListener<Entity> listener)
addEntitySetListener
in interface ManagementContextInternal
public void removeEntitySetListener(CollectionChangeListener<Entity> listener)
removeEntitySetListener
in interface ManagementContextInternal
public void terminate()
terminate
in interface ManagementContextInternal
public long getTotalEffectorInvocations()
getTotalEffectorInvocations
in interface ManagementContextInternal
public void setBaseClassPathForScanning(java.lang.Iterable<java.net.URL> urls)
setBaseClassPathForScanning
in interface ManagementContextInternal
public void setManagementNodeUri(java.net.URI uri)
setManagementNodeUri
in interface ManagementContextInternal
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.
prePreManage
in interface ManagementContextInternal
public void prePreManage(Location location)
ManagementContextInternal
prePreManage
in interface ManagementContextInternal
public void reloadBrooklynProperties()
ManagementContext
brooklyn.properties
. Any changes will apply only to newly created applicationsreloadBrooklynProperties
in interface ManagementContext
public void addPropertiesReloadListener(ManagementContext.PropertiesReloadListener listener)
ManagementContext
addPropertiesReloadListener
in interface ManagementContext
public void removePropertiesReloadListener(ManagementContext.PropertiesReloadListener listener)
ManagementContext
removePropertiesReloadListener
in interface ManagementContext
public BrooklynObject lookup(java.lang.String id)
ManagementContext
ManagementContext.lookup(String, Class)
but not constraining the return typelookup
in interface ManagementContext
public <T extends BrooklynObject> T lookup(java.lang.String id, java.lang.Class<T> type)
ManagementContext
lookup
in interface ManagementContext
public java.util.List<java.lang.Throwable> errors()
ManagementContextInternal
errors
in interface ManagementContextInternal
public CatalogInitialization getCatalogInitialization()
getCatalogInitialization
in interface ManagementContextInternal
public void setCatalogInitialization(CatalogInitialization catalogInitialization)
setCatalogInitialization
in interface ManagementContextInternal