org.objectweb.kilim.model
Class RtCollectionPort

java.lang.Object
  extended byorg.objectweb.kilim.model.RtComponentElement
      extended byorg.objectweb.kilim.model.RtComponentSource
          extended byorg.objectweb.kilim.model.RtComponentInterface
              extended byorg.objectweb.kilim.model.RtCollectionPort
All Implemented Interfaces:
ComponentElement, ComponentInterface, ComponentSource, RuntimeElement, RuntimeSource

public class RtCollectionPort
extends RtComponentInterface

Author:
horn RtCollectionPort is the class for collection ports.

Field Summary
private static java.lang.Integer BIND_TRUE
           
private static java.lang.Integer FALSE
           
private  java.util.LinkedHashMap providers
           
private static java.lang.Integer UNBIND_TRUE
           
 
Fields inherited from class org.objectweb.kilim.model.RtComponentInterface
fW, pW
 
Fields inherited from class org.objectweb.kilim.model.RtComponentSource
knownValues, mapper, mappingContext, svpStack
 
Fields inherited from class org.objectweb.kilim.model.RtComponentElement
nbComponent, nbElement
 
Constructor Summary
RtCollectionPort(Port aPort, ContainerElement aContainer)
          The public constructor of rtCollectionPort.
 
Method Summary
 void bindProvider(RuntimeSource aProvider, boolean jReplace)
          binds a new value source to a collection port.
 void bindValue(java.lang.Object aValue)
          assigns a value to an interface.
 boolean checkValue(java.util.Stack exclude)
          returns whether a value can be obtained without having to create new objects
 java.util.Iterator getBoundProviders()
          returns as an iterator the bound value sources.
 java.lang.String getLocalName()
          returns the local name of the component element.
 java.lang.Object getValue()
          Method getValue.
 boolean hasValue()
          returns whether the source has a value.
 boolean isCollectionPort()
          returns true if the interface is a collection port.
 boolean isProperty()
          returns true if the interface is a property.
 boolean isProvider()
          returns true if the interface is a provider (i.e.
 boolean isSingleValuePort()
          Method isSingleValueInterface returns true if the interface is a single value port.
 void setTriggersDone(RuntimeSource aProvider, int aEKind, boolean isU)
          Triggers associated to collection ports must be performed for each bound source when the getValue() or unbound method is invoked on the source.
protected  void specificBindValue(java.lang.Object aValue)
          Method specificBindValue.
protected  java.lang.Object specificGetValue()
          Method specificGetValue.
protected  void specificUnbindValue()
          Method specificUnbindValue.
 boolean triggersDone(RuntimeSource aProvider, int aEKind)
          returns whether the triggers associated to a collection port have been executed for a given source.
 void unbindProvider(RuntimeSource aProvider)
          unbinds an interface from a runtime source.
 void unbindValue()
          sets the value of an interface to null.
 void update()
          reexecutes all triggers associated to the interface.
 
Methods inherited from class org.objectweb.kilim.model.RtComponentInterface
addTrigger, fireTriggers, getEventSourceValue, getTriggerList, getTriggers, initializeInstanciation, isEventSource, isModified, removeTrigger, setEventSourceValue, setTriggersDone, triggersDone
 
Methods inherited from class org.objectweb.kilim.model.RtComponentSource
addInterfaceListener, evaluationPerformed, getCurrentSVP, getInterfaceListeners, removeInterfaceListener
 
Methods inherited from class org.objectweb.kilim.model.RtComponentElement
containsElement, getContainingComponent, getContainingElement, getElement, getElementDescription, getNbComponent, getNbElement, getQualifiedName, getTarget, getTemplateDefHierarchy, removeElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.kilim.model.ComponentElement
getContainingComponent, getContainingElement, getElementDescription, getQualifiedName, getTemplateDefHierarchy
 
Methods inherited from interface org.objectweb.kilim.model.RuntimeSource
addInterfaceListener, getTarget, removeInterfaceListener
 

Field Detail

FALSE

private static final java.lang.Integer FALSE

BIND_TRUE

private static final java.lang.Integer BIND_TRUE

UNBIND_TRUE

private static final java.lang.Integer UNBIND_TRUE

providers

private java.util.LinkedHashMap providers
Constructor Detail

RtCollectionPort

public RtCollectionPort(Port aPort,
                        ContainerElement aContainer)
The public constructor of rtCollectionPort.

Parameters:
aPort - : the corresponding template element.
aContainer - : the container in which the port is declared and defined (is either a RtComponentSlot or a rtComponent.
Method Detail

isSingleValuePort

public boolean isSingleValuePort()
Description copied from interface: ComponentInterface
Method isSingleValueInterface returns true if the interface is a single value port. It returns flase otherwise.

Returns:
boolean
See Also:
org.objectweb.kilim.model.ComponentInterface#isSingleValueInterface()

isCollectionPort

public boolean isCollectionPort()
Description copied from interface: ComponentInterface
returns true if the interface is a collection port. It returns false otherwise.

Returns:
boolean
See Also:
org.objectweb.kilim.model.ComponentInterface#isCollectionInterface()

isProvider

public boolean isProvider()
Description copied from interface: ComponentInterface
returns true if the interface is a provider (i.e. an unbuffered value source).

Returns:
boolean
See Also:
ComponentInterface.isProvider()

isProperty

public boolean isProperty()
Description copied from interface: ComponentInterface
returns true if the interface is a property. It returns false otherwise.

Returns:
boolean
See Also:
ComponentInterface.isProperty()

hasValue

public boolean hasValue()
Description copied from interface: RuntimeSource
returns whether the source has a value. The behaviour depends on the nature of the source. It always returns false when invoked on tagged providers, for example.

Returns:
boolean
See Also:
ComponentSource.hasValue()

checkValue

public boolean checkValue(java.util.Stack exclude)
                   throws KilimException
Description copied from interface: RuntimeSource
returns whether a value can be obtained without having to create new objects

Parameters:
exclude - : the exclude stack contains objects beiing in the process of being built.
Returns:
boolean
Throws:
KilimException - :
See Also:
RuntimeSource.checkValue(Stack)

getLocalName

public java.lang.String getLocalName()
Description copied from interface: ComponentElement
returns the local name of the component element.

Returns:
String
See Also:
ComponentElement.getLocalName()

setTriggersDone

public void setTriggersDone(RuntimeSource aProvider,
                            int aEKind,
                            boolean isU)
                     throws KilimException
Triggers associated to collection ports must be performed for each bound source when the getValue() or unbound method is invoked on the source. This method stores a flag indicating that triggers have been executed on a given source.

Parameters:
aProvider - : the value source.
aEKind - : the kind of event. The 2 possible values are Trigger.BIND (when getValue is effectively performed) or Trigger.UNBIND (when unbound is executed).
isU - : is true for update.
Throws:
KilimException - : generated if aProvider is null, if no sources are bound to the port, if the source is unknown.

triggersDone

public boolean triggersDone(RuntimeSource aProvider,
                            int aEKind)
                     throws KilimException
returns whether the triggers associated to a collection port have been executed for a given source.

Parameters:
aProvider - : the value source.
aEKind - : the kind of event. The 2 possible values are Trigger.BIND (when getValue is effectively performed) or Trigger.UNBIND (when unbound is executed).
Returns:
boolean
Throws:
KilimException - : generated if aProvider is null, if the collection port is empty or if the port is not bound to the source.

bindProvider

public void bindProvider(RuntimeSource aProvider,
                         boolean jReplace)
                  throws KilimException
binds a new value source to a collection port.

Specified by:
bindProvider in interface ComponentInterface
Specified by:
bindProvider in class RtComponentInterface
Parameters:
aProvider - : the value source.
jReplace - : allows to rebind an already bound source, when true (this parameter is totally stupid !!!! FHO)
Throws:
KilimException - : generated when aProvider is null or when aProvider is already bound and jReplace is false.

unbindProvider

public void unbindProvider(RuntimeSource aProvider)
                    throws KilimException
Description copied from class: RtComponentInterface
unbinds an interface from a runtime source.

Specified by:
unbindProvider in interface ComponentInterface
Specified by:
unbindProvider in class RtComponentInterface
Parameters:
aProvider - : the source value to be unbound.
Throws:
KilimException - : generated if aProvider is null or if the interface is not bound to aProvider.
See Also:
ComponentInterface.unbindProvider(RuntimeSource)

getBoundProviders

public java.util.Iterator getBoundProviders()
returns as an iterator the bound value sources.

Returns:
Iterator

bindValue

public void bindValue(java.lang.Object aValue)
               throws KilimException
Description copied from interface: ComponentInterface
assigns a value to an interface. If a value has already been associated to the interface, "unbind" triggers are executed prior to the new value assignment. Bind triggers are then executed.

Specified by:
bindValue in interface ComponentInterface
Overrides:
bindValue in class RtComponentInterface
Throws:
KilimException
See Also:
org.objectweb.kilim.model.ComponentInterface#bindValue(Object, RuntimeContext)

unbindValue

public void unbindValue()
                 throws KilimException
Description copied from interface: ComponentInterface
sets the value of an interface to null. Unbind triggers are executed (using the value stored in the interface prior to the unbind operation).

Specified by:
unbindValue in interface ComponentInterface
Overrides:
unbindValue in class RtComponentInterface
Throws:
KilimException
See Also:
org.objectweb.kilim.model.RuntimeSource#unbindValue(RuntimeContext)

getValue

public java.lang.Object getValue()
                          throws KilimException
Description copied from interface: RuntimeSource
Method getValue.

Specified by:
getValue in interface ComponentSource
Overrides:
getValue in class RtComponentInterface
Throws:
KilimException
See Also:
org.objectweb.kilim.model.RuntimeSource#getValue(RuntimeContext)

specificGetValue

protected java.lang.Object specificGetValue()
                                     throws KilimException
Description copied from class: RtComponentInterface
Method specificGetValue.

Specified by:
specificGetValue in class RtComponentInterface
Returns:
Object
Throws:
KilimException - :
See Also:
org.objectweb.kilim.model.RuntimeSource#getValue(RuntimeContext)

specificBindValue

protected void specificBindValue(java.lang.Object aValue)
                          throws KilimException
Description copied from class: RtComponentInterface
Method specificBindValue.

Specified by:
specificBindValue in class RtComponentInterface
Parameters:
aValue - :
Throws:
KilimException - :
See Also:
RtComponentInterface.specificBindValue(Object)

specificUnbindValue

protected void specificUnbindValue()
                            throws KilimException
Description copied from class: RtComponentInterface
Method specificUnbindValue.

Specified by:
specificUnbindValue in class RtComponentInterface
Throws:
KilimException - :
See Also:
RtComponentInterface.specificUnbindValue()

update

public void update()
            throws KilimException
Description copied from interface: ComponentInterface
reexecutes all triggers associated to the interface.

Specified by:
update in interface ComponentInterface
Overrides:
update in class RtComponentInterface
Throws:
KilimException
See Also:
org.objectweb.kilim.model.RtComponentInterface#specificUpdate()