org.objectweb.proactive.core.runtime
Class ProActiveRuntimeImpl

java.lang.Object
  |
  +--org.objectweb.proactive.core.event.AbstractEventProducer
        |
        +--org.objectweb.proactive.core.event.RuntimeRegistrationEventProducerImpl
              |
              +--org.objectweb.proactive.core.runtime.ProActiveRuntimeImpl
All Implemented Interfaces:
Job, ProActiveRuntime, RuntimeRegistrationEventProducer, java.io.Serializable

public class ProActiveRuntimeImpl
extends RuntimeRegistrationEventProducerImpl
implements ProActiveRuntime

Implementation of ProActiveRuntime

Since:
ProActive 0.91
Version:
1.0, 2001/10/23
Author:
ProActive Team
See Also:
Serialized Form

Nested Class Summary
protected static class ProActiveRuntimeImpl.VMInformationImpl
           
 
Nested classes inherited from class org.objectweb.proactive.core.event.AbstractEventProducer
AbstractEventProducer.ListenerList
 
Field Summary
 
Fields inherited from class org.objectweb.proactive.core.event.AbstractEventProducer
eventListeners, logger, shouldSerializeListeners
 
Fields inherited from interface org.objectweb.proactive.core.runtime.ProActiveRuntime
runtimeLogger
 
Method Summary
 UniversalBody createBody(java.lang.String nodeName, ConstructorCall bodyConstructorCall, boolean isLocal)
           This method is the basis for creating remote active objects.
 java.lang.String createLocalNode(java.lang.String nodeName, boolean replacePreviousBinding, PolicyServer ps, 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 objectName)
          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()
           
 ProActiveDescriptor getDescriptor(java.lang.String url)
           
 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 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)
          (non-Javadoc)
 PolicyServer getNodePolicyServer(java.lang.String nodeName)
           
 PolicyServer getPolicyServer()
           
static ProActiveRuntime getProActiveRuntime()
           
 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)
          <<<<<<< ProActiveRuntimeImpl.java
 void registerDescriptor(java.lang.String url, ProActiveDescriptor pad)
           
 void registerLocalVirtualNode(VirtualNode vn, java.lang.String vnName)
          Register the given VirtualNode on this 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 removeDescriptor(java.lang.String url)
           
 void setDefaultNodeVirtualNodeName(java.lang.String s)
           
 void setProActiveSecurityManager(ProActiveSecurityManager server)
          set policy server to all virtual nodes
 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 class org.objectweb.proactive.core.event.RuntimeRegistrationEventProducerImpl
addRuntimeRegistrationEventListener, notifyListeners, notifyOneListener, removeRuntimeRegistrationEventListener
 
Methods inherited from class org.objectweb.proactive.core.event.AbstractEventProducer
addListener, hasListeners, notifyAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProActiveRuntime

public static ProActiveRuntime getProActiveRuntime()

registerLocalVirtualNode

public void registerLocalVirtualNode(VirtualNode vn,
                                     java.lang.String vnName)
Register the given VirtualNode on this ProActiveRuntime. This method cannot be called remotely.

Parameters:
vn - the virtualnode to register

registerDescriptor

public void registerDescriptor(java.lang.String url,
                               ProActiveDescriptor pad)

getDescriptor

public ProActiveDescriptor getDescriptor(java.lang.String url)

removeDescriptor

public void removeDescriptor(java.lang.String url)

createLocalNode

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

Specified by:
createLocalNode in interface 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
See Also:
ProActiveRuntime.createLocalNode(String, boolean, PolicyServer, String, String)

killAllNodes

public void killAllNodes()
Description copied from interface: ProActiveRuntime
**Under development** Kills all Nodes in this ProActiveRuntime

Specified by:
killAllNodes in interface ProActiveRuntime
See Also:
ProActiveRuntime.killAllNodes()

killNode

public void killNode(java.lang.String nodeName)
Description copied from interface: ProActiveRuntime
**Under development** Kills the Node of the given name and all Active Objects deployed on it.

Specified by:
killNode in interface ProActiveRuntime
Parameters:
nodeName - the name of the node to kill
See Also:
ProActiveRuntime.killNode(String)

createVM

public void createVM(UniversalProcess remoteProcess)
              throws java.io.IOException
Description copied from interface: ProActiveRuntime
Creates a new ProActiveRuntime associated with a new VM on the host defined in the given process.

Specified by:
createVM in interface ProActiveRuntime
Parameters:
remoteProcess - the process that will originate the creation of the runtime
Throws:
java.io.IOException - if the new VM cannot be created
See Also:
ProActiveRuntime.createVM(UniversalProcess)

getLocalNodeNames

public java.lang.String[] getLocalNodeNames()
Description copied from interface: ProActiveRuntime
Returns the name of all nodes known by this ProActiveRuntime on this VM

Specified by:
getLocalNodeNames in interface ProActiveRuntime
Returns:
the name of all nodes known by this ProActiveRuntime on this VM
See Also:
ProActiveRuntime.getLocalNodeNames()

getVMInformation

public VMInformation getVMInformation()
Description copied from interface: ProActiveRuntime
Returns the JVM information as one object. This method allows to retrieve all JVM information in one call to optimize performance.

Specified by:
getVMInformation in interface ProActiveRuntime
Returns:
the JVM information as one object
See Also:
ProActiveRuntime.getVMInformation()

register

public void register(ProActiveRuntime proActiveRuntimeDist,
                     java.lang.String proActiveRuntimeName,
                     java.lang.String creatorID,
                     java.lang.String creationProtocol,
                     java.lang.String vmName)
<<<<<<< ProActiveRuntimeImpl.java

Specified by:
register in interface 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
See Also:
=======, >>>>>>> 1.18

getProActiveRuntimes

public ProActiveRuntime[] getProActiveRuntimes()
Description copied from interface: ProActiveRuntime
Returns all the ProActiveRuntime registered on this ProActiveRuntime on this VM

Specified by:
getProActiveRuntimes in interface ProActiveRuntime
Returns:
all the ProActiveRuntime registered on this ProActiveRuntime on this VM
See Also:
ProActiveRuntime.getProActiveRuntimes()

getProActiveRuntime

public ProActiveRuntime getProActiveRuntime(java.lang.String proActiveRuntimeName)
Description copied from interface: ProActiveRuntime
Returns the ProActiveRuntime of specified name

Specified by:
getProActiveRuntime in interface ProActiveRuntime
Parameters:
proActiveRuntimeName - the name of the ProActiveruntime to return
Returns:
the ProActiveRuntime of specified name
See Also:
ProActiveRuntime.getProActiveRuntime(String)

killRT

public void killRT(boolean softly)
Description copied from interface: ProActiveRuntime
Kills this ProActiveRuntime and this VM

Specified by:
killRT in interface ProActiveRuntime
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.
See Also:
ProActiveRuntime.killRT(boolean)

getURL

public java.lang.String getURL()
Description copied from interface: ProActiveRuntime
Returns the url of this ProActiveRuntime on the local or remote VM

Specified by:
getURL in interface ProActiveRuntime
See Also:
ProActiveRuntime.getURL()

getActiveObjects

public java.util.ArrayList getActiveObjects(java.lang.String nodeName)
Description copied from interface: ProActiveRuntime
Returns all Active Objects deployed on the node with the given name on this ProActiveRuntime

Specified by:
getActiveObjects in interface ProActiveRuntime
Parameters:
nodeName - the name of the node
Returns:
Object[] Active Objects deployed on this ProactiveRuntime

getVirtualNode

public VirtualNode getVirtualNode(java.lang.String virtualNodeName)
Description copied from interface: ProActiveRuntime
Returns the VirtualNode with the given name

Specified by:
getVirtualNode in interface ProActiveRuntime
Returns:
VirtualNode the virtualnode of the given name or null if such virtualNode does not exist.

registerVirtualNode

public void registerVirtualNode(java.lang.String virtualNodeName,
                                boolean replacePreviousBinding)
Description copied from interface: ProActiveRuntime
Registers the virtualNode of the given name in a registry such RMIRegistry or Jini Service Lookup

Specified by:
registerVirtualNode in interface ProActiveRuntime
Parameters:
virtualNodeName -

unregisterVirtualNode

public void unregisterVirtualNode(java.lang.String virtualNodeName)
Description copied from interface: ProActiveRuntime
Unregisters the VirtualNode of the given name from the local runtime.

Specified by:
unregisterVirtualNode in interface ProActiveRuntime
Parameters:
virtualNodeName - the virtualNode to unregister.

unregisterAllVirtualNodes

public void unregisterAllVirtualNodes()
Description copied from interface: ProActiveRuntime
Unregisters all VirtualNodes from the local runtime

Specified by:
unregisterAllVirtualNodes in interface ProActiveRuntime

getJobID

public java.lang.String getJobID(java.lang.String nodeUrl)
Specified by:
getJobID in interface ProActiveRuntime
Returns:
the jobId of the node with the given name
See Also:
ProActiveRuntime.getJobID(java.lang.String)

getActiveObjects

public java.util.ArrayList getActiveObjects(java.lang.String nodeName,
                                            java.lang.String objectName)
Description copied from interface: ProActiveRuntime
Returns all Active Objects with the specified class name, deployed on the node with the given name on this ProActiveRuntime

Specified by:
getActiveObjects in interface ProActiveRuntime
Parameters:
nodeName - the name of the node
Returns:
Object[] Active Objects of the specified class name deployed on this ProactiveRuntime

createBody

public UniversalBody createBody(java.lang.String nodeName,
                                ConstructorCall bodyConstructorCall,
                                boolean isLocal)
                         throws ConstructorCallExecutionFailedException,
                                java.lang.reflect.InvocationTargetException
Description copied from interface: ProActiveRuntime

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.

Specified by:
createBody in interface ProActiveRuntime
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
isLocal - boolean. True if proxy and body are on the same vm, false otherwise
Returns:
a stub on the newly created body.
Throws:
ConstructorCallExecutionFailedException - if the constructor call cannot be executed
java.lang.reflect.InvocationTargetException - if the java constructor execution failed
See Also:
ProActiveRuntime.createBody(String, ConstructorCall, boolean)

receiveBody

public UniversalBody receiveBody(java.lang.String nodeName,
                                 Body body)
Description copied from interface: ProActiveRuntime

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.

Specified by:
receiveBody in interface ProActiveRuntime
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.
See Also:
ProActiveRuntime.receiveBody(String, Body)

getCreatorCertificate

public java.security.cert.X509Certificate getCreatorCertificate()
Specified by:
getCreatorCertificate in interface ProActiveRuntime
Returns:
creator's certificate if exists

getPolicyServer

public PolicyServer getPolicyServer()
Specified by:
getPolicyServer in interface ProActiveRuntime
Returns:
Policy server

getVNName

public java.lang.String getVNName(java.lang.String nodeName)
Specified by:
getVNName in interface ProActiveRuntime

setProActiveSecurityManager

public void setProActiveSecurityManager(ProActiveSecurityManager server)
set policy server to all virtual nodes

Specified by:
setProActiveSecurityManager in interface ProActiveRuntime

setDefaultNodeVirtualNodeName

public void setDefaultNodeVirtualNodeName(java.lang.String s)
Specified by:
setDefaultNodeVirtualNodeName in interface ProActiveRuntime

listVirtualNodes

public void listVirtualNodes()
Specified by:
listVirtualNodes in interface ProActiveRuntime

getNodePolicyServer

public PolicyServer getNodePolicyServer(java.lang.String nodeName)
Specified by:
getNodePolicyServer in interface ProActiveRuntime

enableSecurityIfNeeded

public void enableSecurityIfNeeded()
Description copied from interface: ProActiveRuntime
sets all needed modifications to enable security components MUST be called when the descriptor is ready

Specified by:
enableSecurityIfNeeded in interface ProActiveRuntime

getNodeCertificate

public java.security.cert.X509Certificate getNodeCertificate(java.lang.String nodeName)
(non-Javadoc)

Specified by:
getNodeCertificate in interface ProActiveRuntime
Parameters:
nodeName -
Returns:
return certificate associated to the node designed by nodeName
See Also:
ProActiveRuntime.getNodeCertificate(java.lang.String)

getEntities

public java.util.ArrayList getEntities(java.lang.String nodeName)
Specified by:
getEntities in interface ProActiveRuntime
Parameters:
nodeName -
Returns:
returns all entities associated to the node

getEntities

public java.util.ArrayList getEntities(UniversalBody uBody)
Specified by:
getEntities in interface ProActiveRuntime
Returns:
returns all entities associated to the node

getEntities

public java.util.ArrayList getEntities()
Specified by:
getEntities in interface ProActiveRuntime
Returns:
returns all entities associated to this runtime

getJobID

public java.lang.String getJobID()
Specified by:
getJobID in interface Job
Returns:
the jobID associated with this object
See Also:
Job.getJobID()


Copyright © April 2004 INRIA All Rights Reserved.