public abstract class AbstractManagementContext extends java.lang.Object implements ManagementContextInternal
ManagementContext.PropertiesReloadListenerBROOKLYN_CATALOG_URL, EFFECTOR_TAG, NON_TRANSIENT_TASK_TAG, SUB_TASK_TAG, TRANSIENT_TASK_TAG| Constructor and Description |
|---|
AbstractManagementContext(BrooklynProperties brooklynProperties) |
AbstractManagementContext(BrooklynProperties brooklynProperties,
DataGridFactory datagridFactory) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addEntitySetListener(CollectionChangeListener<Entity> listener) |
java.lang.ClassLoader |
getBaseClassLoader()
Optional class-loader that this management context should use as its base,
as the first-resort in the catalog, and for scanning (if scanning the default in the catalog).
|
java.lang.Iterable<java.net.URL> |
getBaseClassPathForScanning() |
BrooklynProperties |
getBrooklynProperties() |
BrooklynCatalog |
getCatalog()
Record of configured Brooklyn entities (and templates and policies) which can be loaded
|
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. |
ExecutionContext |
getExecutionContext(Entity e)
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 |
BrooklynGarbageCollector |
getGarbageCollector() |
HighAvailabilityManager |
getHighAvailabilityManager() |
LocationRegistry |
getLocationRegistry()
Record of configured locations and location resolvers
|
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.
|
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 e)
Returns a
SubscriptionContext instance representing subscriptions
(from the SubscriptionManager) associated with this entity, and capable
of conveniently subscribing on behalf of that entity |
long |
getTotalEffectorInvocations() |
<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)
Method for entity to make effector happen with correct semantics (right place, right task context),
when a method is called on that entity.
|
abstract boolean |
isManagedLocally(Entity e)
Whether the master entity record is local, and sensors and effectors can be properly accessed locally.
|
boolean |
isRunning()
Whether this management context is still running, or has been terminated.
|
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
|
abstract void |
removeEntitySetListener(CollectionChangeListener<Entity> listener) |
abstract <T> Task<T> |
runAtEntity(java.util.Map flags,
Entity entity,
java.util.concurrent.Callable<T> c)
Deprecated.
since 0.6.0 use effectors (or support
runAtEntity(Entity, Effector, Map) if something else is needed);
(Callable with Map flags is too open-ended, bothersome to support, and not used much) |
void |
setBaseClassLoader(java.lang.ClassLoader cl)
See
getBaseClassLoader(). |
void |
setBaseClassPathForScanning(java.lang.Iterable<java.net.URL> urls)
Optional mechanism for setting the classpath which should be scanned by the catalog, if the catalog
is scanning the default classpath.
|
void |
setManagementNodeUri(java.net.URI uri) |
void |
terminate() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccessManager, getEntityFactory, getLocationFactory, getOsgiManager, getPolicyFactory, getUsageManager, prePreManage, prePreManageaddPropertiesReloadListener, getAccessController, getApplications, getEntityManager, getExecutionManager, getLocationManager, getManagementNodeId, getManagementPlaneId, getSubscriptionManager, reloadBrooklynProperties, removePropertiesReloadListenerpublic AbstractManagementContext(BrooklynProperties brooklynProperties)
public AbstractManagementContext(BrooklynProperties brooklynProperties, DataGridFactory datagridFactory)
public void terminate()
terminate in interface ManagementContextInternalpublic boolean isRunning()
ManagementContextisRunning in interface ManagementContextpublic BrooklynStorage getStorage()
getStorage in interface ManagementContextInternalpublic RebindManager getRebindManager()
getRebindManager in interface ManagementContextpublic HighAvailabilityManager getHighAvailabilityManager()
getHighAvailabilityManager in interface ManagementContextpublic long getTotalEffectorInvocations()
getTotalEffectorInvocations in interface ManagementContextInternalpublic ExecutionContext getExecutionContext(Entity e)
ManagementContextExecutionContext 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 ManagementContextpublic ExecutionContext getServerExecutionContext()
ManagementContextExecutionContext within the ExecutionManager for tasks
associated to the Brooklyn node's operation (not any entities).getServerExecutionContext in interface ManagementContextpublic SubscriptionContext getSubscriptionContext(Entity e)
ManagementContextSubscriptionContext instance representing subscriptions
(from the SubscriptionManager) associated with this entity, and capable
of conveniently subscribing on behalf of that entitygetSubscriptionContext in interface ManagementContextpublic EntityDriverManager getEntityDriverManager()
ManagementContextEntityDriverManager 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 ManagementContextpublic DownloadResolverManager getEntityDownloadsManager()
ManagementContextDownloadResolverManager 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 ManagementContextpublic EntitlementManager getEntitlementManager()
ManagementContextgetEntitlementManager in interface ManagementContextpublic <T> Task<T> invokeEffector(Entity entity, Effector<T> eff, java.util.Map parameters)
invokeEffector in interface ManagementContextInternalpublic <T> T invokeEffectorMethodSync(Entity entity, Effector<T> eff, java.lang.Object args) throws java.util.concurrent.ExecutionException
invokeEffectorMethodSync in interface ManagementContextInternaljava.util.concurrent.ExecutionExceptionpublic abstract boolean isManagedLocally(Entity e)
@Deprecated public abstract <T> Task<T> runAtEntity(java.util.Map flags, Entity entity, java.util.concurrent.Callable<T> c)
runAtEntity(Entity, Effector, Map) if something else is needed);
(Callable with Map flags is too open-ended, bothersome to support, and not used much)public abstract void addEntitySetListener(CollectionChangeListener<Entity> listener)
addEntitySetListener in interface ManagementContextInternalpublic abstract void removeEntitySetListener(CollectionChangeListener<Entity> listener)
removeEntitySetListener in interface ManagementContextInternalpublic StringConfigMap getConfig()
ManagementContextgetConfig in interface ManagementContextpublic BrooklynProperties getBrooklynProperties()
getBrooklynProperties in interface ManagementContextInternalpublic LocationRegistry getLocationRegistry()
ManagementContextgetLocationRegistry in interface ManagementContextpublic BrooklynCatalog getCatalog()
ManagementContextgetCatalog in interface ManagementContextpublic java.lang.ClassLoader getBaseClassLoader()
getBaseClassLoader in interface ManagementContextInternalpublic void setBaseClassLoader(java.lang.ClassLoader cl)
getBaseClassLoader(). Only settable once and must be invoked before catalog is loaded.public void setBaseClassPathForScanning(java.lang.Iterable<java.net.URL> urls)
Only settable once, before catalog is loaded.
ClasspathHelper.forJavaClassPath() is often a good argument to pass.
setBaseClassPathForScanning in interface ManagementContextInternalpublic java.lang.Iterable<java.net.URL> getBaseClassPathForScanning()
getBaseClassPathForScanning in interface ManagementContextInternalsetBaseClassPathForScanning(Iterable)public BrooklynGarbageCollector getGarbageCollector()
public void setManagementNodeUri(java.net.URI uri)
setManagementNodeUri in interface ManagementContextInternalpublic Maybe<java.net.URI> getManagementNodeUri()
ManagementContextgetManagementNodeUri in interface ManagementContextpublic BrooklynObject lookup(java.lang.String id)
ManagementContextManagementContext.lookup(String, Class) but not constraining the return typelookup in interface ManagementContextpublic <T extends BrooklynObject> T lookup(java.lang.String id, java.lang.Class<T> type)
ManagementContextlookup in interface ManagementContext