summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/tags/2.0.1-RC1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceReference.java
blob: d2d62763fa2194b706cd44943390f741fdaf24a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
 * OASIS trademark, IPR and other policies apply.
 */
package org.oasisopen.sca;

/**
 * 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.
 *
 * @param     <B> the type of the service reference
 */
public interface ServiceReference<B> extends java.io.Serializable {

    /**
     * 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.
     * 
     * @return a type-safe reference to the target of this reference.
     */
    B getService();

    /**
     * Returns the Java class for the business interface associated
     * with this reference.
     * 
     * @return the Java class for the business interface associated
     *         with this reference.
     */
    Class<B> getBusinessInterface();
}