public class ActivateMethod extends BaseMethod<ActivatorParameter,java.lang.Object> implements LifecycleMethod
BaseMethod.MethodInfo<T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
m_supportsInterfaces |
Constructor and Description |
---|
ActivateMethod(java.lang.String methodName,
boolean methodRequired,
java.lang.Class<?> componentClass,
DSVersion dsVersion,
boolean configurableServiceProperties,
boolean supportsInterfaces) |
Modifier and Type | Method and Description |
---|---|
protected BaseMethod.MethodInfo<java.lang.Object> |
doFindMethod(java.lang.Class<?> targetClass,
boolean acceptPrivate,
boolean acceptPackage,
ComponentLogger logger) |
protected java.lang.String |
getMethodNamePrefix() |
protected java.lang.Object[] |
getParameters(java.lang.reflect.Method method,
ActivatorParameter rawParameter)
Returns the parameter array created from the
rawParameter
using the actual parameter type list of the method . |
(package private) java.util.List<java.lang.reflect.Method> |
getSortedMethods(java.lang.Class<?> targetClass)
returns the declared methods of the target class, with the correct name, sorted by number of parameters ( no parameters last)
|
MethodResult |
invoke(java.lang.Object componentInstance,
ActivatorParameter rawParameter,
MethodResult methodCallFailureResult)
Calls the declared method on the given component with the provided
method call arguments.
|
MethodResult |
invoke(java.lang.Object componentInstance,
ComponentContextImpl<?> componentContext,
int reason,
MethodResult methodCallFailureResult) |
private boolean |
isAnnotation(java.lang.Class<?> t1) |
(package private) boolean |
isDeactivate() |
protected void |
setTypes(java.lang.Object types) |
accept, getComponentClass, getDSVersion, getMethod, getMethod, getMethodName, getPackageName, getState, isDS12Felix, methodExists, returnValue, setMethod
public ActivateMethod(java.lang.String methodName, boolean methodRequired, java.lang.Class<?> componentClass, DSVersion dsVersion, boolean configurableServiceProperties, boolean supportsInterfaces)
protected BaseMethod.MethodInfo<java.lang.Object> doFindMethod(java.lang.Class<?> targetClass, boolean acceptPrivate, boolean acceptPackage, ComponentLogger logger) throws SuitableMethodNotAccessibleException, java.lang.reflect.InvocationTargetException
doFindMethod
in class BaseMethod<ActivatorParameter,java.lang.Object>
SuitableMethodNotAccessibleException
java.lang.reflect.InvocationTargetException
protected void setTypes(java.lang.Object types)
setTypes
in class BaseMethod<ActivatorParameter,java.lang.Object>
boolean isDeactivate()
java.util.List<java.lang.reflect.Method> getSortedMethods(java.lang.Class<?> targetClass)
targetClass
- class to examine methods ofprivate boolean isAnnotation(java.lang.Class<?> t1)
protected java.lang.Object[] getParameters(java.lang.reflect.Method method, ActivatorParameter rawParameter)
BaseMethod
rawParameter
using the actual parameter type list of the method
.getParameters
in class BaseMethod<ActivatorParameter,java.lang.Object>
protected java.lang.String getMethodNamePrefix()
getMethodNamePrefix
in class BaseMethod<ActivatorParameter,java.lang.Object>
public MethodResult invoke(java.lang.Object componentInstance, ComponentContextImpl<?> componentContext, int reason, MethodResult methodCallFailureResult)
public MethodResult invoke(java.lang.Object componentInstance, ActivatorParameter rawParameter, MethodResult methodCallFailureResult)
BaseMethod
invoke
in class BaseMethod<ActivatorParameter,java.lang.Object>
componentInstance
- The component instance on which to call the
methodrawParameter
- The parameter container providing the actual
parameters to provide to the called methodmethodCallFailureResult
- The result to return from this method if
calling the method resulted in an exception.true
if the method was called successfully or the
method was not found and was not required. false
if
the method was not found but required.
methodCallFailureResult
is returned if the method was
found and called, but the method threw an exception.