org.objectweb.proactive.core.body
Interface RemoteBody

All Superinterfaces:
SecurityEntity, java.io.Serializable
All Known Subinterfaces:
IbisRemoteBody, RmiRemoteBody
All Known Implementing Classes:
BodyAdapterForwarder, HttpRemoteBodyImpl, IbisRemoteBodyImpl, JiniRemoteBodyImpl, RmiRemoteBodyImpl

public interface RemoteBody
extends java.io.Serializable, SecurityEntity

An object implementing this interface provides the minimum service a body offers remotely. This interface is extended by protocol-specific(RMI, RMI/SSH, IBIS, HTTP, JINI) remote interfaces to allow the body to be accessed remotely.

Since:
ProActive 2.2
Version:
1.0
Author:
ProActiveTeam
See Also:
UniversalBody, Adapter Pattern

Field Summary
static org.apache.log4j.Logger bodyLogger
           
 
Method Summary
 void addNFEListener(NFEListener listener)
           
 void changeProxiedBody(Body newBody)
          Change the body referenced by this adapter
 void disableAC()
          Disables automatic continuation mechanism for this body
 void enableAC()
          Enables automatic continuation mechanism for this body
 int fireNFE(NonFunctionalException e)
           
 UniqueID getID()
          Returns the UniqueID of this body This identifier is unique accross all JVMs
 java.lang.String getJobID()
           
 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
 java.lang.Object receiveFTMessage(FTMessage fte)
          For sending a message to the FTManager linked to this object
 int receiveReply(Reply r)
          Receives a reply in response to a former request.
 int receiveRequest(Request r)
          Receives a request for later processing.
 void removeImmediateService(java.lang.String methodName, java.lang.Class[] parametersTypes)
           
 void removeNFEListener(NFEListener listener)
           
 void setImmediateService(java.lang.String methodName)
          For setting an immediate service for this body.
 void setImmediateService(java.lang.String methodName, java.lang.Class[] parametersTypes)
           
 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.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 r)
                   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:
r - 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 protocol
Throws:
java.io.IOException - if the reply cannot be accepted

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 an exception occured during the remote communication

getNodeURL

public java.lang.String getNodeURL()
                            throws java.io.IOException
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
Throws:
java.io.IOException - if an exception occured during the remote communication

getID

public UniqueID getID()
               throws java.io.IOException
Returns the UniqueID of this body This identifier is unique accross all JVMs

Returns:
the UniqueID of this body
Throws:
java.io.IOException - if an exception occured during the remote communication

getJobID

public java.lang.String getJobID()
                          throws java.io.IOException
Returns:
the JobID of the remote body
Throws:
java.io.IOException - if an exception occured during the remote communication

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 an exception occured during the remote communication

enableAC

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

Throws:
java.io.IOException - if an exception occured during the remote communication

disableAC

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

Throws:
java.io.IOException - if an exception occured during the remote communication

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 an exception occured during the remote communication

setImmediateService

public void setImmediateService(java.lang.String methodName,
                                java.lang.Class[] parametersTypes)
                         throws java.io.IOException
Throws:
java.io.IOException

removeImmediateService

public void removeImmediateService(java.lang.String methodName,
                                   java.lang.Class[] parametersTypes)
                            throws java.io.IOException
Throws:
java.io.IOException

receiveFTMessage

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

Parameters:
fte - the message
Returns:
depends on the message meaning
Throws:
java.io.IOException - if an exception occured during the remote communication

changeProxiedBody

public void changeProxiedBody(Body newBody)
                       throws java.io.IOException
Change the body referenced by this adapter

Parameters:
newBody - the body referenced after the call
Throws:
java.io.IOException - if an exception occured during the remote communication

addNFEListener

public void addNFEListener(NFEListener listener)
                    throws java.io.IOException
Throws:
java.io.IOException

removeNFEListener

public void removeNFEListener(NFEListener listener)
                       throws java.io.IOException
Throws:
java.io.IOException

fireNFE

public int fireNFE(NonFunctionalException e)
            throws java.io.IOException
Throws:
java.io.IOException


Copyright 2001-2005 INRIA All Rights Reserved.