org.objectweb.dream.multiplexer
Class PullPushMultiplexerImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.multiplexer.PullPushMultiplexerImpl
All Implemented Interfaces:
BindingController, LifeCycleController, Loggable, PullPushMultiplexer

public class PullPushMultiplexerImpl
extends AbstractComponent
implements PullPushMultiplexer

Implementation of the PullPushMultiplexer interface. This multiplexers periodically pulls its inputs according to the parameters given to the attach method.


Field Summary
protected  int attachmentId
          An integer used to generate attachment ids.
protected  ArrayList attachments
          The registered attachments.
protected  Map inputs
          An hashtable storing the intputs of this component.
protected  MessageManager messageManagerItf
          The message manager client interface of this component
protected  Map outputs
          An hashtable storing the outputs of this component.
protected  SetTimeStamp setTimeStamp
          The SetTimeStamp client interface of this component.
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, firstStart, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.multiplexer.PullPushMultiplexer
ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
PullPushMultiplexerImpl()
          Constructor.
 
Method Summary
 Attachment attach(String[] inputNames, Map[] inputContexts, String[] outputNames, Map[] outputContexts, Map parameters)
          Attaches a set of inputs to a set of outputs.
protected  void beforeFirstStart(Component componentItf)
           
 void bindFc(String clientItfName, Object serverItf)
           
 void detach(Attachment attachment)
          Detaches a set of inputs from a set of outputs.
 ArrayList getAttachments()
          Returns the attachments that have been registered.
 String[] listFc()
           
 void unbindFc(String clientItfName)
           
 void update(Attachment attachment)
          Updates an attachement.
 
Methods inherited from class org.objectweb.dream.AbstractComponent
getFcState, initComponent, lookupFc, setLogger, startFc, stopFc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attachments

protected ArrayList attachments
The registered attachments.


inputs

protected Map inputs
An hashtable storing the intputs of this component.


outputs

protected Map outputs
An hashtable storing the outputs of this component.


messageManagerItf

protected MessageManager messageManagerItf
The message manager client interface of this component


setTimeStamp

protected SetTimeStamp setTimeStamp
The SetTimeStamp client interface of this component.


attachmentId

protected int attachmentId
An integer used to generate attachment ids.

Constructor Detail

PullPushMultiplexerImpl

public PullPushMultiplexerImpl()
Constructor.

Method Detail

attach

public Attachment attach(String[] inputNames,
                         Map[] inputContexts,
                         String[] outputNames,
                         Map[] outputContexts,
                         Map parameters)
                  throws NoSuchInterfaceException
Attaches a set of inputs to a set of outputs.

Specified by:
attach in interface PullPushMultiplexer
Parameters:
inputNames - the names of the inputs to be attached. These inputs must have been previously bound (with the same name) using the BindingController interface.
inputContexts - the contexts to be passed when pulling the inputs.
outputNames - the names of the outputs to wich intputs must be attached. These outputs must have been previously bound (with the same name) using the BindingController interface.
outputContexts - the contexts to be passed when pushing the outputs.
parameters - the attachement parameters. The parameters Map can have the following String as keys:
  • startingDate : mapped to a Long that specifies in how many ms should the attachement be started. (0 means now).
  • endDate : mapped to a Long that specifies in how many ms should the attachement be started. (0 means now).
  • pullingFrequency : mapped to a Long that specifies the time to sleep between two pulling of the attached inputs.
  • endDate : mapped to a Long that specifies in how many ms should the attachement be stop. (must be > startingDate)
Returns:
an Attachment object
Throws:
NoSuchInterfaceException - if inputNames or outputNames contains the name of an interface to which the component has not been bound.
See Also:
PeriodicAttachment, PullPushMultiplexer.attach(String[], Map[], String[], Map[], Map)

detach

public void detach(Attachment attachment)
Description copied from interface: PullPushMultiplexer
Detaches a set of inputs from a set of outputs.

Specified by:
detach in interface PullPushMultiplexer
Parameters:
attachment - an attachment returned by attach
See Also:
PullPushMultiplexer.detach(Attachment)

update

public void update(Attachment attachment)
Description copied from interface: PullPushMultiplexer
Updates an attachement. New parameters are given in an Attachment.

Specified by:
update in interface PullPushMultiplexer
Parameters:
attachment - an attachment returned by attach.
See Also:
PullPushMultiplexer.update(Attachment)

getAttachments

public ArrayList getAttachments()
Description copied from interface: PullPushMultiplexer
Returns the attachments that have been registered.

Specified by:
getAttachments in interface PullPushMultiplexer
Returns:
the attachments that have been registered.
See Also:
PullPushMultiplexer.getAttachments()

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(String, Object)

unbindFc

public void unbindFc(String clientItfName)
              throws NoSuchInterfaceException,
                     IllegalBindingException,
                     IllegalLifeCycleException
Specified by:
unbindFc in interface BindingController
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.unbindFc(String)

listFc

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

beforeFirstStart

protected void beforeFirstStart(Component componentItf)
                         throws IllegalLifeCycleException
Throws:
IllegalLifeCycleException
See Also:
AbstractComponent.beforeFirstStart(org.objectweb.fractal.api.Component)


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