KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > core > descriptor > data > ProActiveDescriptor


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.descriptor.data;
32
33 import org.objectweb.proactive.core.ProActiveException;
34 import org.objectweb.proactive.core.process.ExternalProcess;
35 import org.objectweb.proactive.core.process.ExternalProcessDecorator;
36 import org.objectweb.proactive.ext.security.PolicyServer;
37
38 /**
39  * <p>
40  * A <code>ProactiveDescriptor</code> is an internal representation of XML
41  * Descriptor. It offers a set of services to access/activate/desactivate
42  * <code>VirtualNode</code>.
43  * </p>
44  *
45  * @author ProActive Team
46  * @version 1.0, 2002/09/20
47  * @since ProActive 0.9.3
48  * @see VirtualNode
49  * @see VirtualMachine
50  */

51 public interface ProActiveDescriptor extends java.io.Serializable JavaDoc{
52
53   
54   /**
55    * Returns all VirtualNodes described in the XML Descriptor
56    * @return VirtualNode[] all the VirtualNodes described in the XML Descriptor
57    */

58   public VirtualNode[] getVirtualNodes();
59   
60   /**
61    * Returns the specified VirtualNode
62    * @param name name of the VirtualNode
63    * @return VirtualNode VirtualNode of the given name
64    */

65   public VirtualNode getVirtualNode(String JavaDoc name);
66   
67   
68   /**
69    * Returns the VitualMachine of the given name
70    * @param name
71    * @return VirtualMachine
72    */

73   public VirtualMachine getVirtualMachine(String JavaDoc name);
74
75     
76     /**
77    * Returns the Process of the given name
78    * @param name
79    * @return ExternalProcess
80    */

81   public ExternalProcess getProcess(String JavaDoc name);
82
83     
84     /**
85    * Creates a VirtualNode with the given name
86    * If the VirtualNode with the given name has previously been created, this method returns it.
87    * @param vnName
88    * @param lookup if true, at creation time the VirtualNode will be a VirtualNodeLookup.
89    * If false the created VirtualNode is a VirtualNodeImpl. Once the VirtualNode created this field
90    * has no more influence when calling this method
91    * @return VirtualNode
92    */

93   public VirtualNode createVirtualNode(String JavaDoc vnName, boolean lookup);
94   
95   
96   /**
97    * Creates a VirtualMachine of the given name
98    * @param vmName
99    * @return VirtualMachine
100    */

101   public VirtualMachine createVirtualMachine(String JavaDoc vmName);
102   
103   
104   /**
105    * Creates an ExternalProcess of the given className with the specified ProcessID
106    * @param processID
107    * @param processClassName.
108    * @return ExternalProcess
109    * @throws ProActiveException if a problem occurs during process creation
110    */

111   public ExternalProcess createProcess(String JavaDoc processID, String JavaDoc processClassName) throws ProActiveException;
112   
113   
114   /**
115    * Returns a new instance of ExternalProcess from processClassName
116    * @param processClassName
117    * @return ExternalProcess
118    * @throws ProActiveException if a problem occurs during process creation
119    */

120   public ExternalProcess createProcess(String JavaDoc processClassName) throws ProActiveException;
121   
122   
123   /**
124    * Maps the process given by the specified processID with the specified virtualMachine.
125    * @param virtualMachine
126    * @param processID
127    */

128   public void registerProcess(VirtualMachine virtualMachine, String JavaDoc processID);
129   
130   
131   /**
132    * Registers the specified composite process with the specified processID.
133    * @param compositeProcess
134    * @param processID
135    */

136   public void registerProcess(ExternalProcessDecorator compositeProcess, String JavaDoc processID);
137   
138   
139   /**
140    * Activates all VirtualNodes defined in the XML Descriptor.
141    */

142   public void activateMappings();
143   
144   
145   /**
146    * Activates the specified VirtualNode defined in the XML Descriptor
147    * @param virtualNodeName name of the VirtulNode to be activated
148    */

149   public void activateMapping(String JavaDoc virtualNodeName);
150   
151   
152     /**
153      * Kills all Nodes and JVMs(local or remote) created when activating the descriptor
154      * @param softly if false, all jvms created when activating the descriptor are killed abruptely
155      * if true a jvm that originates the creation of a rmi registry waits until registry is empty before
156      * dying. To be more precise a thread is created to ask periodically the registry if objects are still
157      * registered.
158      * @throws ProActiveException if a problem occurs when terminating all jvms
159      */

160   public void killall(boolean softly) throws ProActiveException;
161   
162   
163   
164 // /**
165
// * Kills all Nodes mapped to VirtualNodes in the XML Descriptor
166
// * This method kills also the jvm on which
167
// */
168
// public void desactivateMapping();
169
//
170
//
171
// /**
172
// * Kills all Nodes mapped to the specified VirutalNode in the XML Descriptor
173
// * @param vitualNodeName name of the virtualNode to be desactivated
174
// */
175
// public void desactivateMapping(String virtualNodeName);
176

177     /**
178      * Returns the size of virualNodeMapping HashMap
179      * @return int
180      */

181     public int getVirtualNodeMappingSize();
182     
183     // SECURITY
184
/**
185      * Intialize application security policy
186      * @param file
187      */

188     public void createPolicyServer(String JavaDoc file);
189     
190     public PolicyServer getPolicyServer();
191     public String JavaDoc getSecurityFilePath();
192
193 }
194
Popular Tags