com.cafesoft.core.service
Class StandardServiceAdapter

java.lang.Object
  |
  +--com.cafesoft.core.service.AbstractService
        |
        +--com.cafesoft.core.service.StandardServiceAdapter
All Implemented Interfaces:
Debuggable, Service, ServiceAdapter

public class StandardServiceAdapter
extends AbstractService
implements ServiceAdapter

StandardServiceAdapter is a base class for providing an interface for use by clients which provides access to one or more other Services not known to those clients. In other words, a client will invoke a business method on a ServiceAdapter, which will then access other Services (not known to the client) to fulfull the request. This class can be extended to add business-level methods specific to the Service it adapts.

It can also be used by ServiceConnectors to define dependencies on other required Services.


Field Summary
protected  List requiredList
          The list of ServiceReferences indicating required Services.
 
Fields inherited from class com.cafesoft.core.service.AbstractService
debug, initialized, logger, serviceConfig
 
Constructor Summary
StandardServiceAdapter()
          Create a new StandardServiceAdapter.
 
Method Summary
 void addRequiredService(ServiceReference serviceRef)
          Add a reference to a required Service.
 ServiceReference[] getRequiredServices()
          Get all required Services.
 void removeRequiredService(ServiceReference serviceRef)
          Remove a reference to a required Service.
 
Methods inherited from class com.cafesoft.core.service.AbstractService
destroy, getServiceConfig, initialize, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cafesoft.core.service.Service
destroy, getServiceConfig, initialize
 
Methods inherited from interface com.cafesoft.core.util.Debuggable
setDebug
 

Field Detail

requiredList

protected List requiredList
The list of ServiceReferences indicating required Services.

Constructor Detail

StandardServiceAdapter

public StandardServiceAdapter()
Create a new StandardServiceAdapter.

Method Detail

addRequiredService

public void addRequiredService(ServiceReference serviceRef)
Add a reference to a required Service.

Specified by:
addRequiredService in interface ServiceAdapter
Parameters:
serviceRef - a reference to a Service type or instance required by this ServiceAdapter in order to provide it's Service to a client.

removeRequiredService

public void removeRequiredService(ServiceReference serviceRef)
Remove a reference to a required Service.

Specified by:
removeRequiredService in interface ServiceAdapter
Parameters:
serviceRef - a reference to a Service no longer required by this ServiceAdapter in order to provide it's Service to a client.

getRequiredServices

public ServiceReference[] getRequiredServices()
Get all required Services.

Specified by:
getRequiredServices in interface ServiceAdapter
Returns:
an array of ServiceReference instances.


Generated on 8:41:50 AM June 06, 2005, © 1996-2005 Cafésoft LLC. All rights reserved.