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

java.lang.Object
  |
  +--org.objectweb.proactive.core.body.message.MessageImpl
        |
        +--org.objectweb.proactive.core.body.request.RequestImpl
All Implemented Interfaces:
Message, Request, java.io.Serializable
Direct Known Subclasses:
ComponentRequestImpl, RequestWithLocationServer, RequestWithMixedLocation, TimedRequestWithLocationServer

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

See Also:
Serialized Form

Field Summary
protected  java.lang.String codebase
           
static org.apache.log4j.Logger logger
           
protected  MethodCall methodCall
           
protected  int sendCounter
          Indicates if the method has been sent through a forwarder
protected  UniversalBody sender
          transient because we deal with the serialization of this variable in a custom manner. see writeObject method
 long sessionID
           
 
Fields inherited from class org.objectweb.proactive.core.body.message.MessageImpl
ciphered, isOneWay, methodName, sequenceNumber, sourceID, timeStamp
 
Constructor Summary
RequestImpl(MethodCall methodCall, UniversalBody sender, boolean isOneWay, long nextSequenceID)
           
 
Method Summary
protected  Reply createReply(Body targetBody, java.lang.Object result)
           
 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()
           
 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
protected  void sendRequest(UniversalBody destinationBody)
           
 Reply serve(Body targetBody)
          Serves this request by executing the embedded method call using the given targetBody.
protected  java.lang.Object serveInternal(Body targetBody)
           
 
Methods inherited from class org.objectweb.proactive.core.body.message.MessageImpl
getMethodName, getSequenceNumber, getSourceBodyID, getTimeStamp, isOneWay, 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, isOneWay
 

Field Detail

logger

public static org.apache.log4j.Logger logger

methodCall

protected MethodCall methodCall

sendCounter

protected int sendCounter
Indicates if the method has been sent through a forwarder


sender

protected transient UniversalBody sender
transient because we deal with the serialization of this variable in a custom manner. see writeObject method


sessionID

public long sessionID

codebase

protected java.lang.String codebase
Constructor Detail

RequestImpl

public RequestImpl(MethodCall methodCall,
                   UniversalBody sender,
                   boolean isOneWay,
                   long nextSequenceID)
Method Detail

send

public void send(UniversalBody destinationBody)
          throws java.io.IOException,
                 RenegotiateSessionException
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
RenegotiateSessionException

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

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

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

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 java.lang.Object serveInternal(Body targetBody)
                                  throws ServeException
ServeException

createReply

protected Reply createReply(Body targetBody,
                            java.lang.Object result)

sendRequest

protected void sendRequest(UniversalBody destinationBody)
                    throws java.io.IOException,
                           RenegotiateSessionException
java.io.IOException
RenegotiateSessionException

isCiphered

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

decrypt

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

getSessionId

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


Copyright © April 2004 INRIA All Rights Reserved.