uk.ac.lancs.relate.gateways.services.architecture
Class ServiceProvider

java.lang.Object
  extended by uk.ac.lancs.relate.gateways.services.architecture.ServiceProvider
All Implemented Interfaces:
java.io.Serializable, ProvidersAndRequestersCommonInterface
Direct Known Subclasses:
MulticastServiceProvider, PresentationServiceProvider, RMIServiceProvider, ServerSocketServiceProvider

public abstract class ServiceProvider
extends java.lang.Object
implements java.io.Serializable, ProvidersAndRequestersCommonInterface

This abstract class defines the methods common to all the Service providers.

Author:
Dominique Guinard
Personal Homepage
See Also:
Serialized Form

Constructor Summary
ServiceProvider(Service service)
          Default constructor for a ServiceProvider.
 
Method Summary
 void confirmShutdown()
          Method used to confirm the service provider was successfully shutdown.
 void confirmStartup()
          Method used to confirm the service provider was successfully started.
 Service getService()
           
 boolean isRunning()
          Returns "true" if the concrete provider is currently running.
abstract  ServiceResponse provide(ServiceRequest serviceRequest)
          Method used to provide a service.
 void setService(Service service)
           
 java.lang.String toString()
          Overriding the toString() method in order to display the classname only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface uk.ac.lancs.relate.gateways.services.architecture.ProvidersAndRequestersCommonInterface
shutdown, startup
 

Constructor Detail

ServiceProvider

public ServiceProvider(Service service)
Default constructor for a ServiceProvider. A provider is always attached to a service..

Method Detail

confirmStartup

public void confirmStartup()
Method used to confirm the service provider was successfully started. This method is to be used by concrete providers once their startup() procedure was successfully executed. It prevents a not fully started service to be in the running state.


confirmShutdown

public void confirmShutdown()
Method used to confirm the service provider was successfully shutdown. This method is to be used by concrete providers once their shutdown() procedure was successfully executed. It prevents a not fully shutdown service to be in the "not running" state.


provide

public abstract ServiceResponse provide(ServiceRequest serviceRequest)
Method used to provide a service.


toString

public java.lang.String toString()
Overriding the toString() method in order to display the classname only.

Overrides:
toString in class java.lang.Object

isRunning

public boolean isRunning()
Returns "true" if the concrete provider is currently running.


getService

public Service getService()

setService

public void setService(Service service)