KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > core > runtime > ibis > RemoteProActiveRuntime


1 /*
2  * ################################################################
3  *
4  * ProActive: The Java(TM) library for Parallel, Distributed,
5  * Concurrent computing with Security and Mobility
6  *
7  * Copyright (C) 1997-2002 INRIA/University of Nice-Sophia Antipolis
8  * Contact: proactive-support@inria.fr
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23  * USA
24  *
25  * Initial developer(s): The ProActive Team
26  * http://www.inria.fr/oasis/ProActive/contacts.html
27  * Contributor(s):
28  *
29  * ################################################################
30  */

31 package org.objectweb.proactive.core.runtime.ibis;
32
33 import ibis.rmi.Remote;
34 import ibis.rmi.RemoteException;
35
36 import org.apache.log4j.Logger;
37
38 import org.objectweb.proactive.Body;
39 import org.objectweb.proactive.core.body.UniversalBody;
40 import org.objectweb.proactive.core.descriptor.data.VirtualNode;
41 import org.objectweb.proactive.core.mop.ConstructorCall;
42 import org.objectweb.proactive.core.mop.ConstructorCallExecutionFailedException;
43 import org.objectweb.proactive.core.node.NodeException;
44 import org.objectweb.proactive.core.process.UniversalProcess;
45 import org.objectweb.proactive.core.runtime.ProActiveRuntime;
46 import org.objectweb.proactive.core.runtime.VMInformation;
47 import org.objectweb.proactive.ext.security.PolicyServer;
48 import org.objectweb.proactive.ext.security.ProActiveSecurityManager;
49
50 import java.security.cert.X509Certificate JavaDoc;
51
52 import java.util.ArrayList JavaDoc;
53
54
55 /**
56  * An adapter for a ProActiveRuntime to be able to receive remote calls. This helps isolate Ibis-specific
57  * code into a small set of specific classes, thus enabling reuse if we one day decide to switch
58  * to anothe remote objects library.
59  * @see <a HREF="http://www.javaworld.com/javaworld/jw-05-1999/jw-05-networked_p.html">Adapter Pattern</a>
60  */

61 public interface RemoteProActiveRuntime extends Remote {
62     static Logger logger = Logger.getLogger(RemoteProActiveRuntime.class.getName());
63
64     public String JavaDoc createLocalNode(String JavaDoc nodeName,
65         boolean replacePreviousBinding, PolicyServer ps, String JavaDoc vnname,
66         String JavaDoc jobId) throws RemoteException, NodeException;
67
68     public void killAllNodes() throws RemoteException;
69
70     public void killNode(String JavaDoc nodeName) throws RemoteException;
71
72     //public void createLocalVM(JVMProcess jvmProcess) throws RemoteException,java.io.IOException;
73
public void createVM(UniversalProcess remoteProcess)
74         throws RemoteException, java.io.IOException JavaDoc;
75
76     //public Node[] getLocalNodes() throws RemoteException;
77
public String JavaDoc[] getLocalNodeNames() throws RemoteException;
78
79     //public String getLocalNode(String nodeName) throws RemoteException;
80
//public String getNode(String nodeName) throws RemoteException;
81
public VMInformation getVMInformation() throws RemoteException;
82
83     public void register(ProActiveRuntime proActiveRuntimeDist,
84         String JavaDoc proActiveRuntimeName, String JavaDoc creatorID, String JavaDoc creationProtocol,
85         String JavaDoc vmName) throws RemoteException;
86
87     public ProActiveRuntime[] getProActiveRuntimes() throws RemoteException;
88
89     public ProActiveRuntime getProActiveRuntime(String JavaDoc proActiveRuntimeName)
90         throws RemoteException;
91
92     public void killRT(boolean softly) throws RemoteException;
93
94     public String JavaDoc getURL() throws RemoteException;
95
96     public ArrayList JavaDoc getActiveObjects(String JavaDoc nodeName)
97         throws RemoteException;
98
99     public ArrayList JavaDoc getActiveObjects(String JavaDoc nodeName, String JavaDoc objectName)
100         throws RemoteException;
101
102     public VirtualNode getVirtualNode(String JavaDoc virtualNodeName)
103         throws RemoteException;
104
105     public void registerVirtualNode(String JavaDoc virtualNodeName,
106         boolean replacePreviousBinding) throws RemoteException;
107
108     public void unregisterVirtualNode(String JavaDoc virtualNodeName)
109         throws RemoteException;
110
111     public void unregisterAllVirtualNodes() throws RemoteException;
112
113     public String JavaDoc getJobID(String JavaDoc nodeUrl) throws RemoteException;
114
115     public UniversalBody createBody(String JavaDoc nodeName,
116         ConstructorCall bodyConstructorCall, boolean isNodeLocal)
117         throws RemoteException, ConstructorCallExecutionFailedException,
118             java.lang.reflect.InvocationTargetException JavaDoc;
119
120     public UniversalBody receiveBody(String JavaDoc nodeName, Body body)
121         throws RemoteException;
122
123     /**
124      * @return creator certificate
125      */

126     public X509Certificate JavaDoc getCreatorCertificate() throws RemoteException;
127
128     public PolicyServer getPolicyServer() throws RemoteException;
129
130     public void setProActiveSecurityManager(ProActiveSecurityManager ps)
131         throws RemoteException;
132
133     public String JavaDoc getVNName(String JavaDoc Nodename) throws RemoteException;
134
135     /**
136      * @param s
137      */

138     public void setDefaultNodeVirtualNodeName(String JavaDoc s)
139         throws RemoteException;
140
141     public void updateLocalNodeVirtualName() throws RemoteException;
142
143     public void listVirtualNodes() throws RemoteException;
144
145     public PolicyServer getNodePolicyServer(String JavaDoc nodeName)
146         throws RemoteException;
147
148     /**
149      * sets all needed modifications to enable security components
150      * MUST be called when the descriptor is ready
151      */

152     public void enableSecurityIfNeeded() throws RemoteException;
153
154     /**
155      * @param nodeName
156      * @return node certificate
157      */

158     public X509Certificate JavaDoc getNodeCertificate(String JavaDoc nodeName)
159         throws RemoteException;
160
161     /**
162      * @param nodeName
163      * @return returns all entities associated to the node
164      */

165     public ArrayList JavaDoc getEntities(String JavaDoc nodeName) throws RemoteException;
166
167     /**
168      * @param nodeName
169      * @return returns all entities associated to the node
170      */

171     public ArrayList JavaDoc getEntities(UniversalBody uBody) throws RemoteException;
172
173     /**
174      * @return returns all entities associated to this runtime
175      */

176     public ArrayList JavaDoc getEntities() throws RemoteException;
177 }
178
Popular Tags