SMILA 1.0 API documentation

org.eclipse.smila.webservice
Class WebservicePublisher

java.lang.Object
  extended by ServiceTracker
      extended by org.eclipse.smila.webservice.WebservicePublisher

public class WebservicePublisher
extends ServiceTracker

Tracks services with property 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.

Author:
jschumacher

Field Summary
static java.lang.String PROP_WEBSERVICENAME
          name of property of tracked services.
static java.lang.String PROPERTY_FILENAME
          filename of my config file.
 
Constructor Summary
WebservicePublisher(BundleContext bundleContext)
          create instance.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_WEBSERVICENAME

public static final java.lang.String PROP_WEBSERVICENAME
name of property of tracked services.

See Also:
Constant Field Values

PROPERTY_FILENAME

public static final java.lang.String PROPERTY_FILENAME
filename of my config file.

See Also:
Constant Field Values
Constructor Detail

WebservicePublisher

public WebservicePublisher(BundleContext bundleContext)
create instance.

Parameters:
bundleContext - bundle context.
Method Detail

open

public void open()
start the service tracker, read the configuration.


close

public void close()
stop the service tracker, stop all published webservices, clean up.


addingService

public java.lang.Object addingService(ServiceReference reference)


removedService

public void removedService(ServiceReference reference,
                           java.lang.Object service)


publishWebservice

public void publishWebservice(ServiceReference reference,
                              java.lang.Object implementor)
publish a webservice for a tracked service.

Parameters:
reference - service reference for added service.
implementor - service implementor.

stopWebservice

public void stopWebservice(ServiceReference reference)
stop a published webservice.

Parameters:
reference - service reference for deactivated service.

SMILA 1.0 API documentation