org.objectweb.proactive.core.body.request
Class BodyRequest

java.lang.Object
  |
  +--org.objectweb.proactive.core.body.message.MessageImpl
        |
        +--org.objectweb.proactive.core.body.request.BodyRequest
All Implemented Interfaces:
Message, Request, java.io.Serializable

public class BodyRequest
extends MessageImpl
implements Request, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  boolean isPriority
           
protected  MethodCall methodCall
           
 
Fields inherited from class org.objectweb.proactive.core.body.message.MessageImpl
ciphered, isOneWay, methodName, sequenceNumber, sessionID, sourceID, timeStamp
 
Constructor Summary
BodyRequest(Body targetBody, java.lang.String methodName, java.lang.Class[] paramClasses, java.lang.Object[] params, boolean isPriority)
           
 
Method Summary
 boolean decrypt(ProActiveSecurityManager psm)
           
 MethodCall getMethodCall()
          Returns the MethodCall embedded in the request
 java.lang.Object getParameter(int index)
          Returns the parameter number index from the method call embedded in the request
 UniversalBody getSender()
          Returns the sender of this request
 long getSessionId()
           
 boolean hasBeenForwarded()
          Returns true if the request has been forwarded
 boolean isCiphered()
           
 boolean isOneWay()
          Returns true if the message will not generate a response message
 void notifyReception(UniversalBody bodyReceiver)
          Notifies the request that it has been received by the destination.
 void send(UniversalBody destinationBody)
          Sends this request to the body destination
 Reply serve(Body targetBody)
          Serves this request by executing the embedded method call using the given targetBody.
protected  void serveInternal(Body targetBody)
           
 
Methods inherited from class org.objectweb.proactive.core.body.message.MessageImpl
getMethodName, getSequenceNumber, getSourceBodyID, getTimeStamp, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.proactive.core.body.message.Message
getMethodName, getSequenceNumber, getSourceBodyID, getTimeStamp
 

Field Detail

methodCall

protected MethodCall methodCall

isPriority

protected boolean isPriority
Constructor Detail

BodyRequest

public BodyRequest(Body targetBody,
                   java.lang.String methodName,
                   java.lang.Class[] paramClasses,
                   java.lang.Object[] params,
                   boolean isPriority)
            throws java.lang.NoSuchMethodException
Method Detail

isCiphered

public boolean isCiphered()
Specified by:
isCiphered in interface Request

decrypt

public boolean decrypt(ProActiveSecurityManager psm)
Specified by:
decrypt in interface Request

getSessionId

public long getSessionId()
Specified by:
getSessionId in interface Request

send

public void send(UniversalBody destinationBody)
          throws java.io.IOException
Description copied from interface: Request
Sends this request to the body destination

Specified by:
send in interface Request
Parameters:
destinationBody - the body destination of this request
Throws:
java.io.IOException - if the request fails to be sent

serve

public Reply serve(Body targetBody)
            throws ServeException
Description copied from interface: Request
Serves this request by executing the embedded method call using the given targetBody. Once the eventual result obtained from the method call a the reply is returned (based on that result).

Specified by:
serve in interface Request
Parameters:
targetBody - the body destination of the call
Returns:
the reply built using the result or null if the request is one way
Throws:
ServeException - if the method call fails to be served

isOneWay

public boolean isOneWay()
Description copied from interface: Message
Returns true if the message will not generate a response message

Specified by:
isOneWay in interface Message
Overrides:
isOneWay in class MessageImpl
Returns:
true if the message will not generate a response message

hasBeenForwarded

public boolean hasBeenForwarded()
Description copied from interface: Request
Returns true if the request has been forwarded

Specified by:
hasBeenForwarded in interface Request
Returns:
true if the request has been forwarded

getSender

public UniversalBody getSender()
Description copied from interface: Request
Returns the sender of this request

Specified by:
getSender in interface Request
Returns:
the sender of this request

getParameter

public java.lang.Object getParameter(int index)
Description copied from interface: Request
Returns the parameter number index from the method call embedded in the request

Specified by:
getParameter in interface Request
Parameters:
index - the position of the parameter to return.
Returns:
the object passed in parameter of the method call that matches the given position or null if no match.

getMethodCall

public MethodCall getMethodCall()
Description copied from interface: Request
Returns the MethodCall embedded in the request

Specified by:
getMethodCall in interface Request
Returns:
the MethodCall embedded in the request

notifyReception

public void notifyReception(UniversalBody bodyReceiver)
                     throws java.io.IOException
Description copied from interface: Request
Notifies the request that it has been received by the destination. When this request gets fowarded, this method must not be called as a fowarder is not the genuine destination of the request.

Specified by:
notifyReception in interface Request
Parameters:
bodyReceiver - the body destination that received the request
Throws:
java.io.IOException - if the request failed to perform a possible operation upon that notification

serveInternal

protected void serveInternal(Body targetBody)
                      throws ServeException
ServeException


Copyright © April 2004 INRIA All Rights Reserved.