org.objectweb.dream.pushwithreturn
Class SynchronizerImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.pushwithreturn.SynchronizerImpl
All Implemented Interfaces:
AttributeController, BindingController, LifeCycleController, Loggable, Push, Push1, PushWithReturn, SynchronizerAttributeController

public class SynchronizerImpl
extends AbstractComponent
implements PushWithReturn, Push1, SynchronizerAttributeController

This component handles calls to the PushWithReturn.pushWithReturn(Message, Map)method (i.e. outgoing messages). It has one PushWithReturninput, one Pushoutput, and one Push1input.

It receives calls to the pushWithReturn method. It generates a key for the message, then it pushes the message on its output, and waits for a message with the same key to arrive on its Push1 input. This message is the returned message of the pushWithReturn method.

Note: if a message with an "All" key is received on the input, it is used as a return message of all the pushWithReturn method calls currently waiting for a return message.


Nested Class Summary
static class SynchronizerImpl.WaitingKey
          This class represents a waiting key.
 
Field Summary
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, firstStart, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.PushWithReturn
IN_PUSH_WITH_RETURN_ITF_NAME, OUT_PUSH_WITH_RETURN_ITF_NAME
 
Fields inherited from interface org.objectweb.dream.Push
IN_PUSH_ITF_NAME, OUT_PUSH_ITF_NAME
 
Fields inherited from interface org.objectweb.dream.Push1
IN_PUSH_ITF_NAME, OUT_PUSH_ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
SynchronizerImpl()
           
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
           
 boolean getMustClone()
          Returns a boolean indicating whether it is necessary to clone a return message that is destinated to several method call returns.
 String[] listFc()
           
 void push(Message message, Map context)
           
 void push1(Message message, Map context)
           
 Message pushWithReturn(Message message, Map context)
           
 void setMustClone(boolean mustClone)
          Specifies whether it is necessary to clone a return message that is destinated to several method call returns.
 
Methods inherited from class org.objectweb.dream.AbstractComponent
beforeFirstStart, getFcState, initComponent, lookupFc, setLogger, startFc, stopFc, unbindFc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronizerImpl

public SynchronizerImpl()
Method Detail

pushWithReturn

public Message pushWithReturn(Message message,
                              Map context)
                       throws PushException
Specified by:
pushWithReturn in interface PushWithReturn
Throws:
PushException
See Also:
PushWithReturn.pushWithReturn(org.objectweb.dream.message.Message, java.util.Map)

push

public void push(Message message,
                 Map context)
          throws PushException
Specified by:
push in interface Push
Throws:
PushException
See Also:
Push.push(Message, Map)

push1

public void push1(Message message,
                  Map context)
           throws PushException
Specified by:
push1 in interface Push1
Throws:
PushException
See Also:
Push1.push1(org.objectweb.dream.message.Message, java.util.Map)

setMustClone

public void setMustClone(boolean mustClone)
Description copied from interface: SynchronizerAttributeController
Specifies whether it is necessary to clone a return message that is destinated to several method call returns.

Specified by:
setMustClone in interface SynchronizerAttributeController
Parameters:
mustClone - a boolean that indicates whether it is necessary to clone a return message that is destinated to several method call returns.
See Also:
SynchronizerAttributeController.setMustClone(boolean)

getMustClone

public boolean getMustClone()
Description copied from interface: SynchronizerAttributeController
Returns a boolean indicating whether it is necessary to clone a return message that is destinated to several method call returns.

Specified by:
getMustClone in interface SynchronizerAttributeController
Returns:
true if it is necessary to clone a return message that is destinated to several method call returns.
See Also:
SynchronizerAttributeController.getMustClone()

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
            throws NoSuchInterfaceException,
                   IllegalBindingException,
                   IllegalLifeCycleException
Specified by:
bindFc in interface BindingController
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.bindFc(java.lang.String, java.lang.Object)

listFc

public String[] listFc()
Specified by:
listFc in interface BindingController
See Also:
BindingController.listFc()


Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.