Top Description Methods
org.osgi.framework.hooks.service

public Interface EventHook

Annotations
@ConsumerType
Imports
java.util.Collection, org.osgi.annotation.versioning.ConsumerType, org.osgi.framework.BundleContext, .ServiceEvent

Deprecated

As of 1.1. Replaced by EventListenerHook.

OSGi Framework Service Event Hook Service.

Bundles registering this service will be called during framework service (register, modify, and unregister service) operations.

Author
$Id: b8c500c6f09cc25e3a6294489b7e6a1d458d5e6f $

Method Summary

Modifier and TypeMethod and Description
public void
event(ServiceEvent
The service event to be delivered.
event
,
Collection<BundleContext>
A collection of Bundle Contexts for bundles which have listeners to which the specified event will be delivered. The implementation of this method may remove bundle contexts from the collection to prevent the event from being delivered to the associated bundles. The collection supports all the optional Collection operations except add and addAll. Attempting to add to the collection will result in an UnsupportedOperationException. The collection is not synchronized.
contexts
)

Event hook method.

Method Detail

eventback to summary
public void event(ServiceEvent event, Collection<BundleContext> contexts)

Event hook method. This method is called prior to service event delivery when a publishing bundle registers, modifies or unregisters a service. This method can filter the bundles which receive the event.

Parameters
event:ServiceEvent

The service event to be delivered.

contexts:Collection<BundleContext>

A collection of Bundle Contexts for bundles which have listeners to which the specified event will be delivered. The implementation of this method may remove bundle contexts from the collection to prevent the event from being delivered to the associated bundles. The collection supports all the optional Collection operations except add and addAll. Attempting to add to the collection will result in an UnsupportedOperationException. The collection is not synchronized.