To be able to successfully use SAT's Managed Service and Managed Service Factory support, it is helpful to understand how events are handled. The following diagrams are intended to help understand where events come from and how they are dispatched to the advisor for handling. As you read this section, refer to both the discussion and the implementation of the examples since this will aid your understanding.
There are two types of events to consider, synchronous and asynchronous. events.
IBundleActivationManager is created and started.
createImportedServiceFilters is called on
the advisor. The advisor's implementation of the
createImportedServiceFilters method calls the manager's
addImportServiceFilter method that causes the manager's
imported services to be released and/or acquired to match the
specified LDAP filters.ManagedServiceFactory's configuration is deleted the
IBundleActivationManager associated with the
configuration is stopped, causing the manager's imported services to
be released. As the manager's imported services are released
asynchronous Service Released
Events arrive.
Synchronous event also arrive from the OSGi framework when the bundle
that registered the ManagedService or
ManagedServiceFactory is stopped.
IBundleActivationManager for each configuration is also
stopped. When a manager stops its imported services are released.
As services are released
asynchronous Service Released
Events arrive.
create method is called to create an
object associated with the configuration. This object is returned
and managed by SAT.
destroy
method to be called and the object associated with the configuration
destroyed. Subsequent events are ignored.
While the details of where events come from and how they are handled can be rather complicated studying the diagram and the example while implementing a Managed Service or Managed Service Factory is highly recommended.
Copyright © 2001, 2008 IBM Corporation and others. All Rights Reserved.