S
- the service dependency typeB
- the type of a sub interface that may extends this interface.public interface ServiceCallbacksBuilder<S,B extends ServiceCallbacksBuilder<S,B>>
A Service may be injected in a bind-method of a component or an object instance using this builder. The builder supports reflection based callbacks (same as with the original DM API), as well as java8 method reference based callbacks.
List of signatures supported using reflection based callbacks (same as original DM API):
method(S service)
method(S service, Map<String, Object> serviceProperties)
method(S service, Dictionary<String, Object> serviceProperties)
method(ServiceReference<S> serviceRef, S service),
method(ServiceReference<S> serviceRef)
method(ServiceObjects<S> serviceObjects)
method(Component serviceComponent)
method(Component serviceComponent, ServiceReference<S> serviceRef)
method(Component serviceComponent, S service)
method(Component serviceComponent, ServiceReference<S> serviceRef, S service)
swapMethod(S oldService, S newService)
swapMethod(ServiceReference<S> oldRef, S old, ServiceReference<S> newRef, S newService)
swapMethod(ServiceReference<S> oldRef, ServiceReference<S> newRef)
swapMethod(ServiceObjects<S> oldServiceObjects, ServiceObjects<S> newServiceObjects)
swapMethod(Component component, S oldService, S newService)
swapMethod(Component component, ServiceReference<S> oldService, ServiceReference<S> newService)
swapMethod(Component component, ServiceReference<S> oldRef, S old, ServiceReference<S> newRef, S newService)
List of signatures supported using java 8 method references:
method(S service)
method(S service, ServiceReference<S> serviceRef),
method(S service, Map<String, Object> serviceProperties)
method(S service, Dictionary<String, Object> serviceProperties)
method(S service, Component serviceComponent)
method(S service, Component serviceComponent, ServiceReference<S> serviceRef)
method(ServiceReference<S> service)
method(ServiceObjects<S> service)
method(ServiceReference<S> service, Component serviceComponent)
swapMethod(S oldService, S newService)
swapMethod(ServiceReference<> oldRef, ServiceReference<S> newRef)
swapMethod(S oldService, S newService, Component component))
swapMethod(ServiceReference<> oldRef, ServiceReference<S> newRef, Component component)
swapMethod(ServiceReference<S> oldRef, S old, ServiceReference<S> newRef, S newService)
swapMethod(ServiceReference<S> oldRef, S old, ServiceReference<S> newRef, S newService, Component component)
Here is an example of a Component that defines a dependency of a LogService which is injected in the "setLog" method using a ServiceCallbacksBuilder: The withSvc(...)" declaration defines a method reference on the "Pojo::setLog" method (using a lambda):
public class Activator extends DependencyManagerActivator {
public void init(BundleContext ctx, DependencyManager dm) throws Exception {
component(comp -> comp.impl(Pojo.class).withSvc(LogService.class, log -> log.add(Pojo::setLog)));
}
}
Same example, but we inject the dependency to an object instance that we already have in hand:
public class Activator extends DependencyManagerActivator {
public void init(BundleContext ctx, DependencyManager dm) throws Exception {
Pojo impl = new Pojo();
component(comp -> comp.impl(impl).withSvc(LogService.class, log -> log.add(impl::setLog)));
}
}
Here, we inject a service using method reflection (as it is the case in original DM api):
public class Activator extends DependencyManagerActivator {
public void init(BundleContext ctx, DependencyManager dm) throws Exception {
component(comp -> comp.impl(Pojo::class).withSvc(LogService.class, log -> log.add("setLog")));
}
}
Modifier and Type | Method and Description |
---|---|
<T> B |
add(CbRef<T,S> add)
Sets a
component callback(ServiceReference ref) method reference. |
<T> B |
add(CbRefComponent<T,S> add)
Sets a
component callback(ServiceReference ref, Component comp) method reference. |
<T> B |
add(CbService<T,S> add)
Sets a
component callback(Service) method reference. |
<T> B |
add(CbServiceComponent<T,S> add)
Sets a
component callback(Service, Component) method reference. |
<T> B |
add(CbServiceComponentRef<T,S> add)
Sets a
component callback(Service, Component, ServiceReference ref) method reference. |
<T> B |
add(CbServiceDict<T,S> add)
Sets a
component callback(Service, Dictionary<String, Object>) method reference. |
<T> B |
add(CbServiceMap<T,S> add)
Sets a
component callback(Service, Map<String, Object>) method reference. |
<T> B |
add(CbServiceObjects<T,S> add)
Sets a
component callback(ServiceObjects ref) method reference. |
<T> B |
add(CbServiceRef<T,S> add)
Sets a
component callback(Service, ServiceReference) method reference. |
B |
add(InstanceCbRef<S> add)
Sets an
Object instance callback(ServiceReference) method reference. |
B |
add(InstanceCbRefComponent<S> add)
Sets an
Object instance callback(ServiceReference, Component) method reference. |
B |
add(InstanceCbService<S> add)
Sets an
Object instance callback(Service) method reference. |
B |
add(InstanceCbServiceComponent<S> add)
Sets an
Object instance callback(Service, Component) method reference. |
B |
add(InstanceCbServiceComponentRef<S> add)
Sets an
Object instance callback(Service, Component, ServiceReference) method reference. |
B |
add(InstanceCbServiceDict<S> add)
Sets an
Object instance callback(Service svc, Dictionary<String, Object> method reference. |
B |
add(InstanceCbServiceMap<S> add)
Sets an
Object instance callback(Service, Map<String, Object>) method reference. |
B |
add(InstanceCbServiceObjects<S> add)
Sets an
Object instance callback(ServiceObjects) method reference. |
B |
add(InstanceCbServiceRef<S> add)
Sets an
Object instance callback(Service, ServiceReference) method reference. |
B |
add(java.lang.String callback)
Sets a
callback method to invoke when a service is added. |
B |
callbackInstance(java.lang.Object callbackInstance)
Sets the callback instance used for reflection based callbacks.
|
<T> B |
change(CbRef<T,S> change)
Sets a
component callback(ServiceReference) method reference. |
<T> B |
change(CbRefComponent<T,S> change)
Sets a
component callback(ServiceReference, Component comp) method reference. |
<T> B |
change(CbService<T,S> change)
Sets a
component callback(Service) method reference. |
<T> B |
change(CbServiceComponent<T,S> change)
Sets a
component callback(Service, Component) method reference. |
<T> B |
change(CbServiceComponentRef<T,S> change)
Sets a
component callback(Service, Component, ServiceReference) method reference. |
<T> B |
change(CbServiceDict<T,S> change)
Sets a
component callback(Service, Dictionary<String, Object>) method reference. |
<T> B |
change(CbServiceMap<T,S> change)
Sets a
component callback(Service, Map<String, Object>) method reference. |
<T> B |
change(CbServiceObjects<T,S> change)
Sets a
component callback(ServiceObjects) method reference. |
<T> B |
change(CbServiceRef<T,S> change)
Sets a
component callback(Service, ServiceReference) method reference. |
B |
change(InstanceCbRef<S> change)
Sets an
Object instance callback(ServiceReference) method reference. |
B |
change(InstanceCbRefComponent<S> change)
Sets an
Object instance callback(ServiceReference, Component) method reference. |
B |
change(InstanceCbService<S> change)
Sets an
Object instance callback(Service) method reference. |
B |
change(InstanceCbServiceComponent<S> change)
Sets an
Object instance callback(Service, Component) method reference. |
B |
change(InstanceCbServiceComponentRef<S> change)
Sets an
Object instance callback(Service, Component, ServiceReference) method reference. |
B |
change(InstanceCbServiceDict<S> change)
Sets an
Object instance callback(Service, Dictionary<String, Object>) method reference. |
B |
change(InstanceCbServiceMap<S> change)
Sets an
Object instance callback(Service, Map<String, Object>) method reference. |
B |
change(InstanceCbServiceObjects<S> change)
Sets an
Object instance callback(ServiceObjects) method reference. |
B |
change(InstanceCbServiceRef<S> change)
Sets an
Object instance callback(Service, ServiceReference) method reference. |
B |
change(java.lang.String callback)
Sets a
callback methods to invoke when a service is changed. |
B |
dereference(boolean obtainServiceBeforeInjection)
Configures whether or not this dependency should internally obtain the service object for all tracked service references.
|
<T> B |
remove(CbRef<T,S> remove)
Sets a
component callback(ServiceReference) method reference. |
<T> B |
remove(CbRefComponent<T,S> remove)
Sets a
component callback(ServiceReference, Component comp) method reference. |
<T> B |
remove(CbService<T,S> remove)
Sets a
component callback(Service) method reference. |
<T> B |
remove(CbServiceComponent<T,S> remove)
Sets a
component callback(Service, Component) method reference. |
<T> B |
remove(CbServiceComponentRef<T,S> remove)
Sets a
component callback(Service, Component, ServiceReference) method reference. |
<T> B |
remove(CbServiceDict<T,S> remove)
Sets a
component callback(Service, Dictionary<String, Object>) method reference. |
<T> B |
remove(CbServiceMap<T,S> remove)
Sets a
component callback(Service, Map<String, Object></code>) method reference. |
<T> B |
remove(CbServiceObjects<T,S> remove)
Sets a
component callback(ServiceObjects) method reference. |
<T> B |
remove(CbServiceRef<T,S> remove)
Sets a
component callback(Service, ServiceReference) method reference. |
B |
remove(InstanceCbRef<S> remove)
Sets an
Object instance callback(ServiceReference) method reference. |
B |
remove(InstanceCbRefComponent<S> remove)
Sets an
Object instance callback(ServiceReference, Component) method reference. |
B |
remove(InstanceCbService<S> remove)
Sets an
Object instance callback(Service) method reference. |
B |
remove(InstanceCbServiceComponent<S> remove)
Sets an
Object instance callback(Service, Component) method reference. |
B |
remove(InstanceCbServiceComponentRef<S> remove)
Sets an
Object instance callback(Service, Component, ServiceReference) method reference. |
B |
remove(InstanceCbServiceDict<S> remove)
Sets an
Object instance callback(Service, Dictionary<String, Object>) method reference. |
B |
remove(InstanceCbServiceMap<S> remove)
Sets an
Object instance callback(Service, Map<String, Object>) method reference. |
B |
remove(InstanceCbServiceObjects<S> remove)
Sets an
Object instance callback(ServiceObjects) method reference. |
B |
remove(InstanceCbServiceRef<S> remove)
Sets an
Object instance callback(Service, ServiceReference) method reference. |
B |
remove(java.lang.String callback)
Sets a
callback method to invoke when a service is removed. |
<T> B |
swap(CbRefRef<T,S> swap)
Sets a swap
component callback(Service, Service) method reference. |
<T> B |
swap(CbRefRefComponent<T,S> swap)
Sets a swap
component callback(ServiceRefere, ServiceReference, Component) method reference. |
<T> B |
swap(CbRefServiceRefService<T,S> swap)
Sets a swap
component callback(ServiceReference, Service, ServiceReference, Service) method reference. |
<T> B |
swap(CbRefServiceRefServiceComponent<T,S> swap)
Sets a swap
component callback(ServiceReference, Service, ServiceReference, Service, Component method reference. |
<T> B |
swap(CbServiceObjectsServiceObjects<T,S> swap)
Sets a swap
component callback(ServiceObjects, ServiceObjects) method reference. |
<T> B |
swap(CbServiceService<T,S> swap)
Sets a swap
component callback(Service, Service) method reference. |
<T> B |
swap(CbServiceServiceComponent<T,S> swap)
Sets a swap
component callback(Service, Service, Component) method reference. |
B |
swap(InstanceCbRefRef<S> swap)
Sets a swap
instance callback(ServiceReference, ServiceReference) method reference. |
B |
swap(InstanceCbRefRefComponent<S> swap)
Sets a swap
instance callback(ServiceReference, ServiceReference, Component) method reference. |
B |
swap(InstanceCbRefServiceRefService<S> swap)
Sets a swap
instance callback(ServiceReference, Service, ServiceReference, Service) method reference. |
B |
swap(InstanceCbRefServiceRefServiceComponent<S> swap)
Sets a swap
instance callback(ServiceReference, Service, ServiceReference, Service, Component) method reference. |
B |
swap(InstanceCbServiceObjectsServiceObjects<S> swap)
Sets a swap
instance callback(ServiceObjects, ServiceObjects) method reference. |
B |
swap(InstanceCbServiceService<S> swap)
Sets a swap
instance callback(Service, Service) method reference. |
B |
swap(InstanceCbServiceServiceComponent<S> swap)
Sets a swap
instance callback(Service, Service, Component) method reference. |
B |
swap(java.lang.String callback)
Sets a
callback method to invoke when a service is swapped. |
B callbackInstance(java.lang.Object callbackInstance)
callbackInstance
- the object on which reflection based callbacks are invoked on.B add(java.lang.String callback)
callback
method to invoke when a service is added. When a service matches the service
filter, then the service is injected using the specified callback method. The callback is invoked on the component implementation, or on the callback
instance, is specified using the callbackInstance(Object)
method.
The following method signature are supported:
method(S service)
method(S service, Map<String, Object> serviceProperties)
method(S service, Dictionary<String, Object> serviceProperties)
method(ServiceReference<S> serviceRef, S service),
method(ServiceReference<S> serviceRef)
method(Component serviceComponent)
method(Component serviceComponent, ServiceReference<S> serviceRef)
method(Component serviceComponent, S service)
method(Component serviceComponent, ServiceReference<S> serviceRef, S service)
callback
- the add callbackcallbackInstance(Object)
B change(java.lang.String callback)
callback
methods to invoke when a service is changed. When a changed service matches the service
filter, then the service is injected using the specified callback method. The callback is invoked on the component implementation, or on the callback
instance, is specified using the callbackInstance(Object)
method.
The following method signature are supported:
method(S service)
method(S service, Map<String, Object> serviceProperties)
method(S service, Dictionary<String, Object> serviceProperties)
method(ServiceReference<S> serviceRef, S service),
method(ServiceReference<S> serviceRef)
method(Component serviceComponent)
method(Component serviceComponent, ServiceReference<S> serviceRef)
method(Component serviceComponent, S service)
method(Component serviceComponent, ServiceReference<S> serviceRef, S service)
callback
- the change callbackcallbackInstance(Object)
B remove(java.lang.String callback)
callback
method to invoke when a service is removed. When a removed service matches the service
filter, then the specified callback in invoked with the removed service. The callback is invoked on the component implementation, or on the callback
instance, is specified using the callbackInstance(Object)
method.
The following method signature are supported:
method(S service)
method(S service, Map<String, Object> serviceProperties)
method(S service, Dictionary<String, Object> serviceProperties)
method(ServiceReference<S> serviceRef, S service),
method(ServiceReference<S> serviceRef)
method(Component serviceComponent)
method(Component serviceComponent, ServiceReference<S> serviceRef)
method(Component serviceComponent, S service)
method(Component serviceComponent, ServiceReference<S> serviceRef, S service)
callback
- the remove callbackcallbackInstance(Object)
B swap(java.lang.String callback)
callback
method to invoke when a service is swapped. The callback is invoked on the component implementation, or on the callback
instance, is specified using the callbackInstance(Object)
method.
The following method signature are supported:
swapMethod(S oldService, S newService)
swapMethod(ServiceReference<S> oldRef, S old, ServiceReference<S> newRef, S newService)
swapMethod(Component component, S oldService, S newService)
swapMethod(Component component, ServiceReference<S> oldRef, S old, ServiceReference<S> newRef, S newService)
callback
- the remove callbackcallbackInstance(Object)
<T> B add(CbService<T,S> add)
component callback(Service)
method reference. The callback is invoked when a service is added.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.add
- the method reference invoked when a service is added.<T> B change(CbService<T,S> change)
component callback(Service)
method reference. The callback is invoked when a service is changed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.change
- the method reference invoked when a service is changed.<T> B remove(CbService<T,S> remove)
component callback(Service)
method reference. The callback is invoked when a service is removed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.remove
- the method reference invoked when a service is removed.<T> B add(CbServiceMap<T,S> add)
component callback(Service, Map<String, Object>)
method reference. The callback is invoked when a service is added.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.add
- the method reference invoked when a service is added.<T> B change(CbServiceMap<T,S> change)
component callback(Service, Map<String, Object>)
method reference. The callback is invoked when a service is changed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.change
- the method reference invoked when a service is changed.<T> B remove(CbServiceMap<T,S> remove)
component callback(Service, Map<String, Object></code>)
method reference. The callback is invoked when a service is removed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.remove
- the method reference invoked when a service is removed.<T> B add(CbServiceDict<T,S> add)
component callback(Service, Dictionary<String, Object>)
method reference. The callback is invoked when a service is added.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.add
- the method reference invoked when a service is added.<T> B change(CbServiceDict<T,S> change)
component callback(Service, Dictionary<String, Object>)
method reference. The callback is invoked when a service is changed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.change
- the method reference invoked when a service is changed.<T> B remove(CbServiceDict<T,S> remove)
component callback(Service, Dictionary<String, Object>)
method reference. The callback is invoked when a service is removed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.remove
- the method reference invoked when a service is removed.<T> B add(CbServiceRef<T,S> add)
component callback(Service, ServiceReference)
method reference. The callback is invoked when a service is added.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.add
- the method reference invoked when a service is added.<T> B change(CbServiceRef<T,S> change)
component callback(Service, ServiceReference)
method reference. The callback is invoked when a service is changed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.change
- the method reference invoked when a service is changed.<T> B remove(CbServiceRef<T,S> remove)
component callback(Service, ServiceReference)
method reference. The callback is invoked when a service is removed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.remove
- the method reference invoked when a service is removed.<T> B add(CbServiceComponent<T,S> add)
component callback(Service, Component)
method reference. The callback is invoked when a service is added.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.add
- the method reference invoked when a service is added.<T> B change(CbServiceComponent<T,S> change)
component callback(Service, Component)
method reference. The callback is invoked when a service is changed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.change
- the method reference invoked when a service is changed.<T> B remove(CbServiceComponent<T,S> remove)
component callback(Service, Component)
method reference. The callback is invoked when a service is removed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.remove
- the method reference invoked when a service is removed.<T> B add(CbServiceComponentRef<T,S> add)
component callback(Service, Component, ServiceReference ref)
method reference. The callback is invoked when a service is added.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.add
- the method reference invoked when a service is added.<T> B change(CbServiceComponentRef<T,S> change)
component callback(Service, Component, ServiceReference)
method reference. The callback is invoked when a service is changed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.change
- the method reference invoked when a service is changed.<T> B remove(CbServiceComponentRef<T,S> remove)
component callback(Service, Component, ServiceReference)
method reference. The callback is invoked when a service is removed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.remove
- the method reference invoked when a service is removed.<T> B add(CbRef<T,S> add)
component callback(ServiceReference ref)
method reference. The callback is invoked when a service is added.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.add
- the method reference invoked when a service is added.<T> B change(CbRef<T,S> change)
component callback(ServiceReference)
method reference. The callback is invoked when a service is changed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.change
- the method reference invoked when a service is changed.<T> B remove(CbRef<T,S> remove)
component callback(ServiceReference)
method reference. The callback is invoked when a service is removed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.remove
- the method reference invoked when a service is removed.<T> B add(CbServiceObjects<T,S> add)
component callback(ServiceObjects ref)
method reference. The callback is invoked when a service is added.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.add
- the method reference invoked when a service is added.<T> B change(CbServiceObjects<T,S> change)
component callback(ServiceObjects)
method reference. The callback is invoked when a service is changed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.change
- the method reference invoked when a service is changed.<T> B remove(CbServiceObjects<T,S> remove)
component callback(ServiceObjects)
method reference. The callback is invoked when a service is removed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.remove
- the method reference invoked when a service is removed.<T> B add(CbRefComponent<T,S> add)
component callback(ServiceReference ref, Component comp)
method reference. The callback is invoked when a service is added.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.add
- the method reference invoked when a service is added.<T> B change(CbRefComponent<T,S> change)
component callback(ServiceReference, Component comp)
method reference. The callback is invoked when a service is changed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.change
- the method reference invoked when a service is changed.<T> B remove(CbRefComponent<T,S> remove)
component callback(ServiceReference, Component comp)
method reference. The callback is invoked when a service is removed.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.remove
- the method reference invoked when a service is removed.B add(InstanceCbService<S> add)
Object instance callback(Service)
method reference. The callback is invoked when a service is added.
The method reference must point to a method from an Object instance.add
- the method reference invoked when a service is added.B change(InstanceCbService<S> change)
Object instance callback(Service)
method reference. The callback is invoked when a service is changed.
The method reference must point to method from an Object instance.change
- the method reference invoked when a service is changed.B remove(InstanceCbService<S> remove)
Object instance callback(Service)
method reference. The callback is invoked when a service is removed.
The method reference must point to method from an Object instance.remove
- the method reference invoked when a service is removed.B add(InstanceCbServiceMap<S> add)
Object instance callback(Service, Map<String, Object>)
method reference. The callback is invoked when a service is added.
The method reference must point to a method from an Object instance.add
- the method reference invoked when a service is added.B change(InstanceCbServiceMap<S> change)
Object instance callback(Service, Map<String, Object>)
method reference. The callback is invoked when a service is changed.
The method reference must point to method from an Object instance.change
- the method reference invoked when a service is changed.B remove(InstanceCbServiceMap<S> remove)
Object instance callback(Service, Map<String, Object>)
method reference. The callback is invoked when a service is removed.
The method reference must point to method from an Object instance.remove
- the method reference invoked when a service is removed.B add(InstanceCbServiceDict<S> add)
Object instance callback(Service svc, Dictionary<String, Object>
method reference. The callback is invoked when a service is added.
The method reference must point to a method from an Object instance.add
- the method reference invoked when a service is added.B change(InstanceCbServiceDict<S> change)
Object instance callback(Service, Dictionary<String, Object>)
method reference. The callback is invoked when a service is changed.
The method reference must point to method from an Object instance.change
- the method reference invoked when a service is changed.B remove(InstanceCbServiceDict<S> remove)
Object instance callback(Service, Dictionary<String, Object>)
method reference. The callback is invoked when a service is removed.
The method reference must point to method from an Object instance.remove
- the method reference invoked when a service is removed.B add(InstanceCbServiceRef<S> add)
Object instance callback(Service, ServiceReference)
method reference. The callback is invoked when a service is added.
The method reference must point to a method from an Object instance.add
- the method reference invoked when a service is added.B change(InstanceCbServiceRef<S> change)
Object instance callback(Service, ServiceReference)
method reference. The callback is invoked when a service is changed.
The method reference must point to method from an Object instance.change
- the method reference invoked when a service is changed.B remove(InstanceCbServiceRef<S> remove)
Object instance callback(Service, ServiceReference)
method reference. The callback is invoked when a service is removed.
The method reference must point to method from an Object instance.remove
- the method reference invoked when a service is removed.B add(InstanceCbRef<S> add)
Object instance callback(ServiceReference)
method reference. The callback is invoked when a service is added.
The method reference must point to a method from an Object instance.add
- the method reference invoked when a service is added.B change(InstanceCbRef<S> change)
Object instance callback(ServiceReference)
method reference. The callback is invoked when a service is changed.
The method reference must point to method from an Object instance.change
- the method reference invoked when a service is changed.B remove(InstanceCbRef<S> remove)
Object instance callback(ServiceReference)
method reference. The callback is invoked when a service is removed.
The method reference must point to method from an Object instance.remove
- the method reference invoked when a service is removed.B add(InstanceCbServiceObjects<S> add)
Object instance callback(ServiceObjects)
method reference. The callback is invoked when a service is added.
The method reference must point to a method from an Object instance.add
- the method reference invoked when a service is added.B change(InstanceCbServiceObjects<S> change)
Object instance callback(ServiceObjects)
method reference. The callback is invoked when a service is changed.
The method reference must point to method from an Object instance.change
- the method reference invoked when a service is changed.B remove(InstanceCbServiceObjects<S> remove)
Object instance callback(ServiceObjects)
method reference. The callback is invoked when a service is removed.
The method reference must point to method from an Object instance.remove
- the method reference invoked when a service is removed.B add(InstanceCbServiceComponent<S> add)
Object instance callback(Service, Component)
method reference. The callback is when a service is added.
The method reference must point to a method from an Object instance.add
- the method reference invoked when a service is added.B change(InstanceCbServiceComponent<S> change)
Object instance callback(Service, Component)
method reference. The callback is when a service is changed.
The method reference must point to method from an Object instance.change
- the method reference invoked when a service is changed.B remove(InstanceCbServiceComponent<S> remove)
Object instance callback(Service, Component)
method reference. The callback is invoked when a service is removed.
The method reference must point to method from an Object instance.remove
- the method reference invoked when a service is removed.B add(InstanceCbServiceComponentRef<S> add)
Object instance callback(Service, Component, ServiceReference)
method reference. The callback is invoked when a service is added.
The method reference must point to a method from an Object instance.add
- the method reference invoked when a service is added.B change(InstanceCbServiceComponentRef<S> change)
Object instance callback(Service, Component, ServiceReference)
method reference. The callback is invoked when a service is changed.
The method reference must point to method from an Object instance.change
- the method reference invoked when a service is changed.B remove(InstanceCbServiceComponentRef<S> remove)
Object instance callback(Service, Component, ServiceReference)
method reference. The callback is invoked when a service is removed.
The method reference must point to method from an Object instance.remove
- the method reference invoked when a service is removed.B add(InstanceCbRefComponent<S> add)
Object instance callback(ServiceReference, Component)
method reference. The callback is invoked when a service is added.
The method reference must point to a method from an Object instance.add
- the method reference invoked when a service is added.B change(InstanceCbRefComponent<S> change)
Object instance callback(ServiceReference, Component)
method reference. The callback is invoked when a service is changed.
The method reference must point to method from an Object instance.change
- the method reference invoked when a service is changed.B remove(InstanceCbRefComponent<S> remove)
Object instance callback(ServiceReference, Component)
method reference. The callback is invoked when a service is removed.
The method reference must point to method from an Object instance.remove
- the method reference invoked when a service is removed.<T> B swap(CbServiceService<T,S> swap)
component callback(Service, Service)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.swap
- the method reference invoked when the service is swapped.<T> B swap(CbRefRef<T,S> swap)
component callback(Service, Service)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.swap
- the method reference invoked when the service is swapped.<T> B swap(CbServiceObjectsServiceObjects<T,S> swap)
component callback(ServiceObjects, ServiceObjects)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.swap
- the method reference invoked when the service is swapped.<T> B swap(CbServiceServiceComponent<T,S> swap)
component callback(Service, Service, Component)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.swap
- the method reference invoked when the service is swapped.<T> B swap(CbRefRefComponent<T,S> swap)
component callback(ServiceRefere, ServiceReference, Component)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a Component implementation class method.T
- the type of the component implementation class on which the callback is invoked.swap
- the method reference invoked when the service is swapped.<T> B swap(CbRefServiceRefService<T,S> swap)
component callback(ServiceReference, Service, ServiceReference, Service)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a Component implementation class method.
the new service.T
- the type of the component implementation class on which the callback is invoked.swap
- the method reference invoked when the service is swapped.<T> B swap(CbRefServiceRefServiceComponent<T,S> swap)
component callback(ServiceReference, Service, ServiceReference, Service, Component
method reference. The callback is invoked when a service is swapped.
The method reference must point to a Component implementation class method.
the new service.T
- the type of the component implementation class on which the callback is invoked.swap
- the method reference invoked when the service is swapped.B swap(InstanceCbServiceService<S> swap)
instance callback(Service, Service)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a method from an Object instance.swap
- the method reference invoked when the service is swapped.B swap(InstanceCbRefRef<S> swap)
instance callback(ServiceReference, ServiceReference)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a method from an Object instance.swap
- the method reference invoked when the service is swapped.B swap(InstanceCbServiceObjectsServiceObjects<S> swap)
instance callback(ServiceObjects, ServiceObjects)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a method from an Object instance.swap
- the method reference invoked when the service is swapped.B swap(InstanceCbRefRefComponent<S> swap)
instance callback(ServiceReference, ServiceReference, Component)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a method from an Object instance.swap
- the method reference invoked when the service is swapped.B swap(InstanceCbServiceServiceComponent<S> swap)
instance callback(Service, Service, Component)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a method from an Object instance.swap
- the method reference invoked when the service is swapped.B swap(InstanceCbRefServiceRefService<S> swap)
instance callback(ServiceReference, Service, ServiceReference, Service)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a method from an Object instance.swap
- the method reference invoked when the service is swapped.B swap(InstanceCbRefServiceRefServiceComponent<S> swap)
instance callback(ServiceReference, Service, ServiceReference, Service, Component)
method reference. The callback is invoked when a service is swapped.
The method reference must point to a method from an Object instance.swap
- the method reference invoked when the service is swapped.B dereference(boolean obtainServiceBeforeInjection)
dereference(false)
method in case you don't want DM to internally dereference the service.
You will use this method typically when you are using a method name as the callback and when for example you want to
dereference yourself the service using the ServiceObjects OSGi API.