org.objectweb.kilim.model
Class RtSingleValuePort

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.RtSingleValuePort
All Implemented Interfaces:
ComponentElement, ComponentInterface, ComponentSource, RuntimeElement, RuntimeSource

public class RtSingleValuePort
extends RtComponentInterface
implements ComponentInterface

Author:
horn

Field Summary
private  boolean firstCall
           
private  boolean gotAValue
           
private  boolean msgDisplayed
           
private  int nbBound
           
private  RuntimeSource provider
           
private  java.lang.Object resultValue
           
 
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
RtSingleValuePort(Port aPort, ContainerElement aContainer)
          The public constructor for run time descriptors of single value ports.
 
Method Summary
 void bindProvider(RuntimeSource aProvider, boolean jReplace)
          binds an interface to a value source.
 boolean checkValue(java.util.Stack exclude)
          returns whether a value can be obtained without having to create new objects
 java.lang.Object getBufferedValue()
          Method getBufferedValue : returns the current buffered value.
 java.lang.String getLocalName()
          returns the local name of the component element.
 boolean hasValue()
          returns whether a value has been evaluated and stored in the source.
 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.
protected  void specificBindValue(java.lang.Object aValue)
          Method specificBindValue.
protected  java.lang.Object specificGetValue()
          Method specificGetValue.
protected  void specificUnbindValue()
          Method specificUnbindValue.
 void unbindProvider(RuntimeSource aProvider)
          unbinds an interface and source value.
 
Methods inherited from class org.objectweb.kilim.model.RtComponentInterface
addTrigger, bindValue, fireTriggers, getEventSourceValue, getTriggerList, getTriggers, getValue, initializeInstanciation, isEventSource, isModified, removeTrigger, setEventSourceValue, setTriggersDone, triggersDone, unbindValue, update
 
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
bindValue, isModified, unbindValue, update
 
Methods inherited from interface org.objectweb.kilim.model.ComponentSource
getValue
 
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

provider

private RuntimeSource provider

resultValue

private java.lang.Object resultValue

gotAValue

private boolean gotAValue

firstCall

private boolean firstCall

nbBound

private int nbBound

msgDisplayed

private boolean msgDisplayed
Constructor Detail

RtSingleValuePort

public RtSingleValuePort(Port aPort,
                         ContainerElement aContainer)
The public constructor for run time descriptors of single value ports.

Parameters:
aPort - : the template port descriptor
aContainer - : either the containing component or slot
Method Detail

hasValue

public boolean hasValue()
Description copied from interface: ComponentSource
returns whether a value has been evaluated and stored in the source. The behaviour of this method is highly dependant on the real nature of the source. It always returns false when invoked on a provider.

Specified by:
hasValue in interface ComponentSource
Returns:
boolean
See Also:
RuntimeSource.hasValue()

getBufferedValue

public java.lang.Object getBufferedValue()
Method getBufferedValue : returns the current buffered value. This method returns null when invoked prior to the evaluation.

Returns:
Object

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.

Specified by:
isSingleValuePort in interface ComponentInterface
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.

Specified by:
isCollectionPort in interface ComponentInterface
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).

Specified by:
isProvider in interface ComponentInterface
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.

Specified by:
isProperty in interface ComponentInterface
Returns:
boolean
See Also:
ComponentInterface.isProperty()

getLocalName

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

Specified by:
getLocalName in interface ComponentElement
Returns:
String
See Also:
ComponentElement.getLocalName()

bindProvider

public void bindProvider(RuntimeSource aProvider,
                         boolean jReplace)
                  throws KilimException
Description copied from interface: ComponentInterface
binds an interface to a value source. This method has a behaviour which depends on the exact kind

Specified by:
bindProvider in interface ComponentInterface
Specified by:
bindProvider in class RtComponentInterface
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.
See Also:
RtComponentInterface.bindProvider(RuntimeSource, boolean)

unbindProvider

public void unbindProvider(RuntimeSource aProvider)
                    throws KilimException
Description copied from interface: ComponentInterface
unbinds an interface and source value.

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)

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:
RuntimeSource.getValue()

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:
org.objectweb.kilim.model.ComponentInterface#bindValue(Object, RuntimeContext)

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()

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

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