KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > core > dist > rmi > RMIRemoteContainerInterf


1 /*
2   Copyright (C) 2001 Lionel Seinturier
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU Lesser General Public License as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12   GNU Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser Generaly Public License
15   along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

17
18 package org.objectweb.jac.core.dist.rmi;
19
20 import org.objectweb.jac.core.dist.RemoteRef;
21
22 import java.rmi.Remote JavaDoc;
23 import java.rmi.RemoteException JavaDoc;
24
25 /**
26  * RMIRemoteContainerInterf is the interface of RMI remote containers
27  * that are used by jac to remotely instantiate objects.
28  *
29  * @author <a HREF="http://www-src.lip6.fr/homepages/Lionel.Seinturier/index-eng.html">Lionel Seinturier</a>
30  */

31  
32 public interface RMIRemoteContainerInterf extends Remote JavaDoc {
33    
34    /**
35     * This method instantiates a className object.
36     * Clients call it to remotely instantiate an object.
37     * instantiates creates an object and returns its index.
38     *
39     * @param className the class name to instantiate
40     * @param args initialization arguments for the instantiation
41     * @param fields the object fields that are part of the state
42     * @param state the state to copy
43     * @param collaboration the collaboration of the client
44     * @return the index of the className object
45     */

46    
47    int instantiates(String JavaDoc name, String JavaDoc className, Object JavaDoc[] args,
48                     String JavaDoc[] fields, byte[] state,
49                     byte[] collaboration )
50       throws RemoteException JavaDoc;
51    
52    
53    /**
54     * Copy a state into a base object.
55     *
56     * @param index the callee index (see org.objectweb.jac.core.JacObject)
57     * @param fields the object fields that are part of the state
58     * @param state the state to copy
59     * @param collaboration the collaboration of the client
60     */

61     
62    void copy( String JavaDoc name, int index, String JavaDoc[] fields, byte[] state,
63               byte[] collaboration )
64       throws RemoteException JavaDoc;
65
66
67    /**
68     * Invoke a method on a base object.
69     * The base object is the remote counterpart of a local object
70     * that has been remotely instantiated by a org.objectweb.jac.dist.Distd daemon.
71     *
72     * @param index the callee index (see org.objectweb.jac.core.JacObject)
73     * @param methodName the callee method name
74     * @param methodArgs the callee method arguments
75     */

76    
77    byte[] invoke( int index, String JavaDoc methodName, byte[] methodArgs,
78                   byte[] collaboration )
79       throws RemoteException JavaDoc;
80
81    byte[] invokeRoleMethod( int index, String JavaDoc methodName,
82                             byte[] methodArgs,
83                             byte[] collaboration )
84       throws RemoteException JavaDoc;
85
86    byte[] getByteCodeFor ( String JavaDoc className ) throws RemoteException JavaDoc;
87
88    /**
89     * Returns a remote reference on the object corresponding to the
90     * given name. */

91
92    RemoteRef bindTo ( String JavaDoc name ) throws RemoteException JavaDoc;
93
94 // /**
95
// * Get a client stub wrapping chain for a given object.
96
// *
97
// * This method is called whenever a daemon receives as a parameter
98
// * a reference to a remote object, to get the wrapping chain
99
// * (for instance an authentication wrapper, a verbose wrapper, ...)
100
// * needed to create a client stub for this remote reference.
101
// *
102
// * @param index the base object index (see org.objectweb.jac.core.JacObject)
103
// * @return the client stub wrapping chain as a serialized object
104
// */
105
//
106
// Vector getClientStubWrappingChain( int index ) throws RemoteException;
107

108 }
109
Popular Tags