org.inria.ns.reflex.processor
Class ExitException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.inria.ns.reflex.structures.LocalizableException
              extended by org.inria.ns.reflex.structures.ExecutionException
                  extended by org.inria.ns.reflex.structures.ControlableException
                      extended by org.inria.ns.reflex.processor.ExitException
All Implemented Interfaces:
Serializable, Localizable

public class ExitException
extends ControlableException

This exception is thrown when an exit action is encountered.

An exit action allows to exit the current logic procedure. A level may specifies the number of procedures to exit :

Author:
Philippe Poulard
See Also:
ExitAction, Serialized Form

Constructor Summary
ExitException(AbstractAction action)
          Creates a new ExitException that will exit only one logic procedure.
ExitException(AbstractAction action, int level)
          Creates a new ExitException.
 
Method Summary
 int getLevel()
          Get the level of exiting remaining.
static ExitException propagate(ExitException ee)
          Propagate the exit exception if its level allows to.
static void propagateException(ExitException ee)
          Propagate the exit exception if its level allows to.
 
Methods inherited from class org.inria.ns.reflex.structures.ExecutionException
getLocalizedMessage
 
Methods inherited from class org.inria.ns.reflex.structures.LocalizableException
getLocation, isLocalizable, setLocation, wasTraced
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExitException

public ExitException(AbstractAction action)
Creates a new ExitException that will exit only one logic procedure.


ExitException

public ExitException(AbstractAction action,
                     int level)
Creates a new ExitException.

Parameters:
level - The number of stacked logic procedures to exit.
Method Detail

getLevel

public int getLevel()
Get the level of exiting remaining.

Returns:
The level it remains to exit.

propagate

public static ExitException propagate(ExitException ee)
Propagate the exit exception if its level allows to.

Parameters:
ee - The exit exception to propagate.
Returns:
The exit exception to propagate, or null if no more propagation is required. If not null, the exit exception returned should be thrown.

propagateException

public static void propagateException(ExitException ee)
                               throws ExitException
Propagate the exit exception if its level allows to.

Parameters:
ee - The exit exception to propagate.
Throws:
The - exit exception to propagate only if more propagation is required.
ExitException