Class BindMethod
java.lang.Object
org.apache.felix.scr.impl.inject.methods.BaseMethod<BindParameters,List<ValueUtils.ValueType>>
org.apache.felix.scr.impl.inject.methods.BindMethod
- All Implemented Interfaces:
ReferenceMethod
- Direct Known Subclasses:
UnbindMethod
,UpdatedMethod
public class BindMethod
extends BaseMethod<BindParameters,List<ValueUtils.ValueType>>
implements ReferenceMethod
Component method to be invoked on service (un)binding.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.felix.scr.impl.inject.methods.BaseMethod
BaseMethod.MethodInfo<T>
-
Field Summary
Fields inherited from interface org.apache.felix.scr.impl.inject.ReferenceMethod
NOPReferenceMethod
-
Constructor Summary
ConstructorsConstructorDescriptionBindMethod
(String methodName, Class<?> componentClass, String referenceClassName, DSVersion dsVersion, boolean configurableServiceProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected BaseMethod.MethodInfo
<List<ValueUtils.ValueType>> doFindMethod
(Class<?> targetClass, boolean acceptPrivate, boolean acceptPackage, ComponentLogger logger) Finds the method named in theBaseMethod.m_methodName
field in the giventargetClass
.protected String
protected Object[]
getParameters
(Method method, BindParameters bp) Returns the parameter array created from therawParameter
using the actual parameter type list of themethod
.<S,
T> boolean getServiceObject
(BindParameters parameters, org.osgi.framework.BundleContext context) protected void
setTypes
(List<ValueUtils.ValueType> types) Methods inherited from class org.apache.felix.scr.impl.inject.methods.BaseMethod
accept, getComponentClass, getDSVersion, getMethod, getMethodName, getPackageName, invoke, isDS12Felix, methodExists, returnValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.felix.scr.impl.inject.ReferenceMethod
invoke
-
Constructor Details
-
BindMethod
-
-
Method Details
-
doFindMethod
protected BaseMethod.MethodInfo<List<ValueUtils.ValueType>> doFindMethod(Class<?> targetClass, boolean acceptPrivate, boolean acceptPackage, ComponentLogger logger) throws SuitableMethodNotAccessibleException, InvocationTargetException Finds the method named in theBaseMethod.m_methodName
field in the giventargetClass
. If the target class has no acceptable method the class hierarchy is traversed until a method is found or the root of the class hierarchy is reached without finding a method.- Specified by:
doFindMethod
in classBaseMethod<BindParameters,
List<ValueUtils.ValueType>> - Parameters:
targetClass
- The class in which to look for the methodacceptPrivate
-true
if private methods should be considered.acceptPackage
-true
if package private methods should be considered.logger
-- Returns:
- The requested method or
null
if no acceptable method can be found in the target class or any super class. - Throws:
InvocationTargetException
- If an unexpected Throwable is caught trying to find the requested method.SuitableMethodNotAccessibleException
-
setTypes
- Specified by:
setTypes
in classBaseMethod<BindParameters,
List<ValueUtils.ValueType>>
-
getServiceObject
public <S,T> boolean getServiceObject(BindParameters parameters, org.osgi.framework.BundleContext context) - Specified by:
getServiceObject
in interfaceReferenceMethod
-
getParameters
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<BindParameters,
List<ValueUtils.ValueType>> - Parameters:
method
-bp
-- Returns:
-
getMethodNamePrefix
- Overrides:
getMethodNamePrefix
in classBaseMethod<BindParameters,
List<ValueUtils.ValueType>>
-