org.objectweb.proactive.core.body.request
Interface Request

All Superinterfaces:
Message
All Known Subinterfaces:
ComponentRequest
All Known Implementing Classes:
BodyRequest, ComponentRequestImpl, RequestImpl

public interface Request
extends Message

A class implementing this interface is an object encapsulating a reified method call. Any method call on an active object ends up as a Request sent to its associated body. The request must implements this Request interface.

In addition to the standard messaging facilities (sender, receiver) it adds the concepts of method call and forwarding, which is, the ability for a request to pass on from one body to another in case of migration.

Since:
ProActive 0.9
Version:
1.0, 2001/10/23
Author:
ProActive Team

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()
           
 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.
 
Methods inherited from interface org.objectweb.proactive.core.body.message.Message
getMethodName, getSequenceNumber, getSourceBodyID, getTimeStamp, isOneWay
 

Method Detail

hasBeenForwarded

public boolean hasBeenForwarded()
Returns true if the request has been forwarded

Returns:
true if the request has been forwarded

getParameter

public java.lang.Object getParameter(int index)
Returns the parameter number index from the method call embedded in the 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()
Returns the MethodCall embedded in the request

Returns:
the MethodCall embedded in the request

getSender

public UniversalBody getSender()
Returns the sender of this request

Returns:
the sender of this request

send

public void send(UniversalBody destinationBody)
          throws java.io.IOException,
                 RenegotiateSessionException
Sends this request to the body destination

Parameters:
destinationBody - the body destination of this request
Throws:
java.io.IOException - if the request fails to be sent
RenegotiateSessionException

serve

public Reply serve(Body targetBody)
            throws ServeException
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).

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

notifyReception

public void notifyReception(UniversalBody bodyReceiver)
                     throws java.io.IOException
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.

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

isCiphered

public boolean isCiphered()

getSessionId

public long getSessionId()

decrypt

public boolean decrypt(ProActiveSecurityManager psm)
                throws RenegotiateSessionException
RenegotiateSessionException


Copyright © April 2004 INRIA All Rights Reserved.