Package org.somda.sdc.dpws.device
Class WebService
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractIdleService
-
- org.somda.sdc.dpws.device.WebService
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,EventSourceAccess,Interceptor
public abstract class WebService extends com.google.common.util.concurrent.AbstractIdleService implements EventSourceAccess, Interceptor
Web Service base class.The Web Service is a server interceptor to process incoming requests of a certain Web Service. Moreover, the Web Service base class is capable of providing an event source to send notifications if needed.
The event source is only set if a hosted service has been registered at the Web Service. The hosted service can be registered by first getting the hosting service access followed by adding a hosted service:
Device.getHostingServiceAccess()to get hosting service access, and thenHostingServiceAccess.addHostedService(HostedService)to add the service to a hosting service.
HostingServiceAccess.addHostedService(HostedService).
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedWebService()Default constructor that initializes a non-functioning event source stub.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsendNotification(String action, Object payload)Sends a notification to all subscribers.protected voidshutDown()protected voidstartUp()voidsubscriptionEndToAll(WsEventingStatus status)Sends a subscription end message to all subscribers and shut down connected subscriptions.
-
-
-
Method Detail
-
sendNotification
public void sendNotification(String action, Object payload)
Description copied from interface:EventSourceAccessSends a notification to all subscribers.- Specified by:
sendNotificationin interfaceEventSourceAccess- Parameters:
action- the action the notification complies with.payload- the message payload that is tried to be marshalled and delivered.
-
subscriptionEndToAll
public void subscriptionEndToAll(WsEventingStatus status)
Description copied from interface:EventSourceAccessSends a subscription end message to all subscribers and shut down connected subscriptions.- Specified by:
subscriptionEndToAllin interfaceEventSourceAccess- Parameters:
status- reason for ending the subscriptions.
-
startUp
protected void startUp()
- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService
-
shutDown
protected void shutDown()
- Specified by:
shutDownin classcom.google.common.util.concurrent.AbstractIdleService
-
-