KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > core > runtime > jini > JiniRuntime


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

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

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

140     public void setDefaultNodeVirtualNodeName(String JavaDoc s)
141         throws java.rmi.RemoteException JavaDoc;
142
143     public void updateLocalNodeVirtualName() throws RemoteException JavaDoc;
144
145     public PolicyServer getNodePolicyServer(String JavaDoc nodeName)
146         throws RemoteException JavaDoc;
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 JavaDoc;
153
154     /**
155      * @param nodeName
156      * @return node certificate
157      */

158     public X509Certificate JavaDoc getNodeCertificate(String JavaDoc nodeName)
159         throws RemoteException JavaDoc;
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 JavaDoc;
166
167     /**
168      * @param nodeName
169      * @return returns all entities associated to the node
170      */

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

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