Class ActivateMethod
- java.lang.Object
-
- org.apache.felix.scr.impl.inject.methods.BaseMethod<ActivatorParameter,java.lang.Object>
-
- org.apache.felix.scr.impl.inject.methods.ActivateMethod
-
- All Implemented Interfaces:
LifecycleMethod
- Direct Known Subclasses:
DeactivateMethod
,ModifiedMethod
public class ActivateMethod extends BaseMethod<ActivatorParameter,java.lang.Object> implements LifecycleMethod
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.felix.scr.impl.inject.methods.BaseMethod
BaseMethod.MethodInfo<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_supportsInterfaces
-
Constructor Summary
Constructors Constructor Description ActivateMethod(java.lang.String methodName, boolean methodRequired, java.lang.Class<?> componentClass, DSVersion dsVersion, boolean configurableServiceProperties, boolean supportsInterfaces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 therawParameter
using the actual parameter type list of themethod
.(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, ScrComponentContext componentContext, int reason, MethodResult methodCallFailureResult)
private boolean
isAnnotation(java.lang.Class<?> t1)
(package private) boolean
isDeactivate()
protected void
setTypes(java.lang.Object types)
-
Methods inherited from class org.apache.felix.scr.impl.inject.methods.BaseMethod
accept, getComponentClass, getDSVersion, getMethod, getMethod, getMethodName, getPackageName, getState, isDS12Felix, methodExists, returnValue, setMethod
-
-
-
-
Constructor Detail
-
ActivateMethod
public ActivateMethod(java.lang.String methodName, boolean methodRequired, java.lang.Class<?> componentClass, DSVersion dsVersion, boolean configurableServiceProperties, boolean supportsInterfaces)
-
-
Method Detail
-
doFindMethod
protected BaseMethod.MethodInfo<java.lang.Object> doFindMethod(java.lang.Class<?> targetClass, boolean acceptPrivate, boolean acceptPackage, ComponentLogger logger) throws SuitableMethodNotAccessibleException, java.lang.reflect.InvocationTargetException
- Specified by:
doFindMethod
in classBaseMethod<ActivatorParameter,java.lang.Object>
- Throws:
SuitableMethodNotAccessibleException
java.lang.reflect.InvocationTargetException
-
setTypes
protected void setTypes(java.lang.Object types)
- Specified by:
setTypes
in classBaseMethod<ActivatorParameter,java.lang.Object>
-
isDeactivate
boolean isDeactivate()
-
getSortedMethods
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)- Parameters:
targetClass
- class to examine methods of- Returns:
- sorted methods of correct name;
-
isAnnotation
private boolean isAnnotation(java.lang.Class<?> t1)
-
getParameters
protected java.lang.Object[] getParameters(java.lang.reflect.Method method, ActivatorParameter rawParameter)
Description copied from class:BaseMethod
Returns the parameter array created from therawParameter
using the actual parameter type list of themethod
.- Specified by:
getParameters
in classBaseMethod<ActivatorParameter,java.lang.Object>
- Returns:
-
getMethodNamePrefix
protected java.lang.String getMethodNamePrefix()
- Overrides:
getMethodNamePrefix
in classBaseMethod<ActivatorParameter,java.lang.Object>
-
invoke
public MethodResult invoke(java.lang.Object componentInstance, ScrComponentContext componentContext, int reason, MethodResult methodCallFailureResult)
- Specified by:
invoke
in interfaceLifecycleMethod
- See Also:
LifecycleMethod.invoke(Object, ScrComponentContext, int, MethodResult)
-
invoke
public MethodResult invoke(java.lang.Object componentInstance, ActivatorParameter rawParameter, MethodResult methodCallFailureResult)
Description copied from class:BaseMethod
Calls the declared method on the given component with the provided method call arguments.- Overrides:
invoke
in classBaseMethod<ActivatorParameter,java.lang.Object>
- Parameters:
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.- Returns:
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.
-
-