Brooklyn

brooklyn.management.internal
[Java] Class EffectorUtils

java.lang.Object
  brooklyn.management.internal.EffectorUtils

public class EffectorUtils

Utility methods for invoking effectors.


Method Summary
static Effector findEffectorMatching(Entity entity, java.lang.reflect.Method method)

static Effector findEffectorMatching(java.util.Set effectors, java.lang.String effectorName, java.util.Map parameters)

static java.lang.Object invokeEffector(AbstractEntity entity, Effector eff, java.lang.Object[] args)

Invokes the effector so that its progress is tracked.

static java.lang.Object invokeEffector(AbstractEntity entity, java.lang.reflect.Method method, java.lang.Object[] args)

Invokes the effector so that its progress is tracked.

static Task invokeEffectorAsync(AbstractEntity entity, Effector eff, java.util.Map parameters)

static java.lang.Object[] oldPrepareArgsForEffector(Effector eff, java.lang.Object args)

Takes arguments, and returns an array of arguments suitable for use by the Effector according to the ParameterTypes it exposes.

static java.lang.Object[] prepareArgsForEffector(Effector eff, java.lang.Object args)

prepares arguments for an effector either accepting: an array, which should contain the arguments in order, optionally omitting those which have defaults defined; or a map, which should contain the arguments by name, again optionally omitting those which have defaults defined, and in this case also performing type coercion.

static java.util.Map prepareArgsForEffectorAsMapFromArray(Effector eff, java.lang.Object[] args)

 
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()
 

Method Detail

findEffectorMatching

public static Effector findEffectorMatching(Entity entity, java.lang.reflect.Method method)


findEffectorMatching

public static Effector findEffectorMatching(java.util.Set effectors, java.lang.String effectorName, java.util.Map parameters)


invokeEffector

public static java.lang.Object invokeEffector(AbstractEntity entity, Effector eff, java.lang.Object[] args)
Invokes the effector so that its progress is tracked.


invokeEffector

public static java.lang.Object invokeEffector(AbstractEntity entity, java.lang.reflect.Method method, java.lang.Object[] args)
Invokes the effector so that its progress is tracked. If the given method is not defined as an effector, then a warning will be logged and the method will be invoked directly.


invokeEffectorAsync

public static Task invokeEffectorAsync(AbstractEntity entity, Effector eff, java.util.Map parameters)


oldPrepareArgsForEffector

public static java.lang.Object[] oldPrepareArgsForEffector(Effector eff, java.lang.Object args)
Takes arguments, and returns an array of arguments suitable for use by the Effector according to the ParameterTypes it exposes. The args can be: 1. an array of ordered arguments 2. a collection (which will be automatically converted to an array) 3. a single argument (which will then be wrapped in an array) 4. a map containing the (named) arguments 5. an array or collection single entry of a map (treated same as 5 above) 6. a semi-populated array or collection that also containing a map as first arg - uses ordered args in array, but uses named values from map in preference. 7. semi-populated array or collection, where default values will otherwise be used.


prepareArgsForEffector

public static java.lang.Object[] prepareArgsForEffector(Effector eff, java.lang.Object args)
prepares arguments for an effector either accepting: an array, which should contain the arguments in order, optionally omitting those which have defaults defined; or a map, which should contain the arguments by name, again optionally omitting those which have defaults defined, and in this case also performing type coercion.


prepareArgsForEffectorAsMapFromArray

public static java.util.Map prepareArgsForEffectorAsMapFromArray(Effector eff, java.lang.Object[] args)


 

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