Service Component Lifecycle
Service Components
A managed bean with an @OsgiServiceProvider
annotation is a service component.
Service Component Dependency
A dependency of a service component bean is any injection point qualified with @OsgiService
. The dependency is available, when a matching OSGi service exists. It is unavailable when no matching OSGi service exists.
Required and Optional Dependencies
All dependencies are required. Support for optional dependencies is planned for a future release.
Lifecycle
Initially, each service component is unavailable.
A service component becomes available when all its dependencies are available. A service component without dependencies becomes available immediately after container start-up.
When a service becomes available, it is registered by the Pax CDI Extender as an OSGi service.
An available service component becomes unavailable when one of its dependencies becomes unavailable. A service component without dependencies becomes unavailable when its bundle is stopped.