INRIA & FluxMedia

fr.fluxmedia.transmorpher.engine
Class TLoop

java.lang.Object
  |
  +--fr.fluxmedia.transmorpher.engine.TProcess_Impl
        |
        +--fr.fluxmedia.transmorpher.engine.TProcessComposite
              |
              +--fr.fluxmedia.transmorpher.engine.TLoop
All Implemented Interfaces:
TProcess

public final class TLoop
extends TProcessComposite

This class represents a repeat process. A Loop can accept several iterator of different types.

Since:
jdk 1.3 && SAX 2.0
Author:
Laurent.Tardif@inrialpes.fr, Fabien.Triolet@inrialpes.fr

Field Summary
(package private)  XML_Port[] iListBuf
          Buf ports of this process
(package private)  java.lang.String[] iListLocalBuf
          Buf ports of this process
(package private)  java.lang.String[] iListLocalIn
          In ports of this process
(package private)  java.lang.String[] iListLocalOut
          Out ports of this process
(package private)  boolean isFirstLoop
          true if it's first loop
(package private)  java.util.Vector iterators
          List of iterator
(package private)  java.util.Vector listOfProcess
          List of inner processes
protected  java.util.Hashtable listOfProcessBuf
          the list of PortProcess buf
(package private)  java.util.Vector listOfSerializer
          List of inner serializer
(package private)  int loopCounter
          counter of loop.
(package private)  LoopManagerHandler[] managers
          Controller Handler
(package private)  java.lang.String[] nameBuf
          Buf name
(package private)  int numberOfManagers
          number of call to manage method
(package private)  boolean stop
          flag for iterators, if one of them is finished then its value is true
 
Fields inherited from class fr.fluxmedia.transmorpher.engine.TProcessComposite
listOfApplyProcess, listOfChannel, listOfGenerator, listOfProcessBasic, listOfProcessIn, listOfProcessOut, NB_PROCESS_RISE
 
Fields inherited from class fr.fluxmedia.transmorpher.engine.TProcess_Impl
debug, id, iListIn, iListOfParameters, iListOut, iName, iNbIn, iNbOut, nameFather, nameIn, nameOut
 
Constructor Summary
TLoop(java.lang.String[] pIn, java.lang.String[] pOut, java.lang.String[] pBuf, Parameters pParam, StringParameters staticAttributes)
          The constructor
 
Method Summary
 void addIterator(TIterator iterator)
          Adds an Iterator to the Loop.
 void addProcess(TProcess process)
          Adds a process to the list of process of the TLoop object
 void addSerializer(TProcess process)
          Adds a process (TSerializer) to the list of serializer of the TLoop object
 void bindPorts(TProcess process)
          links ports and creates feedbacks.
 void generatePort()
          Generates all the process ports.In this case, nothing to do , ports have been generated before.
 void innerGeneratePort(java.lang.String[] locIn, java.lang.String[] locOut, java.lang.String[] locBuf)
          To setup the Loop manager, the ports of this Loop have to be created before inner process ports.
private  boolean isReady()
          Gets the ready attribute of the TLoop object
 void manage()
          Manages the loop.
 void reset()
          Initializes all inner processes for a new loop.
 void setContentHandler(org.xml.sax.ContentHandler c, int i)
          Sets one of the output handler of this loop with the content handler of the following process.
 
Methods inherited from class fr.fluxmedia.transmorpher.engine.TProcessComposite
addApplyProcess, addChannel, addGenerator, bindParameters, bindPorts, execProcess, getAllProcess, getApplyProcess, getChannel, getGenerator, getListOfProcessIn, getListOfProcessOut, getProcessBasic, showChannel
 
Methods inherited from class fr.fluxmedia.transmorpher.engine.TProcess_Impl
getFatherName, getId, getIn, getIn, getIn, getName, getNameIn, getNameIn, getNameOut, getNameOut, getOut, getOut, getOut, getParameter, getParameterNames, getParameters, setDebug, setFatherName, setId, setIn, setName, setOut, setParameter, setParameters
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

managers

LoopManagerHandler[] managers
Controller Handler

iListLocalIn

java.lang.String[] iListLocalIn
In ports of this process

iListLocalOut

java.lang.String[] iListLocalOut
Out ports of this process

iListLocalBuf

java.lang.String[] iListLocalBuf
Buf ports of this process

listOfProcess

java.util.Vector listOfProcess
List of inner processes

nameBuf

java.lang.String[] nameBuf
Buf name

iListBuf

XML_Port[] iListBuf
Buf ports of this process

isFirstLoop

boolean isFirstLoop
true if it's first loop

stop

boolean stop
flag for iterators, if one of them is finished then its value is true

numberOfManagers

int numberOfManagers
number of call to manage method

loopCounter

int loopCounter
counter of loop.

iterators

java.util.Vector iterators
List of iterator

listOfSerializer

java.util.Vector listOfSerializer
List of inner serializer

listOfProcessBuf

protected java.util.Hashtable listOfProcessBuf
the list of PortProcess buf
Constructor Detail

TLoop

public TLoop(java.lang.String[] pIn,
             java.lang.String[] pOut,
             java.lang.String[] pBuf,
             Parameters pParam,
             StringParameters staticAttributes)
      throws javax.xml.transform.TransformerException,
             javax.xml.transform.TransformerConfigurationException,
             org.xml.sax.SAXException,
             java.io.IOException
The constructor
Parameters:
pIn - in port names
pOut - out port names
pBuf - buffer port names
pParam - Description of the Parameter
staticAttributes - Description of the Parameter
Throws:
javax.xml.transform.TransformerException - Description of the Exception
javax.xml.transform.TransformerConfigurationException - Description of the Exception
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
java.io.IOException - Description of the Exception
Method Detail

bindPorts

public void bindPorts(TProcess process)
               throws TMRuntimeException,
                      TMException,
                      org.xml.sax.SAXException
links ports and creates feedbacks.
Overrides:
bindPorts in class TProcessComposite
Parameters:
process - The current process to link to the others
Throws:
TMRuntimeException - Description of the Exception
TMException - Description of the Exception
org.xml.sax.SAXException - Description of the Exception

innerGeneratePort

public void innerGeneratePort(java.lang.String[] locIn,
                              java.lang.String[] locOut,
                              java.lang.String[] locBuf)
To setup the Loop manager, the ports of this Loop have to be created before inner process ports. In the case of TLoop local names and global names are the same.
Parameters:
locIn - local name of in ports
locOut - local name of out ports
locBuf - local name of buf ports

generatePort

public void generatePort()
Generates all the process ports.In this case, nothing to do , ports have been generated before.
Overrides:
generatePort in class TProcessComposite

reset

public void reset()
           throws TMRuntimeException,
                  TMException,
                  org.xml.sax.SAXException
Initializes all inner processes for a new loop. Due to a xalan bug, TransformerHandlerImpl can be use only once. So we have to create a new one at each loop.
Overrides:
reset in class TProcess_Impl
Throws:
TMRuntimeException - Description of the Exception
TMException - Description of the Exception
org.xml.sax.SAXException - Description of the Exception

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler c,
                              int i)
Sets one of the output handler of this loop with the content handler of the following process.
Parameters:
c - the next content handler.
i - manager position.

addIterator

public void addIterator(TIterator iterator)
Adds an Iterator to the Loop. If the iterator to add is an instance of fixpointIterator, TestHandler are used in each managers of this loop instead of LoopHandler.
Parameters:
iterator - The iterator to be added to this Loop

addProcess

public void addProcess(TProcess process)
Adds a process to the list of process of the TLoop object
Overrides:
addProcess in class TProcessComposite
Parameters:
process - The process to be added to the list of process

addSerializer

public void addSerializer(TProcess process)
Adds a process (TSerializer) to the list of serializer of the TLoop object
Parameters:
process - The process to be added to the list of serializer

isReady

private boolean isReady()
Gets the ready attribute of the TLoop object
Returns:
The ready value

manage

public void manage()
Manages the loop. When all the iterators have called this methods and if they all have a next element , a new loop is started . If one of them is finished, loop is ended .

INRIA & FluxMedia

..no bottom yet...