com.cafesoft.core.service
Interface ServiceReference

All Known Implementing Classes:
StandardServiceReference

public interface ServiceReference

ServiceReference contains parameters that uniquely identify a Service type or an instance within some scope. type. This is useful for:


Method Summary
 String getId()
          Get the identifier of the referenced Service.
 Class getType()
          Get the type of the referenced Service.
 boolean matches(Service service)
          Check to see if a Service matches this ServiceReference.
 

Method Detail

getId

String getId()
Get the identifier of the referenced Service.

Returns:
the identifier of the referenced Service or null if the reference is not for a specific instance.

getType

Class getType()
Get the type of the referenced Service.

Returns:
the Class that specifies the type of the referenced Service.

matches

boolean matches(Service service)
Check to see if a Service matches this ServiceReference.

Parameters:
service - the Service instance.
Returns:
true if the Service is not null and:
  1. this ServiceReference DOES NOT specify a Service id and the Service implements the type within this ServiceReference.
  2. this ServiceReference DOES specify a Service id and the Service implements the type in this ServiceReference AND has the same identifier as the one within this ServiceReference.


Generated on 10:38:35 AM April 14, 2011, © 1996-2010 Cafésoft LLC. All rights reserved.