org.oasisopen.sca
Interface ServiceReference<B>

Type Parameters:
B - the type of the service reference
All Superinterfaces:
java.io.Serializable

public interface ServiceReference<B>
extends java.io.Serializable

The ServiceReference interface represents a component reference. It can be injected using the @Reference annotation on a field, a setter method, or constructor parameter taking the type ServiceReference.


Method Summary
 java.lang.Class<B> getBusinessInterface()
          Returns the Java class for the business interface associated with this reference.
 B getService()
          Returns a type-safe reference to the target of this reference.
 

Method Detail

getService

B getService()
Returns a type-safe reference to the target of this reference. The instance returned is guaranteed to implement the business interface for this reference. The value returned is a proxy to the target that implements the business interface associated with this reference.

Returns:
a type-safe reference to the target of this reference.

getBusinessInterface

java.lang.Class<B> getBusinessInterface()
Returns the Java class for the business interface associated with this reference.

Returns:
the Java class for the business interface associated with this reference.