public class WebservicePublisher
extends ServiceTracker
org.eclipse.smila.ws
and tries to publish them as a JAX-WS webservice. The
value of the property gives the webservice name. The publisher does not check if the service implementor is really a
JAX-WS service implementor (i.e. has the correct annotations and such), but leaves this to JAX-WS, so you will get
JAX-WS exceptions when trying to publish services that are not suitable as a webservice.
Some properties are configured in the configuration file webservice.properties. See the bundle for a example
file.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_WEBSERVICENAME
name of property of tracked services.
|
static java.lang.String |
PROPERTY_FILENAME
filename of my config file.
|
Constructor and Description |
---|
WebservicePublisher(BundleContext bundleContext)
create instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
addingService(ServiceReference reference) |
void |
close()
stop the service tracker, stop all published webservices, clean up.
|
void |
open()
start the service tracker, read the configuration.
|
void |
publishWebservice(ServiceReference reference,
java.lang.Object implementor)
publish a webservice for a tracked service.
|
void |
removedService(ServiceReference reference,
java.lang.Object service) |
void |
stopWebservice(ServiceReference reference)
stop a published webservice.
|
public static final java.lang.String PROP_WEBSERVICENAME
public static final java.lang.String PROPERTY_FILENAME
public WebservicePublisher(BundleContext bundleContext)
bundleContext
- bundle context.public void open()
public void close()
public java.lang.Object addingService(ServiceReference reference)
public void removedService(ServiceReference reference, java.lang.Object service)
public void publishWebservice(ServiceReference reference, java.lang.Object implementor)
reference
- service reference for added service.implementor
- service implementor.public void stopWebservice(ServiceReference reference)
reference
- service reference for deactivated service.