org.objectweb.proactive.core.component.request
Class ComponentRequestImpl

java.lang.Object
  extended byorg.objectweb.proactive.core.body.message.MessageImpl
      extended byorg.objectweb.proactive.core.body.request.RequestImpl
          extended byorg.objectweb.proactive.core.component.request.ComponentRequestImpl
All Implemented Interfaces:
ComponentRequest, Message, Request, Securizable, java.io.Serializable

public class ComponentRequestImpl
extends RequestImpl
implements ComponentRequest, java.io.Serializable

Method calls to components are actually reified calls, and ComponentRequest contains a reification of the call.

This class handles the tagging of the call (a component call), and the redispatching to the targeted component metaobject, interface reference, base object. It also allows pre and post processing of functional invocations with inputInterceptors.

Author:
Matthieu Morel
See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Fields inherited from class org.objectweb.proactive.core.body.request.RequestImpl
ciphered, codebase, loggerNFE, methodCall, sendCounter, sender, sessionID
 
Fields inherited from class org.objectweb.proactive.core.body.message.MessageImpl
ftm, ignoreIt, isOneWay, messageInfos, methodName, sequenceNumber, sourceID, timeStamp
 
Fields inherited from interface org.objectweb.proactive.core.component.request.ComponentRequest
BEFORE_FUNCTIONAL_PRIORITY, IMMEDIATE_PRIORITY, STRICT_FIFO_PRIORITY
 
Constructor Summary
ComponentRequestImpl(MethodCall methodCall, UniversalBody sender, boolean isOneWay, long nextSequenceID)
           
ComponentRequestImpl(Request request)
           
 
Method Summary
 short getPriority()
           
 Shortcut getShortcut()
           
 int getShortcutLength()
           
 java.lang.Class getTargetClass()
           
 boolean isControllerRequest()
          tells whether the request is a call to a control interface
 boolean isStartFcRequest()
           
 boolean isStopFcRequest()
           
 void notifyReception(UniversalBody bodyReceiver)
          Notifies the request that it has been received by the destination.
protected  FutureResult serveInternal(Body targetBody)
          redirects the call to the adequate component metaobject : either to a controller, through the chain of controllers, to a functional interface in the case of a composite (no preprocessing in that case), or directly executes the invocation on the base object if this component is a primitive component and the invocation is a functional invocation.
 void shortcutNotification(UniversalBody sender, UniversalBody intermediate)
          Indicates a possible shortcut, because a functional request has been transferred between the sender and the intermediate component.
 
Methods inherited from class org.objectweb.proactive.core.body.request.RequestImpl
createReply, crypt, decrypt, getMethodCall, getParameter, getSender, getSessionId, hasBeenForwarded, isCiphered, resetSendCounter, send, sendRequest, serve, serveAlternate
 
Methods inherited from class org.objectweb.proactive.core.body.message.MessageImpl
getFTManager, getMessageInfo, getMethodName, getSequenceNumber, getSourceBodyID, getTimeStamp, ignoreIt, isOneWay, setFTManager, setIgnoreIt, setMessageInfo, 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.request.Request
getMethodCall, getParameter, getSender, hasBeenForwarded, resetSendCounter, send, serve, serveAlternate
 
Methods inherited from interface org.objectweb.proactive.core.body.message.Message
getFTManager, getMessageInfo, getMethodName, getSequenceNumber, getSourceBodyID, getTimeStamp, ignoreIt, isOneWay, setFTManager, setIgnoreIt, setMessageInfo
 
Methods inherited from interface org.objectweb.proactive.ext.security.Securizable
crypt, decrypt, getSessionId, isCiphered
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

ComponentRequestImpl

public ComponentRequestImpl(MethodCall methodCall,
                            UniversalBody sender,
                            boolean isOneWay,
                            long nextSequenceID)

ComponentRequestImpl

public ComponentRequestImpl(Request request)
Method Detail

serveInternal

protected FutureResult serveInternal(Body targetBody)
                              throws ServeException
redirects the call to the adequate component metaobject : either to a controller, through the chain of controllers, to a functional interface in the case of a composite (no preprocessing in that case), or directly executes the invocation on the base object if this component is a primitive component and the invocation is a functional invocation.

Overrides:
serveInternal in class RequestImpl
Throws:
ServeException

isControllerRequest

public boolean isControllerRequest()
Description copied from interface: ComponentRequest
tells whether the request is a call to a control interface

Specified by:
isControllerRequest in interface ComponentRequest

isStopFcRequest

public boolean isStopFcRequest()
Specified by:
isStopFcRequest in interface ComponentRequest

isStartFcRequest

public boolean isStartFcRequest()
Specified by:
isStartFcRequest in interface ComponentRequest

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
Overrides:
notifyReception in class RequestImpl
Throws:
java.io.IOException

shortcutNotification

public void shortcutNotification(UniversalBody sender,
                                 UniversalBody intermediate)
Description copied from interface: ComponentRequest
Indicates a possible shortcut, because a functional request has been transferred between the sender and the intermediate component.

Specified by:
shortcutNotification in interface ComponentRequest
Parameters:
sender - the sender of the functional component request
intermediate - the component that the functional request has reached so far

getShortcut

public Shortcut getShortcut()
Specified by:
getShortcut in interface ComponentRequest
Returns:
the shortcut object contained in this request, null if there is no shortcut

getShortcutLength

public int getShortcutLength()
Specified by:
getShortcutLength in interface ComponentRequest
Returns:
the number of membranes that could be shortcut, 0 if there is no shortcut

getPriority

public short getPriority()
Specified by:
getPriority in interface ComponentRequest

getTargetClass

public java.lang.Class getTargetClass()
Specified by:
getTargetClass in interface ComponentRequest
Returns:
the class on which the method call contained in this request must be executed


Copyright 2001-2005 INRIA All Rights Reserved.