org.objectweb.proactive.core.runtime
Class ProActiveRuntimeAdapterForwarderImpl

java.lang.Object
  extended byorg.objectweb.proactive.core.runtime.ProActiveRuntimeAdapter
      extended byorg.objectweb.proactive.core.runtime.ProActiveRuntimeAdapterForwarderImpl
All Implemented Interfaces:
java.lang.Cloneable, Job, ProActiveRuntime, SecurityEntity, java.io.Serializable

public class ProActiveRuntimeAdapterForwarderImpl
extends ProActiveRuntimeAdapter
implements java.io.Serializable, java.lang.Cloneable

An adapter for a RemoteProActiveRuntimeForwarder. The Adpater is the generic entry point for remote calls to a RemoteProActiveRuntimeForwarder using different protocols such as RMI, RMISSH, IBIS, HTTP, JINI. This also allows to cache informations, and so to avoid crossing the network when calling some methods. All calls done on a ProActiveRuntimeAdapterForwarderImpl, method1(foo, bar) for example, are translated into remotePA.method1(urid, foo, bar) where urid is an unique identifiant for runtimes. The forwarder forwards the call to the right runtime by using this ID.

Author:
ProActiveTeam
See Also:
Serialized Form

Field Summary
protected  boolean alreadykilled
           
protected  RemoteProActiveRuntimeForwarder proActiveRuntime
           
protected  java.lang.String proActiveRuntimeURL
           
 
Fields inherited from class org.objectweb.proactive.core.runtime.ProActiveRuntimeAdapter
vmInformation
 
Fields inherited from interface org.objectweb.proactive.core.runtime.ProActiveRuntime
runtimeLogger
 
Constructor Summary
ProActiveRuntimeAdapterForwarderImpl()
           
ProActiveRuntimeAdapterForwarderImpl(ProActiveRuntimeAdapterForwarderImpl localAdapter, ProActiveRuntime remoteAdapter)
           
ProActiveRuntimeAdapterForwarderImpl(RemoteProActiveRuntimeForwarder proActiveRuntime)
           
 
Method Summary
 void addAcquaintance(java.lang.String proActiveRuntimeName)
          **For internal use only** Tells this runtime that it's registered in another one
 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, ProActiveSecurityManager psm, 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.
 boolean equals(java.lang.Object o)
           
 java.lang.String[] getAcquaintances()
          Returns all the ProActiveRuntime URL in which this runtime is registered
 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 getCertificate()
          entity certificate
 byte[] getCertificateEncoded()
          Entity's X509Certificate as byte array
 byte[] getClassDataFromParentRuntime(java.lang.String className)
          Looks for class bytecode in the ancestors of the current runtime : first it tries in the father runtime, then in the grand-father etc...
 byte[] getClassDataFromThisRuntime(java.lang.String className)
          Looks for class bytecode in the current runtime.
 ProActiveDescriptor getDescriptor(java.lang.String url, boolean isHierarchicalSearch)
          return the pad matching with the given url or parse it from the file system
 java.util.ArrayList getEntities()
          Retrieves all the entity's ID which contain this entity plus this entity ID.
 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
 SecurityContext getPolicy(SecurityContext securityContext)
          Ask the entity to fill the securityContext parameters with its own policy according to the communication details contained in the given securityContext
 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
 ExternalProcess getProcessToDeploy(ProActiveRuntime proActiveRuntimeDist, java.lang.String creatorID, java.lang.String vmName, java.lang.String padURL)
          Ask proActiveRuntimeDist for the process with given ids: padURL, creatorID, vmName.
 java.security.PublicKey getPublicKey()
          entity public key
 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)
           
 int hashCode()
           
 void killAllNodes()
          Kills all Nodes in this ProActiveRuntime
 void killNode(java.lang.String nodeName)
          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 launchMain(java.lang.String className, java.lang.String[] parameters)
          launch the main method of the main class with parameters
 void newRemote(java.lang.String className)
          construct a new instance remotly
 byte[][] publicKeyExchange(long sessionID, byte[] myPublicKey, byte[] myCertificate, byte[] signature)
          exchange entity certificate and/or public key if certificate are not available
 byte[] randomValue(long sessionID, byte[] clientRandomValue)
          Exchange random value between client and server entity
 UniversalBody receiveBody(java.lang.String nodeName, Body body)
           This method is the basis for migrating active objects.
 UniversalBody receiveCheckpoint(java.lang.String nodeName, Checkpoint ckpt, int inc)
          The runtime recovers the body contained in the checkpoint ckpt.
 void register(ProActiveRuntime proActiveRuntimeDist, java.lang.String proActiveRuntimeUrl, 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 rmAcquaintance(java.lang.String proActiveRuntimeName)
          **For internal use only** .
 byte[][] secretKeyExchange(long sessionID, byte[] encodedAESKey, byte[] encodedIVParameters, byte[] encodedClientMacKey, byte[] encodedLockData, byte[] parametersSignature)
          this method sends encoded secret parameters to the target entity
 long startNewSession(Communication policy)
          start an unvalidated empty session
 void terminateSession(long sessionID)
          terminate a given session
 void unregister(ProActiveRuntime proActiveRuntimeDist, java.lang.String proActiveRuntimeUrl, java.lang.String creatorID, java.lang.String creationProtocol, java.lang.String vmName)
          **For internal use only** Allows this ProactiveRuntime on this VM to unregister an already resigesterd ProActiveRuntime.
 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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

proActiveRuntime

protected RemoteProActiveRuntimeForwarder proActiveRuntime

proActiveRuntimeURL

protected java.lang.String proActiveRuntimeURL

alreadykilled

protected boolean alreadykilled
Constructor Detail

ProActiveRuntimeAdapterForwarderImpl

public ProActiveRuntimeAdapterForwarderImpl()

ProActiveRuntimeAdapterForwarderImpl

public ProActiveRuntimeAdapterForwarderImpl(RemoteProActiveRuntimeForwarder proActiveRuntime)
                                     throws ProActiveException

ProActiveRuntimeAdapterForwarderImpl

public ProActiveRuntimeAdapterForwarderImpl(ProActiveRuntimeAdapterForwarderImpl localAdapter,
                                            ProActiveRuntime remoteAdapter)
                                     throws ProActiveException
Method Detail

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

createLocalNode

public java.lang.String createLocalNode(java.lang.String nodeName,
                                        boolean replacePreviousBinding,
                                        ProActiveSecurityManager psm,
                                        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
See Also:
ProActiveRuntime.createLocalNode(java.lang.String, boolean, ProActiveSecurityManager, java.lang.String, java.lang.String)

killAllNodes

public void killAllNodes()
                  throws ProActiveException
Description copied from interface: ProActiveRuntime
Kills all Nodes in this ProActiveRuntime

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

killNode

public void killNode(java.lang.String nodeName)
              throws ProActiveException
Description copied from interface: ProActiveRuntime
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
Throws:
ProActiveException
See Also:
ProActiveRuntime.killNode(java.lang.String)

createVM

public void createVM(UniversalProcess remoteProcess)
              throws java.io.IOException,
                     ProActiveException
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
ProActiveException
See Also:
ProActiveRuntime.createVM(org.objectweb.proactive.core.process.UniversalProcess)

getLocalNodeNames

public java.lang.String[] getLocalNodeNames()
                                     throws ProActiveException
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
Throws:
ProActiveException
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 proActiveRuntimeUrl,
                     java.lang.String creatorID,
                     java.lang.String creationProtocol,
                     java.lang.String vmName)
              throws ProActiveException
Description copied from interface: ProActiveRuntime
**For internal use only** Allows this ProActiveRuntime on this VM to register another ProActiveRuntime

Specified by:
register in interface ProActiveRuntime
Parameters:
proActiveRuntimeDist - the remote ProactiveRuntime to register
proActiveRuntimeUrl - the url 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
Throws:
ProActiveException
See Also:
ProActiveRuntime.register(org.objectweb.proactive.core.runtime.ProActiveRuntime, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

unregister

public void unregister(ProActiveRuntime proActiveRuntimeDist,
                       java.lang.String proActiveRuntimeUrl,
                       java.lang.String creatorID,
                       java.lang.String creationProtocol,
                       java.lang.String vmName)
                throws ProActiveException
Description copied from interface: ProActiveRuntime
**For internal use only** Allows this ProactiveRuntime on this VM to unregister an already resigesterd ProActiveRuntime.

Specified by:
unregister in interface ProActiveRuntime
Parameters:
proActiveRuntimeDist - the remote ProactiveRuntime to unregister.
proActiveRuntimeUrl - the url 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
Throws:
ProActiveException
See Also:
ProActiveRuntime.unregister(org.objectweb.proactive.core.runtime.ProActiveRuntime, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

getProActiveRuntimes

public ProActiveRuntime[] getProActiveRuntimes()
                                        throws ProActiveException
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
Throws:
ProActiveException
See Also:
ProActiveRuntime.getProActiveRuntimes()

getProActiveRuntime

public ProActiveRuntime getProActiveRuntime(java.lang.String proActiveRuntimeName)
                                     throws ProActiveException
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
Throws:
ProActiveException
See Also:
ProActiveRuntime.getProActiveRuntime(java.lang.String)

addAcquaintance

public void addAcquaintance(java.lang.String proActiveRuntimeName)
                     throws ProActiveException
Description copied from interface: ProActiveRuntime
**For internal use only** Tells this runtime that it's registered in another one

Specified by:
addAcquaintance in interface ProActiveRuntime
Parameters:
proActiveRuntimeName - the name of the remote ProActiveRuntime in which this runtime is registered
Throws:
ProActiveException
See Also:
ProActiveRuntime.addAcquaintance(java.lang.String)

getAcquaintances

public java.lang.String[] getAcquaintances()
                                    throws ProActiveException
Description copied from interface: ProActiveRuntime
Returns all the ProActiveRuntime URL in which this runtime is registered

Specified by:
getAcquaintances in interface ProActiveRuntime
Returns:
all the ProActiveRuntime URL in which this runtime is registered
Throws:
ProActiveException
See Also:
ProActiveRuntime.getAcquaintances()

rmAcquaintance

public void rmAcquaintance(java.lang.String proActiveRuntimeName)
                    throws ProActiveException
Description copied from interface: ProActiveRuntime
**For internal use only** . Tell to this runtime that is no more registered in proActiveRuntimeName.

Specified by:
rmAcquaintance in interface ProActiveRuntime
Parameters:
proActiveRuntimeName - the name of the remote ProActiveRuntime.
Throws:
ProActiveException
See Also:
ProActiveRuntime.rmAcquaintance(java.lang.String)

killRT

public void killRT(boolean softly)
            throws java.lang.Exception
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.
Throws:
java.lang.Exception - if a problem occurs when killing this ProActiveRuntime
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)
                                     throws ProActiveException
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:
ArrayList of ArrayList. The latter contains [body, classname].
Throws:
ProActiveException
See Also:
ProActiveRuntime.getActiveObjects(java.lang.String)

getActiveObjects

public java.util.ArrayList getActiveObjects(java.lang.String nodeName,
                                            java.lang.String className)
                                     throws ProActiveException
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
className - class of the Active Objects to look for
Returns:
Active Objects of the specified class name deployed on this ProactiveRuntime
Throws:
ProActiveException
See Also:
ProActiveRuntime.getActiveObjects(java.lang.String, java.lang.String)

getVirtualNode

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

Specified by:
getVirtualNode in interface ProActiveRuntime
Parameters:
virtualNodeName - the name of the VirtualNode to be acquired
Returns:
VirtualNode the virtualnode of the given name or null if such virtualNode does not exist, or has not been yet activated.
Throws:
ProActiveException
See Also:
ProActiveRuntime.getVirtualNode(java.lang.String)

registerVirtualNode

public void registerVirtualNode(java.lang.String virtualNodeName,
                                boolean replacePreviousBinding)
                         throws ProActiveException
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 -
Throws:
ProActiveException
See Also:
ProActiveRuntime.registerVirtualNode(java.lang.String, boolean)

unregisterVirtualNode

public void unregisterVirtualNode(java.lang.String virtualNodeName)
                           throws ProActiveException
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.
Throws:
ProActiveException
See Also:
ProActiveRuntime.unregisterVirtualNode(java.lang.String)

unregisterAllVirtualNodes

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

Specified by:
unregisterAllVirtualNodes in interface ProActiveRuntime
Throws:
ProActiveException
See Also:
ProActiveRuntime.unregisterAllVirtualNodes()

getJobID

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

createBody

public UniversalBody createBody(java.lang.String nodeName,
                                ConstructorCall bodyConstructorCall,
                                boolean isNodeLocal)
                         throws ConstructorCallExecutionFailedException,
                                java.lang.reflect.InvocationTargetException,
                                ProActiveException
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
isNodeLocal - boolean. True if proxy and body are on the same vm, false otherwise
Returns:
a stub on the newly created body.
Throws:
ProActiveException
java.lang.reflect.InvocationTargetException - if the java constructor execution failed
ConstructorCallExecutionFailedException - if the constructor call cannot be executed
See Also:
ProActiveRuntime.createBody(java.lang.String, org.objectweb.proactive.core.mop.ConstructorCall, boolean)

receiveBody

public UniversalBody receiveBody(java.lang.String nodeName,
                                 Body body)
                          throws ProActiveException
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.
Throws:
ProActiveException
See Also:
ProActiveRuntime.receiveBody(java.lang.String, org.objectweb.proactive.Body)

receiveCheckpoint

public UniversalBody receiveCheckpoint(java.lang.String nodeName,
                                       Checkpoint ckpt,
                                       int inc)
                                throws ProActiveException
Description copied from interface: ProActiveRuntime
The runtime recovers the body contained in the checkpoint ckpt.

Specified by:
receiveCheckpoint in interface ProActiveRuntime
Parameters:
nodeName - node on which the body is restarted
ckpt - checkpoint to use for recovery
inc - incarnation number of this recovery
Returns:
*not used*
Throws:
ProActiveException
See Also:
ProActiveRuntime.receiveCheckpoint(java.lang.String, org.objectweb.proactive.core.body.ft.checkpointing.Checkpoint, int)

getVNName

public java.lang.String getVNName(java.lang.String Nodename)
                           throws ProActiveException
Specified by:
getVNName in interface ProActiveRuntime
Throws:
ProActiveException
See Also:
ProActiveRuntime.getVNName(java.lang.String)

getClassDataFromThisRuntime

public byte[] getClassDataFromThisRuntime(java.lang.String className)
                                   throws ProActiveException
Description copied from interface: ProActiveRuntime
Looks for class bytecode in the current runtime. If current runtime has no father, stub generation can be intented to get the class bytecode

Specified by:
getClassDataFromThisRuntime in interface ProActiveRuntime
Parameters:
className - name of the class
Returns:
the bytecode corresponding to the given class, or null if not found
Throws:
ProActiveException
See Also:
ProActiveRuntime.getClassDataFromThisRuntime(java.lang.String)

getClassDataFromParentRuntime

public byte[] getClassDataFromParentRuntime(java.lang.String className)
                                     throws ProActiveException
Description copied from interface: ProActiveRuntime
Looks for class bytecode in the ancestors of the current runtime : first it tries in the father runtime, then in the grand-father etc...

Specified by:
getClassDataFromParentRuntime in interface ProActiveRuntime
Parameters:
className - name of the class
Returns:
the bytecode corresponding to the given class, or null if not found
Throws:
ProActiveException
See Also:
ProActiveRuntime.getClassDataFromParentRuntime(java.lang.String)

getProcessToDeploy

public ExternalProcess getProcessToDeploy(ProActiveRuntime proActiveRuntimeDist,
                                          java.lang.String creatorID,
                                          java.lang.String vmName,
                                          java.lang.String padURL)
                                   throws ProActiveException
Description copied from interface: ProActiveRuntime
Ask proActiveRuntimeDist for the process with given ids: padURL, creatorID, vmName. Used for hierarchical deployment.

Specified by:
getProcessToDeploy in interface ProActiveRuntime
Parameters:
proActiveRuntimeDist -
creatorID -
vmName -
padURL -
Returns:
the process with given ids: padURL, creatorID, vmName
Throws:
ProActiveException

getJobID

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

getDescriptor

public ProActiveDescriptor getDescriptor(java.lang.String url,
                                         boolean isHierarchicalSearch)
                                  throws java.io.IOException,
                                         ProActiveException
Description copied from interface: ProActiveRuntime
return the pad matching with the given url or parse it from the file system

Specified by:
getDescriptor in interface ProActiveRuntime
Parameters:
url - url of the pad
isHierarchicalSearch - if yes search for the pad hierarchically
Returns:
the pad found or a new pad parsed from xmlDescriptorUrl
Throws:
ProActiveException
java.io.IOException

launchMain

public void launchMain(java.lang.String className,
                       java.lang.String[] parameters)
                throws java.lang.ClassNotFoundException,
                       java.lang.NoSuchMethodException,
                       ProActiveException
Description copied from interface: ProActiveRuntime
launch the main method of the main class with parameters

Specified by:
launchMain in interface ProActiveRuntime
Parameters:
className -
parameters -
Throws:
ProActiveException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException

newRemote

public void newRemote(java.lang.String className)
               throws java.lang.ClassNotFoundException,
                      ProActiveException
Description copied from interface: ProActiveRuntime
construct a new instance remotly

Specified by:
newRemote in interface ProActiveRuntime
Parameters:
className - class to instance
Throws:
java.lang.ClassNotFoundException
ProActiveException

getCertificate

public java.security.cert.X509Certificate getCertificate()
                                                  throws SecurityNotAvailableException,
                                                         java.io.IOException
Description copied from interface: SecurityEntity
entity certificate

Specified by:
getCertificate in interface SecurityEntity
Returns:
returns entity certificate
Throws:
java.io.IOException - if communication fails
SecurityNotAvailableException - if security is not available

getCertificateEncoded

public byte[] getCertificateEncoded()
                             throws SecurityNotAvailableException,
                                    java.io.IOException
Description copied from interface: SecurityEntity
Entity's X509Certificate as byte array

Specified by:
getCertificateEncoded in interface SecurityEntity
Returns:
entity's X509Certificate as byte array
Throws:
SecurityNotAvailableException
java.io.IOException

getEntities

public java.util.ArrayList getEntities()
                                throws SecurityNotAvailableException,
                                       java.io.IOException
Description copied from interface: SecurityEntity
Retrieves all the entity's ID which contain this entity plus this entity ID.

Specified by:
getEntities in interface SecurityEntity
Returns:
returns all the entity's ID which contain this entity plus this entity ID.
Throws:
SecurityNotAvailableException - if the target entity does not support security
java.io.IOException

getPublicKey

public java.security.PublicKey getPublicKey()
                                     throws SecurityNotAvailableException,
                                            java.io.IOException
Description copied from interface: SecurityEntity
entity public key

Specified by:
getPublicKey in interface SecurityEntity
Returns:
returns entity public key
Throws:
SecurityNotAvailableException
java.io.IOException

publicKeyExchange

public byte[][] publicKeyExchange(long sessionID,
                                  byte[] myPublicKey,
                                  byte[] myCertificate,
                                  byte[] signature)
                           throws SecurityNotAvailableException,
                                  RenegotiateSessionException,
                                  KeyExchangeException,
                                  java.io.IOException
Description copied from interface: SecurityEntity
exchange entity certificate and/or public key if certificate are not available

Specified by:
publicKeyExchange in interface SecurityEntity
Parameters:
sessionID - the session ID
myPublicKey - encoded public key
myCertificate - encoded certificate
signature - encoded signature of previous paramaters
Returns:
an array containing : - server certificate and/or server public key - encoded signature of these parameters
Throws:
SecurityNotAvailableException - if the security is not available
KeyExchangeException - if a key data/length/algorithm is not supported
RenegotiateSessionException - if the session has expired
java.io.IOException

randomValue

public byte[] randomValue(long sessionID,
                          byte[] clientRandomValue)
                   throws SecurityNotAvailableException,
                          RenegotiateSessionException,
                          java.io.IOException
Description copied from interface: SecurityEntity
Exchange random value between client and server entity

Specified by:
randomValue in interface SecurityEntity
Parameters:
sessionID - the session ID
clientRandomValue - client random value
Returns:
server random value
Throws:
RenegotiateSessionException - if the session has expired
SecurityNotAvailableException - if the security is not available
java.io.IOException

secretKeyExchange

public byte[][] secretKeyExchange(long sessionID,
                                  byte[] encodedAESKey,
                                  byte[] encodedIVParameters,
                                  byte[] encodedClientMacKey,
                                  byte[] encodedLockData,
                                  byte[] parametersSignature)
                           throws SecurityNotAvailableException,
                                  RenegotiateSessionException,
                                  java.io.IOException
Description copied from interface: SecurityEntity
this method sends encoded secret parameters to the target entity

Specified by:
secretKeyExchange in interface SecurityEntity
Parameters:
sessionID - session ID
encodedAESKey - the AES key use to exchange secret message
encodedIVParameters - Initilization parameters for the AES key
encodedClientMacKey - MAC key for checking signature of future messages
encodedLockData - random value to prevent message replays by an external attacker
parametersSignature - encoded signature of the previous parameters
Returns:
an array containing : - encoded server AES key - encoded IV parameters - encoded server MAC key - encoded lock data to prevent message replays - encoded signature of previous parameters
Throws:
java.io.IOException - if communication fails
RenegotiateSessionException - if the session has expired or has been cancelled during this exchange
SecurityNotAvailableException - if this entity does not support security

startNewSession

public long startNewSession(Communication policy)
                     throws SecurityNotAvailableException,
                            RenegotiateSessionException,
                            java.io.IOException
Description copied from interface: SecurityEntity
start an unvalidated empty session

Specified by:
startNewSession in interface SecurityEntity
Parameters:
policy - policy associated to the session
Returns:
session ID
Throws:
RenegotiateSessionException - if the session immediatly expires
SecurityNotAvailableException - if security is not available
java.io.IOException

terminateSession

public void terminateSession(long sessionID)
                      throws SecurityNotAvailableException,
                             java.io.IOException
Description copied from interface: SecurityEntity
terminate a given session

Specified by:
terminateSession in interface SecurityEntity
Parameters:
sessionID -
Throws:
SecurityNotAvailableException - id security is not available
java.io.IOException

getPolicy

public SecurityContext getPolicy(SecurityContext securityContext)
                          throws SecurityNotAvailableException,
                                 java.io.IOException
Description copied from interface: SecurityEntity
Ask the entity to fill the securityContext parameters with its own policy according to the communication details contained in the given securityContext

Specified by:
getPolicy in interface SecurityEntity
Parameters:
securityContext - communication details allowing the entity to look for a matching policy
Returns:
securityContext filled with this entity's policy
Throws:
SecurityNotAvailableException - thrown the entity doest not support the security
java.io.IOException


Copyright 2001-2005 INRIA All Rights Reserved.