Brooklyn

brooklyn.management.internal
[Java] Class AbstractManagementContext

java.lang.Object
  brooklyn.management.internal.AbstractManagementContext
All Implemented Interfaces:
ManagementContextInternal

public abstract class AbstractManagementContext

Field Summary
protected java.lang.ClassLoader baseClassLoader

protected java.lang.Iterable baseClassPathForScanning

protected BasicBrooklynCatalog catalog

protected BrooklynProperties configMap

protected BrooklynGarbageCollector gc

protected BasicLocationRegistry locationRegistry

 
Constructor Summary
AbstractManagementContext(BrooklynProperties brooklynProperties)

 
Method Summary
void addEntitySetListener(CollectionChangeListener 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 getBaseClassPathForScanning()

@See setBaseClassPathForScanning(Iterable)

BrooklynCatalog getCatalog()

StringConfigMap getConfig()

java.util.Collection getEntities()

Entity getEntity(java.lang.String id)

DownloadResolverManager getEntityDownloadsManager()

EntityDriverManager getEntityDriverFactory()

EntityDriverManager getEntityDriverManager()

ExecutionContext getExecutionContext(Entity e)

LocationRegistry getLocationRegistry()

RebindManager getRebindManager()

SubscriptionContext getSubscriptionContext(Entity e)

long getTotalEffectorInvocations()

Task invokeEffector(Entity entity, Effector eff, java.util.Map parameters)

protected java.lang.Object invokeEffectorMethodLocal(Entity entity, Effector eff, java.lang.Object args)

java.lang.Object invokeEffectorMethodSync(Entity entity, Effector 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.

boolean isManaged(Entity e)

boolean isManagedLocally(Entity e)

Whether the master entity record is local, and sensors and effectors can be properly accessed locally.

boolean isRunning()

protected void loadCatalog()

void manage(Entity e)

protected void manageIfNecessary(Entity entity, java.lang.Object context)

void removeEntitySetListener(CollectionChangeListener listener)

Task runAtEntity(java.util.Map flags, Entity entity, java.util.concurrent.Callable c)

Causes the indicated runnable to be run at the right location for the given entity.

void setBaseClassLoader(java.lang.ClassLoader cl)

See getBaseClassLoader().

void setBaseClassPathForScanning(java.lang.Iterable urls)

Optional mechanism for setting the classpath which should be scanned by the catalog, if the catalog is scanning the default classpath.

void terminate()

void unmanage(Entity e)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

baseClassLoader

protected java.lang.ClassLoader baseClassLoader


baseClassPathForScanning

protected java.lang.Iterable baseClassPathForScanning


catalog

protected BasicBrooklynCatalog catalog


configMap

protected BrooklynProperties configMap


gc

protected BrooklynGarbageCollector gc


locationRegistry

protected BasicLocationRegistry locationRegistry


 
Constructor Detail

AbstractManagementContext

public AbstractManagementContext(BrooklynProperties brooklynProperties)


 
Method Detail

addEntitySetListener

public void addEntitySetListener(CollectionChangeListener listener)


getBaseClassLoader

public 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). In most instances the default classloader (ManagementContext.class.getClassLoader(), assuming this was in the JARs used at boot time) is fine, and in those cases this method normally returns null. (Surefire does some weird stuff, but the default classloader is fine for loading; however it requires a custom base classpath to be set for scanning.)


getBaseClassPathForScanning

public java.lang.Iterable getBaseClassPathForScanning()
See:
setBaseClassPathForScanning(Iterable)


getCatalog

@Override
public BrooklynCatalog getCatalog()


getConfig

@Override
public StringConfigMap getConfig()


getEntities

@Deprecated
@Override
public java.util.Collection getEntities()


getEntity

@Deprecated
@Override
public Entity getEntity(java.lang.String id)


getEntityDownloadsManager

@Override
public DownloadResolverManager getEntityDownloadsManager()


getEntityDriverFactory

@Override
public EntityDriverManager getEntityDriverFactory()


getEntityDriverManager

@Override
public EntityDriverManager getEntityDriverManager()


getExecutionContext

public ExecutionContext getExecutionContext(Entity e)


getLocationRegistry

@Override
public LocationRegistry getLocationRegistry()


getRebindManager

@Override
public RebindManager getRebindManager()


getSubscriptionContext

public SubscriptionContext getSubscriptionContext(Entity e)


getTotalEffectorInvocations

public long getTotalEffectorInvocations()


invokeEffector

public Task invokeEffector(Entity entity, Effector eff, @SuppressWarnings("rawtypes") java.util.Map parameters)


invokeEffectorMethodLocal

protected java.lang.Object invokeEffectorMethodLocal(Entity entity, Effector eff, java.lang.Object args)


invokeEffectorMethodSync

public java.lang.Object invokeEffectorMethodSync(Entity entity, Effector 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.
throws:
ExecutionException


isManaged

@Deprecated
@Override
public boolean isManaged(Entity e)


isManagedLocally

public boolean isManagedLocally(Entity e)
Whether the master entity record is local, and sensors and effectors can be properly accessed locally.


isRunning

public boolean isRunning()


loadCatalog

protected void loadCatalog()


manage

@Deprecated
@Override
public void manage(Entity e)


manageIfNecessary

protected void manageIfNecessary(Entity entity, java.lang.Object context)


removeEntitySetListener

public void removeEntitySetListener(CollectionChangeListener listener)


runAtEntity

public Task runAtEntity(@SuppressWarnings("rawtypes") java.util.Map flags, Entity entity, java.util.concurrent.Callable c)
Causes the indicated runnable to be run at the right location for the given entity. Returns the actual task (if it is local) or a proxy task (if it is remote); if management for the entity has not yet started this may start it.


setBaseClassLoader

public void setBaseClassLoader(java.lang.ClassLoader cl)
See getBaseClassLoader(). Only settable once and must be invoked before catalog is loaded.


setBaseClassPathForScanning

public void setBaseClassPathForScanning(java.lang.Iterable urls)
Optional mechanism for setting the classpath which should be scanned by the catalog, if the catalog is scanning the default classpath. Usually it infers the right thing, but some classloaders (e.g. surefire) do funny things which the underlying org.reflections.Reflectiosn library can't see in to.

Only settable once, before catalog is loaded.

ClasspathHelper.forJavaClassPath() is often a good argument to pass.


terminate

public void terminate()


unmanage

@Deprecated
@Override
public void unmanage(Entity e)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.