KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > RemoteReferenceFactory


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise;
24
25 import java.util.Set JavaDoc;
26
27 import java.rmi.Remote JavaDoc;
28 import javax.ejb.EJBObject JavaDoc;
29 import javax.ejb.EJBHome JavaDoc;
30
31 /**
32  * The RemoteReferenceFactory interface provides methods to
33  * create and destroy remote EJB references. Instances of the
34  * RemoteReferenceFactory are obtained from the ProtocolManager.
35  *
36  */

37 public interface RemoteReferenceFactory {
38  
39     /**
40      * Create a remote reference for an EJBObject which can
41      * be used for performing remote invocations.
42      * The key specifies the unique
43      * "object-id" of the EJBObject. This operation should not
44      * create any "tie" for the particular remote object instance.
45      * This operation should not cause the ProtocolManager to maintain
46      * any instance-specific state about the EJB instance.
47      *
48      * @param instanceKey a unique identifier for the EJB instance
49      * which is unique across all EJB refs created using this
50      * RemoteReferenceFactory instance.
51      * @return the protocol-specific stub of the proper derived type.
52      * It should not be necessary to narrow this stub again.
53      */

54     Remote JavaDoc createRemoteReference(byte[] instanceKey);
55
56    
57     /**
58      * Create a remote reference for an EJBHome which can
59      * be used for performing remote invocations.
60      * The key specifies the unique
61      * "object-id" of the EJBHome. This operation should not
62      * create any "tie" for the particular remote object instance.
63      * This operation should not cause the ProtocolManager to maintain
64      * any instance-specific state about the EJB instance.
65      *
66      * @param instanceKey a unique identifier for the EJB instance
67      * which is unique across all EJB refs created using this
68      * RemoteReferenceFactory instance.
69      * @return the protocol-specific stub of the proper derived type.
70      * It should not be necessary to narrow this stub again.
71      */

72     EJBHome JavaDoc createHomeReference(byte[] homeKey);
73
74     /**
75      * Destroy an EJBObject or EJBHome remote ref
76      * so that it can no longer be used for remote invocations.
77      * This operation should destroy any state such as "tie" objects
78      * maintained by the ProtocolManager for the EJBObject or EJBHome.
79      *
80      * @param remoteRef the remote reference for the EJBObject/EJBHome
81      * @param remoteObj the servant corresponding to the remote reference.
82      */

83     void destroyReference(Remote JavaDoc remoteRef, Remote JavaDoc remoteObj);
84
85     /**
86      * Destroy the factory itself. Called during shutdown / undeploy.
87      * The factory is expected to release all resources in this method.
88      */

89     public void destroy();
90
91
92     public boolean hasSameContainerID(org.omg.CORBA.Object JavaDoc ref)
93     throws Exception JavaDoc;
94
95     public void setRepositoryIds(Class JavaDoc homeIntf, Class JavaDoc remoteIntf);
96     
97     public void cleanupClass(Class JavaDoc clazz);
98
99 }
100
101
Popular Tags