com.cafesoft.core.service
Class AbstractServiceConnector

java.lang.Object
  |
  +--com.cafesoft.core.service.AbstractLifecycleService
        |
        +--com.cafesoft.core.service.AbstractServiceConnector
All Implemented Interfaces:
Debuggable, Lifecycle, LifecycleService, Service, ServiceConnector

public abstract class AbstractServiceConnector
extends AbstractLifecycleService
implements ServiceConnector

AbstractServiceConnector implements a base class for ServiceConnector implementations, which generally manage client network connections and provide access to remote Services. This base class provides default ServiceAdapter management, and a default Service implementation.

A ServiceConnector implementation can install conditional support for the Services it makes available to clients by comparing it's registered ServiceAdapters with the business Services required for the ServiceAdapter.


Field Summary
 
Fields inherited from class com.cafesoft.core.service.AbstractLifecycleService
debug, initialized, listenerList, logger, serviceConfig, started
 
Fields inherited from interface com.cafesoft.core.lifecycle.Lifecycle
START_EVENT, STOP_EVENT
 
Constructor Summary
AbstractServiceConnector()
          This is an abstract class, so it can't be instantiated, but be sure to invoke this constructor from your extending class.
 
Method Summary
 void addServiceAdapter(ServiceAdapter adapter)
          Add a ServiceAdapter.
 ServiceAdapter[] getServiceAdapters()
          Get all ServiceAdapters.
 void removeServiceAdapter(ServiceAdapter adapter)
          Remove a ServiceAdapter.
 
Methods inherited from class com.cafesoft.core.service.AbstractLifecycleService
addLifecycleListener, destroy, fireEvent, getServiceConfig, initialize, isStarted, removeLifecycleListener, setDebug, start, stop
 
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
 
Methods inherited from interface com.cafesoft.core.lifecycle.Lifecycle
addLifecycleListener, isStarted, removeLifecycleListener, start, stop
 

Constructor Detail

AbstractServiceConnector

public AbstractServiceConnector()
This is an abstract class, so it can't be instantiated, but be sure to invoke this constructor from your extending class.

Method Detail

addServiceAdapter

public void addServiceAdapter(ServiceAdapter adapter)
                       throws ServiceException
Add a ServiceAdapter.

Specified by:
addServiceAdapter in interface ServiceConnector
Parameters:
adapter - the ServiceAdapter to be added.
Throws:
ServiceException - if the ServiceAdapter is null or is a duplicate of a previously-registered ServiceAdapter.

removeServiceAdapter

public void removeServiceAdapter(ServiceAdapter adapter)
                          throws ServiceException
Remove a ServiceAdapter.

Specified by:
removeServiceAdapter in interface ServiceConnector
Parameters:
adapter - the ServiceAdapter to be removed.
Throws:
ServiceException - if the specified ServiceAdapter is not registered with this ServiceConnector.

getServiceAdapters

public ServiceAdapter[] getServiceAdapters()
Get all ServiceAdapters.

Specified by:
getServiceAdapters in interface ServiceConnector
Returns:
an array of registered ServiceAdapters.


Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.