org.objectweb.fractal.cecilia.adl.types
Class PrimitiveTypeDefinitionFilter

java.lang.Object
  extended by org.objectweb.fractal.cecilia.adl.types.PrimitiveTypeDefinitionFilter
All Implemented Interfaces:
ComponentVisitor, Visitor<org.objectweb.fractal.adl.components.ComponentContainer>, org.objectweb.fractal.api.control.BindingController

public class PrimitiveTypeDefinitionFilter
extends java.lang.Object
implements ComponentVisitor, org.objectweb.fractal.api.control.BindingController

This visitor determines the type of a given primitive component and if this type is already defined. If the type is not yet defined, this visitor calls its definitionVisitorItf client interface, otherwise it returns null.

See Also:
ComponentTypeDesc

Field Summary
protected  org.objectweb.fractal.adl.ContextLocal<java.util.Map<ComponentTypeDesc,ComponentTypeDesc>> componentTypes
          A context local map associating ComponentTypeDesc to themselves.
static java.lang.String DEFINITION_VISITOR_ITF_NAME
          The name of the definitionVisitorItf client interface.
 ComponentVisitor definitionVisitorItf
          The ComponentVisitor client interface use to create the task that defines the component type.
 
Constructor Summary
PrimitiveTypeDefinitionFilter()
           
 
Method Summary
 void bindFc(java.lang.String clientItfName, java.lang.Object serverItf)
           
 java.lang.String[] listFc()
           
 java.lang.Object lookupFc(java.lang.String clientItfName)
           
protected  boolean needTypeDefinition(java.util.List<org.objectweb.fractal.adl.Node> path, org.objectweb.fractal.adl.components.ComponentContainer container, java.util.Map<java.lang.Object,java.lang.Object> context)
           
 void unbindFc(java.lang.String clientItfName)
           
 org.objectweb.fractal.api.Component visit(java.util.List<org.objectweb.fractal.adl.Node> path, org.objectweb.fractal.adl.components.ComponentContainer container, java.util.Map<java.lang.Object,java.lang.Object> context)
          Visits an AST node and creates a component task that models the processing to be done on this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

componentTypes

protected final org.objectweb.fractal.adl.ContextLocal<java.util.Map<ComponentTypeDesc,ComponentTypeDesc>> componentTypes
A context local map associating ComponentTypeDesc to themselves. Note that : thanks to the implementation of the equals method of this class, if two components A and B share the same type, then ComponentTypeDesc(A) is equals to ComponentTypeDesc(B).


DEFINITION_VISITOR_ITF_NAME

public static final java.lang.String DEFINITION_VISITOR_ITF_NAME
The name of the definitionVisitorItf client interface.

See Also:
Constant Field Values

definitionVisitorItf

public ComponentVisitor definitionVisitorItf
The ComponentVisitor client interface use to create the task that defines the component type.

Constructor Detail

PrimitiveTypeDefinitionFilter

public PrimitiveTypeDefinitionFilter()
Method Detail

visit

public org.objectweb.fractal.api.Component visit(java.util.List<org.objectweb.fractal.adl.Node> path,
                                                 org.objectweb.fractal.adl.components.ComponentContainer container,
                                                 java.util.Map<java.lang.Object,java.lang.Object> context)
                                          throws org.objectweb.fractal.adl.ADLException,
                                                 TaskException
Description copied from interface: Visitor
Visits an AST node and creates a component task that models the processing to be done on this node.

Specified by:
visit in interface Visitor<org.objectweb.fractal.adl.components.ComponentContainer>
Parameters:
path - a list containing all the parent nodes of the visited node stating from the root of the AST.
container - the AST Node to be visited.
context - additional parameters.
Returns:
a task component that models the processing to be done on this node.
Throws:
ADLException - if something wrong is found in the AST.
TaskException - if something wrong happens during the instantiation of the task component.

needTypeDefinition

protected boolean needTypeDefinition(java.util.List<org.objectweb.fractal.adl.Node> path,
                                     org.objectweb.fractal.adl.components.ComponentContainer container,
                                     java.util.Map<java.lang.Object,java.lang.Object> context)
                              throws org.objectweb.fractal.adl.ADLException,
                                     TaskException
Throws:
org.objectweb.fractal.adl.ADLException
TaskException

listFc

public java.lang.String[] listFc()
Specified by:
listFc in interface org.objectweb.fractal.api.control.BindingController

bindFc

public void bindFc(java.lang.String clientItfName,
                   java.lang.Object serverItf)
            throws org.objectweb.fractal.api.NoSuchInterfaceException,
                   org.objectweb.fractal.api.control.IllegalBindingException,
                   org.objectweb.fractal.api.control.IllegalLifeCycleException
Specified by:
bindFc in interface org.objectweb.fractal.api.control.BindingController
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException
org.objectweb.fractal.api.control.IllegalBindingException
org.objectweb.fractal.api.control.IllegalLifeCycleException

lookupFc

public java.lang.Object lookupFc(java.lang.String clientItfName)
                          throws org.objectweb.fractal.api.NoSuchInterfaceException
Specified by:
lookupFc in interface org.objectweb.fractal.api.control.BindingController
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException

unbindFc

public void unbindFc(java.lang.String clientItfName)
              throws org.objectweb.fractal.api.NoSuchInterfaceException,
                     org.objectweb.fractal.api.control.IllegalBindingException,
                     org.objectweb.fractal.api.control.IllegalLifeCycleException
Specified by:
unbindFc in interface org.objectweb.fractal.api.control.BindingController
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException
org.objectweb.fractal.api.control.IllegalBindingException
org.objectweb.fractal.api.control.IllegalLifeCycleException


Copyright © 2007-2009 ObjectWeb Consortium. All Rights Reserved.