org.objectweb.proactive.core.body
Interface UniversalBody

All Superinterfaces:
Job, NFEProducer, SecurityEntity, java.io.Serializable
All Known Subinterfaces:
Body
All Known Implementing Classes:
AbstractBody, AbstractUniversalBody, BodyAdapter, EncryptedBody, UniversalBodyWrapper

public interface UniversalBody
extends NFEProducer, Job, java.io.Serializable, SecurityEntity

An object implementing this interface provides the minimum service a body offers remotely or locally. This interface is the generic version that is used remotely and locally. A body accessed from the same JVM offers all services of this interface, plus the services defined in the Body interface.

Since:
ProActive 0.9
Version:
1.0, 2001/10/23
Author:
ProActive Team
See Also:
Body, RmiBodyAdapter

Field Summary
static org.apache.log4j.Logger bodyLogger
           
 
Method Summary
 void createShortcut(Shortcut shortcut)
          similar to the updateLocation(org.objectweb.proactive.core.UniqueID, UniversalBody) method, it allows direct communication to the target of a functional call, accross membranes of composite components.
 void disableAC()
          Disables automatic continuation mechanism for this body
 void enableAC()
          Enables automatic continuation mechanism for this body
 UniqueID getID()
          Returns the UniqueID of this body This identifier is unique accross all JVMs
 java.lang.String getNodeURL()
          Returns the url of the node this body is associated to The url of the node can change if the active object migrates
 BodyAdapter getRemoteAdapter()
          Returns the remote friendly version of this body
 java.lang.Object receiveFTMessage(FTMessage ev)
          For sending a non fonctional message to the FTManager linked to this object.
 int receiveReply(Reply r)
          Receives a reply in response to a former request.
 int receiveRequest(Request request)
          Receives a request for later processing.
 void removeImmediateService(java.lang.String methodName, java.lang.Class[] parametersTypes)
          Removes an immediate service for this body An immediate service is a method that will bw excecuted by the calling thread.
 void setImmediateService(java.lang.String methodName)
          For setting an immediate service for this body.
 void setImmediateService(java.lang.String methodName, java.lang.Class[] parametersTypes)
          Adds an immediate service for this body An immediate service is a method that will bw excecuted by the calling thread.
 void terminate()
          Terminate the body.
 void updateLocation(UniqueID id, UniversalBody body)
          Signals to this body that the body identified by id is now to a new remote location.
 
Methods inherited from interface org.objectweb.proactive.core.exceptions.manager.NFEProducer
addNFEListener, fireNFE, removeNFEListener
 
Methods inherited from interface org.objectweb.proactive.Job
getJobID
 
Methods inherited from interface org.objectweb.proactive.ext.security.SecurityEntity
getCertificate, getCertificateEncoded, getEntities, getPolicy, getPublicKey, publicKeyExchange, randomValue, secretKeyExchange, startNewSession, terminateSession
 

Field Detail

bodyLogger

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

receiveRequest

public int receiveRequest(Request request)
                   throws java.io.IOException,
                          RenegotiateSessionException
Receives a request for later processing. The call to this method is non blocking unless the body cannot temporary receive the request.

Parameters:
request - the request to process
Returns:
value for fault-tolerance protocol
Throws:
java.io.IOException - if the request cannot be accepted
RenegotiateSessionException

receiveReply

public int receiveReply(Reply r)
                 throws java.io.IOException
Receives a reply in response to a former request.

Parameters:
r - the reply received
Returns:
value for fault-tolerance procotol
Throws:
java.io.IOException - if the reply cannot be accepted

getNodeURL

public java.lang.String getNodeURL()
Returns the url of the node this body is associated to The url of the node can change if the active object migrates

Returns:
the url of the node this body is associated to

getID

public UniqueID getID()
Returns the UniqueID of this body This identifier is unique accross all JVMs

Returns:
the UniqueID of this body

updateLocation

public void updateLocation(UniqueID id,
                           UniversalBody body)
                    throws java.io.IOException
Signals to this body that the body identified by id is now to a new remote location. The body given in parameter is a new stub pointing to this new location. This call is a way for a body to signal to his peer that it has migrated to a new location

Parameters:
id - the id of the body
body - the stub to the new location
Throws:
java.io.IOException - if a pb occurs during this method call

createShortcut

public void createShortcut(Shortcut shortcut)
                    throws java.io.IOException
similar to the updateLocation(org.objectweb.proactive.core.UniqueID, UniversalBody) method, it allows direct communication to the target of a functional call, accross membranes of composite components.

Parameters:
shortcut - the shortcut to create
Throws:
java.io.IOException - if a pb occurs during this method call

getRemoteAdapter

public BodyAdapter getRemoteAdapter()
Returns the remote friendly version of this body

Returns:
the remote friendly version of this body

terminate

public void terminate()
               throws java.io.IOException
Terminate the body. After this call the body is no more alive and no more active although the active thread is not interrupted. The body is unuseable after this call.

Throws:
java.io.IOException - if a pb occurs during this method call

enableAC

public void enableAC()
              throws java.io.IOException
Enables automatic continuation mechanism for this body

Throws:
java.io.IOException - if a pb occurs during this method call

disableAC

public void disableAC()
               throws java.io.IOException
Disables automatic continuation mechanism for this body

Throws:
java.io.IOException - if a pb occurs during this method call

setImmediateService

public void setImmediateService(java.lang.String methodName)
                         throws java.io.IOException
For setting an immediate service for this body. An immediate service is a method that will bw excecuted by the calling thread.

Throws:
java.io.IOException - if a pb occurs during this method call

setImmediateService

public void setImmediateService(java.lang.String methodName,
                                java.lang.Class[] parametersTypes)
                         throws java.io.IOException
Adds an immediate service for this body An immediate service is a method that will bw excecuted by the calling thread.

Parameters:
methodName - the name of the method
parametersTypes - the types of the parameters of the method
Throws:
java.io.IOException - if a pb occurs during this method call

removeImmediateService

public void removeImmediateService(java.lang.String methodName,
                                   java.lang.Class[] parametersTypes)
                            throws java.io.IOException
Removes an immediate service for this body An immediate service is a method that will bw excecuted by the calling thread.

Parameters:
methodName - the name of the method
parametersTypes - the types of the parameters of the method
Throws:
java.io.IOException - if a pb occurs during this method call

receiveFTMessage

public java.lang.Object receiveFTMessage(FTMessage ev)
                                  throws java.io.IOException
For sending a non fonctional message to the FTManager linked to this object.

Parameters:
ev - the message to send
Returns:
depends on the message meaning
Throws:
java.io.IOException - if a pb occurs during this method call


Copyright 2001-2005 INRIA All Rights Reserved.