Interface InjectableComponent<R>
- All Known Subinterfaces:
CheckRelayCountFilter
- All Known Implementing Classes:
HomeFilter
public interface InjectableComponent<R>
-
Method Summary
Modifier and TypeMethodDescriptionapply()
Creates the result based on the set configuration.static <R,
I extends InjectableComponent<R>>
Rinject
(org.osgi.framework.BundleContext context, Class<I> clazz, InjectableComponentConfig componentConfig) Tries to get the value from anInjectableComponent
and returns it.default void
setProperties
(Map<String, ?> properties) Sets the properties of the component.
-
Method Details
-
inject
static <R,I extends InjectableComponent<R>> R inject(org.osgi.framework.BundleContext context, Class<I> clazz, InjectableComponentConfig componentConfig) throws Exception Tries to get the value from anInjectableComponent
and returns it.- Type Parameters:
R
- the type of the resultI
- the type of theInjectableComponent
- Parameters:
context
- the context to get the service withclazz
- theClass
of theInjectableComponent
componentConfig
- theComponentConfiguration
- Returns:
- the result or null if the service was not found
- Throws:
Exception
- in service injection error
-
setProperties
Sets the properties of the component.- Parameters:
properties
- the properties map
-
apply
R apply()Creates the result based on the set configuration.- Returns:
- the result
-