com.cafesoft.core.service
Class StandardServiceFinder

java.lang.Object
  |
  +--com.cafesoft.core.service.StandardServiceFinder
All Implemented Interfaces:
ServiceFinder

public class StandardServiceFinder
extends Object
implements ServiceFinder

StandardServiceFinder implements a ServiceFinder used by ServiceClients to find Services. This implementation delegates to a ServiceManager to lookup the desired Service.


Constructor Summary
StandardServiceFinder(ServiceManager serviceManager)
          Create a new StandardServiceFinder.
 
Method Summary
 Service[] find(Class type)
          Lookup Services by type.
 Service find(String id)
          Lookup a Service by unique identifier.
 Service find(String id, Class type)
          Find a Service by unique identifier and type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardServiceFinder

public StandardServiceFinder(ServiceManager serviceManager)
Create a new StandardServiceFinder.

Parameters:
serviceManager - the ServiceManager from which Services can be found.
Method Detail

find

public Service[] find(Class type)
               throws ServiceException
Lookup Services by type.

Specified by:
find in interface ServiceFinder
Parameters:
type - the Service Class.
Returns:
an array of Service instances implemented by the specified type.
Throws:
ServiceException - if no service with the specified type is registered.

find

public Service find(String id)
             throws ServiceException
Lookup a Service by unique identifier.

Specified by:
find in interface ServiceFinder
Parameters:
id - the Service identifier.
Returns:
the Service with the specified identifier.
Throws:
ServiceException - if no service with the specified identifier is registered.

find

public Service find(String id,
                    Class type)
             throws ServiceException
Find a Service by unique identifier and type.

Specified by:
find in interface ServiceFinder
Parameters:
id - the Service identifier.
type - the Service type.
Returns:
the Service with the specified identifier and type.
Throws:
ServiceException - if no service with the specified identifier and type is registered.


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.