org.objectweb.proactive.core.runtime
Interface ProActiveRuntime

All Superinterfaces:
Job
All Known Implementing Classes:
JiniRuntimeAdapter, ProActiveRuntimeImpl, RemoteProActiveRuntimeAdapter, RemoteProActiveRuntimeAdapter

public interface ProActiveRuntime
extends Job

A ProActiveRuntime offers a set of services needed by ProActive to work with remote JVM. Each JVM that is aimed to hold active objects must contain one and only one instance of the ProActiveRuntime class. That instance, when created, will register itself to some registry where it is possible to perform a lookup (such as the RMI registry).

When ProActive needs to interact with a remote JVM, it will lookup for the ProActiveRuntime associated with that JVM (using typically the RMI Registry) and use the remote interface of the ProActiveRuntime to perform the interaction.

Aside the getter giving information about the VM, the 3 services offered are :

Since:
ProActive 0.91
Version:
1.0, 2002/08/29
Author:
ProActive Team

Field Summary
static org.apache.log4j.Logger runtimeLogger
           
 
Method Summary
 UniversalBody createBody(java.lang.String nodeName, ConstructorCall bodyConstructorCall, boolean isNodeLocal)
           This method is the basis for creating remote active objects.
 java.lang.String createLocalNode(java.lang.String nodeName, boolean replacePreviousBinding, PolicyServer policyServer, java.lang.String vnName, java.lang.String jobId)
          Creates a new Node in the same VM as this ProActiveRuntime
 void createVM(UniversalProcess remoteProcess)
          Creates a new ProActiveRuntime associated with a new VM on the host defined in the given process.
 void enableSecurityIfNeeded()
          sets all needed modifications to enable security components MUST be called when the descriptor is ready
 java.util.ArrayList getActiveObjects(java.lang.String nodeName)
          Returns all Active Objects deployed on the node with the given name on this ProActiveRuntime
 java.util.ArrayList getActiveObjects(java.lang.String nodeName, java.lang.String className)
          Returns all Active Objects with the specified class name, deployed on the node with the given name on this ProActiveRuntime
 java.security.cert.X509Certificate getCreatorCertificate()
           
 java.util.ArrayList getEntities()
           
 java.util.ArrayList getEntities(java.lang.String nodeName)
           
 java.util.ArrayList getEntities(UniversalBody uBody)
           
 java.lang.String getJobID(java.lang.String nodeUrl)
           
 java.lang.String[] getLocalNodeNames()
          Returns the name of all nodes known by this ProActiveRuntime on this VM
 java.security.cert.X509Certificate getNodeCertificate(java.lang.String nodeName)
           
 PolicyServer getNodePolicyServer(java.lang.String nodeName)
           
 PolicyServer getPolicyServer()
           
 ProActiveRuntime getProActiveRuntime(java.lang.String proActiveRuntimeName)
          Returns the ProActiveRuntime of specified name
 ProActiveRuntime[] getProActiveRuntimes()
          Returns all the ProActiveRuntime registered on this ProActiveRuntime on this VM
 java.lang.String getURL()
          Returns the url of this ProActiveRuntime on the local or remote VM
 VirtualNode getVirtualNode(java.lang.String virtualNodeName)
          Returns the VirtualNode with the given name
 VMInformation getVMInformation()
          Returns the JVM information as one object.
 java.lang.String getVNName(java.lang.String Nodename)
           
 void killAllNodes()
          **Under development** Kills all Nodes in this ProActiveRuntime
 void killNode(java.lang.String nodeName)
          **Under development** Kills the Node of the given name and all Active Objects deployed on it.
 void killRT(boolean softly)
          Kills this ProActiveRuntime and this VM
 void listVirtualNodes()
           
 UniversalBody receiveBody(java.lang.String nodeName, Body body)
           This method is the basis for migrating active objects.
 void register(ProActiveRuntime proActiveRuntimeDist, java.lang.String proActiveRuntimeName, java.lang.String creatorID, java.lang.String creationProtocol, java.lang.String vmName)
          **For internal use only** Allows this ProactiveRuntime on this VM to register another ProActiveRuntime
 void registerVirtualNode(java.lang.String virtualNodeName, boolean replacePreviousBinding)
          Registers the virtualNode of the given name in a registry such RMIRegistry or Jini Service Lookup
 void setDefaultNodeVirtualNodeName(java.lang.String s)
           
 void setProActiveSecurityManager(ProActiveSecurityManager ps)
           
 void unregisterAllVirtualNodes()
          Unregisters all VirtualNodes from the local runtime
 void unregisterVirtualNode(java.lang.String virtualNodeName)
          Unregisters the VirtualNode of the given name from the local runtime.
 
Methods inherited from interface org.objectweb.proactive.Job
getJobID
 

Field Detail

runtimeLogger

public static final org.apache.log4j.Logger runtimeLogger
Method Detail

createLocalNode

public java.lang.String createLocalNode(java.lang.String nodeName,
                                        boolean replacePreviousBinding,
                                        PolicyServer policyServer,
                                        java.lang.String vnName,
                                        java.lang.String jobId)
                                 throws NodeException
Creates a new Node in the same VM as this ProActiveRuntime

Parameters:
nodeName - the name of the node to create localy
replacePreviousBinding -
Returns:
the url of the newly created node in the target VM
Throws:
NodeException - if the new node cannot be created

killAllNodes

public void killAllNodes()
                  throws ProActiveException
**Under development** Kills all Nodes in this ProActiveRuntime

ProActiveException

killNode

public void killNode(java.lang.String nodeName)
              throws ProActiveException
**Under development** Kills the Node of the given name and all Active Objects deployed on it.

Parameters:
nodeName - the name of the node to kill
ProActiveException

createVM

public void createVM(UniversalProcess remoteProcess)
              throws java.io.IOException,
                     ProActiveException
Creates a new ProActiveRuntime associated with a new VM on the host defined in the given process.

Parameters:
remoteProcess - the process that will originate the creation of the runtime
Throws:
java.io.IOException - if the new VM cannot be created
ProActiveException - if a problem occurs due to the remote nature of this ProActiveRuntime

getLocalNodeNames

public java.lang.String[] getLocalNodeNames()
                                     throws ProActiveException
Returns the name of all nodes known by this ProActiveRuntime on this VM

Returns:
the name of all nodes known by this ProActiveRuntime on this VM
Throws:
ProActiveException - if a problem occurs due to the remote nature of this ProActiveRuntime

getVMInformation

public VMInformation getVMInformation()
Returns the JVM information as one object. This method allows to retrieve all JVM information in one call to optimize performance.

Returns:
the JVM information as one object

register

public void register(ProActiveRuntime proActiveRuntimeDist,
                     java.lang.String proActiveRuntimeName,
                     java.lang.String creatorID,
                     java.lang.String creationProtocol,
                     java.lang.String vmName)
**For internal use only** Allows this ProactiveRuntime on this VM to register another ProActiveRuntime

Parameters:
proActiveRuntimeDist - the remote ProactiveRuntime to register
proActiveRuntimeName - the name of the remote ProActiveRuntime
creatorID - the name of the creator of the remote ProActiveRuntime
creationProtocol - the protocol used to register the remote ProActiveRuntime when created

getProActiveRuntimes

public ProActiveRuntime[] getProActiveRuntimes()
                                        throws ProActiveException
Returns all the ProActiveRuntime registered on this ProActiveRuntime on this VM

Returns:
all the ProActiveRuntime registered on this ProActiveRuntime on this VM
Throws:
ProActiveException - if a problem occurs due to the remote nature of this ProActiveRuntime

getProActiveRuntime

public ProActiveRuntime getProActiveRuntime(java.lang.String proActiveRuntimeName)
                                     throws ProActiveException
Returns the ProActiveRuntime of specified name

Parameters:
proActiveRuntimeName - the name of the ProActiveruntime to return
Returns:
the ProActiveRuntime of specified name
Throws:
ProActiveException - if a problem occurs due to the remote nature of this ProActiveRuntime

killRT

public void killRT(boolean softly)
            throws java.lang.Exception
Kills this ProActiveRuntime and this VM

Parameters:
softly - if false, this Runtime is killed abruptely if true, if that runtime originates the creation of a rmi registry, it waits until the registry is empty before dying. To be more precise a thread is created to ask periodically the registry if objects are still registered.
java.lang.Exception

getURL

public java.lang.String getURL()
                        throws ProActiveException
Returns the url of this ProActiveRuntime on the local or remote VM

ProActiveException

getActiveObjects

public java.util.ArrayList getActiveObjects(java.lang.String nodeName)
                                     throws ProActiveException
Returns all Active Objects deployed on the node with the given name on this ProActiveRuntime

Parameters:
nodeName - the name of the node
Returns:
Object[] Active Objects deployed on this ProactiveRuntime
ProActiveException

getActiveObjects

public java.util.ArrayList getActiveObjects(java.lang.String nodeName,
                                            java.lang.String className)
                                     throws ProActiveException
Returns all Active Objects with the specified class name, deployed on the node with the given name on this ProActiveRuntime

Parameters:
nodeName - the name of the node
Returns:
Object[] Active Objects of the specified class name deployed on this ProactiveRuntime
ProActiveException

getVirtualNode

public VirtualNode getVirtualNode(java.lang.String virtualNodeName)
                           throws ProActiveException
Returns the VirtualNode with the given name

Returns:
VirtualNode the virtualnode of the given name or null if such virtualNode does not exist.
ProActiveException

registerVirtualNode

public void registerVirtualNode(java.lang.String virtualNodeName,
                                boolean replacePreviousBinding)
                         throws ProActiveException
Registers the virtualNode of the given name in a registry such RMIRegistry or Jini Service Lookup

Parameters:
virtualNodeName -
ProActiveException

unregisterVirtualNode

public void unregisterVirtualNode(java.lang.String virtualNodeName)
                           throws ProActiveException
Unregisters the VirtualNode of the given name from the local runtime.

Parameters:
virtualNodeName - the virtualNode to unregister.
Throws:
ProActiveException - if a problem occurs when trying to unregister the virtualNode

unregisterAllVirtualNodes

public void unregisterAllVirtualNodes()
                               throws ProActiveException
Unregisters all VirtualNodes from the local runtime

Throws:
ProActiveException

getJobID

public java.lang.String getJobID(java.lang.String nodeUrl)
                          throws ProActiveException
Returns:
the jobId of the node with the given name
Throws:
ProActiveException

createBody

public UniversalBody createBody(java.lang.String nodeName,
                                ConstructorCall bodyConstructorCall,
                                boolean isNodeLocal)
                         throws ProActiveException,
                                ConstructorCallExecutionFailedException,
                                java.lang.reflect.InvocationTargetException

This method is the basis for creating remote active objects. It receives a ConstructorCall that is the constructor call of the body of the active object to create. Inside the parameters of this constructor call is the constructor call of the reified object. Upon execution of the constructor call of the body, the body holding a reference on the reified object will get created and returned.

The method returns a reference on the RMI stub of the newly created body.

Parameters:
nodeName - the name of the node the newly created active object will be associated to
bodyConstructorCall - the Constructor call allowing to create the body
isNodeLocal - boolean. True if proxy and body are on the same vm, false otherwise
Returns:
a stub on the newly created body.
Throws:
ProActiveException - if a problem occurs due to the remote nature of this ProactiveRuntime
ConstructorCallExecutionFailedException - if the constructor call cannot be executed
java.lang.reflect.InvocationTargetException - if the java constructor execution failed

receiveBody

public UniversalBody receiveBody(java.lang.String nodeName,
                                 Body body)
                          throws ProActiveException

This method is the basis for migrating active objects. It receives a Body that embbeds the reified object and its graph of passive objects. Once transfered remotely using serialization, the body should restart itself and perform all updates needed to be functionning.

The method returns a reference on the RMI stub of the migrated body.

Parameters:
nodeName - the name of the node the newly created active object will be associated to
body - the body of the active object migrating to this node.
Returns:
a RMI stub on the migrated body.
Throws:
ProActiveException - if a problem occurs due to the remote nature of this ProActiveRuntime

getCreatorCertificate

public java.security.cert.X509Certificate getCreatorCertificate()
                                                         throws ProActiveException
Returns:
creator's certificate if exists
ProActiveException

getPolicyServer

public PolicyServer getPolicyServer()
                             throws ProActiveException
Returns:
Policy server
ProActiveException

setProActiveSecurityManager

public void setProActiveSecurityManager(ProActiveSecurityManager ps)
                                 throws ProActiveException
ProActiveException

getVNName

public java.lang.String getVNName(java.lang.String Nodename)
                           throws ProActiveException
ProActiveException

setDefaultNodeVirtualNodeName

public void setDefaultNodeVirtualNodeName(java.lang.String s)
                                   throws ProActiveException
ProActiveException

listVirtualNodes

public void listVirtualNodes()
                      throws ProActiveException
ProActiveException

getNodePolicyServer

public PolicyServer getNodePolicyServer(java.lang.String nodeName)
                                 throws ProActiveException
ProActiveException

enableSecurityIfNeeded

public void enableSecurityIfNeeded()
                            throws ProActiveException
sets all needed modifications to enable security components MUST be called when the descriptor is ready

ProActiveException

getNodeCertificate

public java.security.cert.X509Certificate getNodeCertificate(java.lang.String nodeName)
                                                      throws ProActiveException
Parameters:
nodeName -
Returns:
return certificate associated to the node designed by nodeName
ProActiveException

getEntities

public java.util.ArrayList getEntities(java.lang.String nodeName)
                                throws ProActiveException
Parameters:
nodeName -
Returns:
returns all entities associated to the node
ProActiveException

getEntities

public java.util.ArrayList getEntities(UniversalBody uBody)
                                throws ProActiveException
Returns:
returns all entities associated to the node
ProActiveException

getEntities

public java.util.ArrayList getEntities()
                                throws ProActiveException
Returns:
returns all entities associated to this runtime
ProActiveException


Copyright © April 2004 INRIA All Rights Reserved.