Top Description Methods
org.osgi.service.cdi.reference

public Interface BindServiceReference<S>

Annotations
@ProviderType
Type Parameters
<S>
the service argument type.
Imports
java.util.function.BiConsumer, .Consumer, org.osgi.annotation.versioning.ProviderType, org.osgi.framework.ServiceReference, org.osgi.service.cdi.annotations.Reference

A bean provided by CCR for binding actions to life cycle events of matching services.
Author
$Id: d53129023c283916af4c5685b41501ae2fa098eb $
See Also
Reference

Method Summary

Modifier and TypeMethod and Description
public BindServiceReference<S>

Returns:

self
adding
(Consumer<ServiceReference<S>>
the action, whose argument is the service reference, to subscribe to the adding service event
action
)

Subscribe an action to the adding service event.

public BindServiceReference<S>

Returns:

self
adding
(BiConsumer<ServiceReference<S>, S>
the action, whose arguments are the service reference and the service object, to subscribe to the adding service event
action
)

Subscribe an action to the adding service event.

public void
bind()

The bind terminal operation is required to instruct CCR that all the bind actions have been specified, otherwise bind actions will never be called by CCR.

public BindServiceReference<S>

Returns:

self
modified
(Consumer<ServiceReference<S>>
the action, whose argument is the service reference, to subscribe to the modified service event
action
)

Subscribe an action to the modified service event.

public BindServiceReference<S>

Returns:

self
modified
(BiConsumer<ServiceReference<S>, S>
the action, whose arguments are the service reference and the service object, to subscribe to the modified service event
action
)

Subscribe an action to the modified service event.

public BindServiceReference<S>

Returns:

self
removed
(Consumer<ServiceReference<S>>
the action, whose argument is the service reference, to subscribe to the removed service event
action
)

Subscribe an action to the removed service event.

public BindServiceReference<S>

Returns:

self
removed
(BiConsumer<ServiceReference<S>, S>
the action, whose arguments are the service reference and the service object, to subscribe to the removed service event
action
)

Subscribe an action to the removed service event.

Method Detail

addingback to summary
public BindServiceReference<S> adding(Consumer<ServiceReference<S>> action)

Subscribe an action to the adding service event.

Only the last adding action is used.

Parameters
action:Consumer<ServiceReference<S>>

the action, whose argument is the service reference, to subscribe to the adding service event

Returns:BindServiceReference<S>

self

Exceptions
IllegalStateException:
when called after bind
addingback to summary
public BindServiceReference<S> adding(BiConsumer<ServiceReference<S>, S> action)

Subscribe an action to the adding service event.

Only the last adding action is used.

Parameters
action:BiConsumer<ServiceReference<S>, S>

the action, whose arguments are the service reference and the service object, to subscribe to the adding service event

Returns:BindServiceReference<S>

self

Exceptions
IllegalStateException:
when called after bind
bindback to summary
public void bind()

The bind terminal operation is required to instruct CCR that all the bind actions have been specified, otherwise bind actions will never be called by CCR.

Calling bind again has no effect.

modifiedback to summary
public BindServiceReference<S> modified(Consumer<ServiceReference<S>> action)

Subscribe an action to the modified service event.

Only the last modified action is used.

Parameters
action:Consumer<ServiceReference<S>>

the action, whose argument is the service reference, to subscribe to the modified service event

Returns:BindServiceReference<S>

self

Exceptions
IllegalStateException:
when called after bind
modifiedback to summary
public BindServiceReference<S> modified(BiConsumer<ServiceReference<S>, S> action)

Subscribe an action to the modified service event.

Only the last modified action is used.

Parameters
action:BiConsumer<ServiceReference<S>, S>

the action, whose arguments are the service reference and the service object, to subscribe to the modified service event

Returns:BindServiceReference<S>

self

Exceptions
IllegalStateException:
when called after bind
removedback to summary
public BindServiceReference<S> removed(Consumer<ServiceReference<S>> action)

Subscribe an action to the removed service event.

Only the last removed action is used.

Parameters
action:Consumer<ServiceReference<S>>

the action, whose argument is the service reference, to subscribe to the removed service event

Returns:BindServiceReference<S>

self

Exceptions
IllegalStateException:
when called after bind
removedback to summary
public BindServiceReference<S> removed(BiConsumer<ServiceReference<S>, S> action)

Subscribe an action to the removed service event.

Only the last removed action is used.

Parameters
action:BiConsumer<ServiceReference<S>, S>

the action, whose arguments are the service reference and the service object, to subscribe to the removed service event

Returns:BindServiceReference<S>

self

Exceptions
IllegalStateException:
when called after bind