org.objectweb.kilim.model
Class RtComponentInterface

java.lang.Object
  extended byorg.objectweb.kilim.model.RtComponentElement
      extended byorg.objectweb.kilim.model.RtComponentSource
          extended byorg.objectweb.kilim.model.RtComponentInterface
All Implemented Interfaces:
ComponentElement, ComponentInterface, ComponentSource, RuntimeElement, RuntimeSource
Direct Known Subclasses:
RtCollectionPort, RtComponentProperty, RtComponentProvider, RtSingleValuePort

public abstract class RtComponentInterface
extends RtComponentSource
implements ComponentInterface, RuntimeSource

Author:
horn

Field Summary
private  java.util.List bTriggers
           
private  boolean bTriggersDone
           
(package private)  java.io.FileWriter fW
           
private  boolean isModified
           
(package private)  java.io.PrintWriter pW
           
private  java.util.List uTriggers
           
private  boolean uTriggersDone
           
 
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
protected RtComponentInterface(TemplateElementImpl aElement, ContainerElement aComponent)
          The public constructor of RtComponentInterface.
 
Method Summary
 void addTrigger(RuntimeTrigger aTrigger)
          adds a new trigger to the interface.
abstract  void bindProvider(RuntimeSource aProvider, boolean jReplace)
          binds an interface to a runtime source.
 void bindValue(java.lang.Object aValue)
          assigns a value to an interface.
protected  void fireTriggers(int eventKind, java.lang.Object resultValue)
           
 java.lang.Object getEventSourceValue()
          Method gets the EventSourceValue.
 java.util.List getTriggerList(int aEventKind)
          returns the ordered list of the triggers associated to an interface.
 java.util.Iterator getTriggers(int aEventKind)
          returns the as an iterator the triggers associated to an interface.
 java.lang.Object getValue()
          Method getValue.
protected  void initializeInstanciation()
           
 boolean isEventSource()
          returns whether the source is an event source..
 boolean isModified()
          returns whether the value has been changed since the last execution of bind triggers associated to the interface.
 void removeTrigger(RuntimeTrigger aTrigger)
          removes a trigger from an interface.
 void setEventSourceValue(java.lang.Object aValue)
          sets the EventSourceValue.
 void setTriggersDone(int aKind, boolean done)
          sets a flag indicating whether the triggers associated to a given kind of event have been performed or not.
protected abstract  void specificBindValue(java.lang.Object aValue)
          Method specificBindValue.
protected abstract  java.lang.Object specificGetValue()
          Method specificGetValue.
protected abstract  void specificUnbindValue()
          Method specificUnbindValue.
 boolean triggersDone(int aKind)
          returns whether the triggers associated to a given kind of event have been executed or not.
abstract  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.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.ComponentInterface
isCollectionPort, isProperty, isProvider, isSingleValuePort
 
Methods inherited from interface org.objectweb.kilim.model.ComponentSource
hasValue
 
Methods inherited from interface org.objectweb.kilim.model.ComponentElement
getContainingComponent, getContainingElement, getElementDescription, getLocalName, getQualifiedName, getTemplateDefHierarchy
 
Methods inherited from interface org.objectweb.kilim.model.RuntimeSource
addInterfaceListener, checkValue, getTarget, hasValue, removeInterfaceListener
 

Field Detail

bTriggers

private java.util.List bTriggers

uTriggers

private java.util.List uTriggers

bTriggersDone

private boolean bTriggersDone

uTriggersDone

private boolean uTriggersDone

isModified

private boolean isModified

pW

java.io.PrintWriter pW
See Also:
ComponentSource.getValue()

fW

java.io.FileWriter fW
Constructor Detail

RtComponentInterface

protected RtComponentInterface(TemplateElementImpl aElement,
                               ContainerElement aComponent)
The public constructor of RtComponentInterface.

Parameters:
aElement - : the template description of the interface.
aComponent - :the container element in which the interface is defined.
Method Detail

isModified

public boolean isModified()
                   throws KilimException
returns whether the value has been changed since the last execution of bind triggers associated to the interface.

Specified by:
isModified in interface ComponentInterface
Returns:
boolean
Throws:
KilimException - :

triggersDone

public boolean triggersDone(int aKind)
                     throws KilimException
returns whether the triggers associated to a given kind of event have been executed or not.

Parameters:
aKind - : the kind of event. It is either Trigger.BIND or Trigger.UNBIND.
Returns:
boolean
Throws:
KilimException - : generated if aKind has an illegal value.

setTriggersDone

public void setTriggersDone(int aKind,
                            boolean done)
                     throws KilimException
sets a flag indicating whether the triggers associated to a given kind of event have been performed or not.

Parameters:
aKind - : the kind of event. It is either Trigger.BIND or Trigger.UNBIND.
done - : true if the triggersz have been performed.
Throws:
KilimException - : generated if aKind has an illegal value.

bindProvider

public abstract void bindProvider(RuntimeSource aProvider,
                                  boolean jReplace)
                           throws KilimException
binds an interface to a runtime source.

Specified by:
bindProvider in interface ComponentInterface
Parameters:
aProvider - : the value source to be bound.
jReplace - : true if replacement is allowed.
Throws:
KilimException - : generated if aProvider is null, if the interface is already bound and jReplace is false.

unbindProvider

public abstract void unbindProvider(RuntimeSource aProvider)
                             throws KilimException
unbinds an interface from a runtime source.

Specified by:
unbindProvider in interface ComponentInterface
Parameters:
aProvider - : the source value to be unbound.
Throws:
KilimException - : generated if aProvider is null or if the interface is not bound to aProvider.

addTrigger

public void addTrigger(RuntimeTrigger aTrigger)
adds a new trigger to the interface.

Parameters:
aTrigger - : the trigger to be added.

removeTrigger

public void removeTrigger(RuntimeTrigger aTrigger)
removes a trigger from an interface.

Parameters:
aTrigger - : the trigger to be added.

getTriggerList

public java.util.List getTriggerList(int aEventKind)
returns the ordered list of the triggers associated to an interface.

Parameters:
aEventKind - : the kind of trigger event. It should be one Trigger.BIND or Trigger.UNBIND.
Returns:
LinkedList

getTriggers

public java.util.Iterator getTriggers(int aEventKind)
returns the as an iterator the triggers associated to an interface.

Parameters:
aEventKind - : the kind of trigger event. It should be one Trigger.BIND or Trigger.UNBIND.
Returns:
Iterator

isEventSource

public boolean isEventSource()
Description copied from interface: RuntimeSource
returns whether the source is an event source..

Specified by:
isEventSource in interface RuntimeSource
Returns:
boolean : is true when the source is the current event source.
See Also:
RuntimeSource.isEventSource()

setEventSourceValue

public void setEventSourceValue(java.lang.Object aValue)
                         throws KilimException
Description copied from interface: RuntimeSource
sets the EventSourceValue.

Specified by:
setEventSourceValue in interface RuntimeSource
Parameters:
aValue - :
Throws:
KilimException - : the exception is generated when the method is invoked on unbound references or on illegal elements.
See Also:
org.objectweb.kilim.model.RuntimeSource#setEventSource(Object)

getEventSourceValue

public java.lang.Object getEventSourceValue()
                                     throws KilimException
Description copied from interface: RuntimeSource
Method gets the EventSourceValue.

Specified by:
getEventSourceValue in interface RuntimeSource
Returns:
Object
Throws:
KilimException - : the exception is generated when the method is invoked on unbound references or on illegal elements.
See Also:
org.objectweb.kilim.model.RuntimeSource#getEventSource()

getValue

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

Specified by:
getValue in interface ComponentSource
Returns:
Object : the reference of the object provided by the source.
Throws:
KilimException - : the exception is generated when the method is invoked on unbound references or nary ports.

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
Throws:
KilimException - :
See Also:
ComponentInterface.unbindValue()

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
Parameters:
aValue - : the value to be assigned to the interface.
Throws:
KilimException - : generated when applied to a provider
See Also:
ComponentInterface.bindValue(Object)

update

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

Specified by:
update in interface ComponentInterface
Throws:
KilimException - :
See Also:
ComponentInterface.bindValue(Object)

fireTriggers

protected void fireTriggers(int eventKind,
                            java.lang.Object resultValue)
                     throws KilimException
Throws:
KilimException

initializeInstanciation

protected void initializeInstanciation()
                                throws KilimException
Throws:
KilimException

specificGetValue

protected abstract java.lang.Object specificGetValue()
                                              throws KilimException
Method specificGetValue.

Returns:
Object
Throws:
KilimException - :

specificBindValue

protected abstract void specificBindValue(java.lang.Object aValue)
                                   throws KilimException
Method specificBindValue.

Parameters:
aValue - :
Throws:
KilimException - :

specificUnbindValue

protected abstract void specificUnbindValue()
                                     throws KilimException
Method specificUnbindValue.

Throws:
KilimException - :