org.inria.ns.reflex.processor.xcl
Class TimeoutAttr

java.lang.Object
  extended by org.inria.ns.reflex.processor.ForeignAttribute.Impl
      extended by org.inria.ns.reflex.processor.xcl.TimeoutAttr
All Implemented Interfaces:
Comparable, ForeignAttribute

public class TimeoutAttr
extends ForeignAttribute.Impl

The @xcl:timeout foreign attribute sets a timeout on an active tag.

If the active tag that hosts this attribute lasts more than the delay given in the value of this attribute, it will be interrupted. The $xcl:interrupted status property can be tested to check whether the active tag was interrupted or not.

When the timeout is reached, the $xcl:interrupt property signals to cancel their process, which is done in the AbstractAction.run(DataSet) method. Custom operations can also check periodically to cancel their process.

If the thread to interrupt is blocked, it will be interrupted in the conditions stated by the thread class.

Author:
Philippe Poulard
See Also:
Thread.interrupt()

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.processor.ForeignAttribute
ForeignAttribute.Impl, ForeignAttribute.Marker
 
Constructor Summary
TimeoutAttr()
           
 
Method Summary
 AbstractAction apply(AbstractAction parent, Element element, SortedList foreignAttrs)
          Create a new abstract action that wraps the action to unmarshal.
 int getPriority()
          Return the priority of this foreign attribute, that is 200.
 
Methods inherited from class org.inria.ns.reflex.processor.ForeignAttribute.Impl
compareTo, getName, getValue, setName, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeoutAttr

public TimeoutAttr()
Method Detail

apply

public AbstractAction apply(AbstractAction parent,
                            Element element,
                            SortedList foreignAttrs)
Create a new abstract action that wraps the action to unmarshal. This foreign attribute operates at runtime.

Parameters:
parent - The action depending from.
element - The XML element that contains the foreign attribute.
foreignAttrs - The other foreign attributes found within the element that hosts the attribute. Not used.
Returns:
The parent action, which is the wrapper action used for applying this foreign attribute.

getPriority

public int getPriority()
Return the priority of this foreign attribute, that is 200.

Returns:
200 = the priority level of this foreign attribute.