Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Este contenido no está disponible en el idioma seleccionado.
31.4. Publishing a Service in an OSGi Container
Overview Copiar enlaceEnlace copiado en el portapapeles!
The bundle activator interface Copiar enlaceEnlace copiado en el portapapeles!
org.osgi.framework.BundleActivator
interface. The BundleActivator
interface, shown in Example 31.4, “Bundle Activator Interface”, it has two methods that need to be implemented.
Example 31.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 Copiar enlaceEnlace copiado en el portapapeles!
- Instantiate an
javax.xml.ws.Endpoint
object 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 31.5. Bundle Activator Start Method for Publishing an Endpoint
Implementing the stop method Copiar enlaceEnlace copiado en el portapapeles!
Example 31.6. Bundle Activator Stop Method for Stopping an Endpoint
Informing the container Copiar enlaceEnlace copiado en el portapapeles!
com.widgetvendor.osgi.widgetActivator
.
Example 31.7. Bundle Activator Manifest Entry
Bundle-Activator: com.widgetvendor.osgi.widgetActivator
Bundle-Activator: com.widgetvendor.osgi.widgetActivator