Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
8.3. Publishing a Service in an OSGi Container
Overview Link kopierenLink in die Zwischenablage kopiert!
The bundle activator interface Link kopierenLink in die Zwischenablage kopiert!
org.osgi.framework.BundleActivator interface. The BundleActivator interface, shown in Example 8.4, “Bundle Activator Interface”, it has two methods that need to be implemented.
Example 8.4. Bundle Activator Interface
start() method is called by the container when it starts the bundle. This is where you instantiate and publish the endpoints.
stop() method is called by the container when it stops the bundle. This is where you would stop the endpoints.
Implementing the start method Link kopierenLink in die Zwischenablage kopiert!
- Instantiate an
javax.xml.ws.Endpointobject for the service provider. - Create an optional server context to use when publishing the service provider.
- Publish the service provider using one of the
publish()methods.
Example 8.5. Bundle Activator Start Method for Publishing an Endpoint
Implementing the stop method Link kopierenLink in die Zwischenablage kopiert!
Example 8.6. Bundle Activator Stop Method for Stopping an Endpoint
Informing the container Link kopierenLink in die Zwischenablage kopiert!
com.widgetvendor.osgi.widgetActivator.
Example 8.7. Bundle Activator Manifest Entry
Bundle-Activator: com.widgetvendor.osgi.widgetActivator
Bundle-Activator: com.widgetvendor.osgi.widgetActivator