org.ow2.orchestra.pvm.internal.model
Class ExceptionHandlerImpl

java.lang.Object
  extended by org.ow2.orchestra.pvm.internal.model.ExceptionHandlerImpl
All Implemented Interfaces:
Serializable

public class ExceptionHandlerImpl
extends Object
implements Serializable

Author:
Tom Baeyens, Guillaume Porcher
See Also:
Serialized Form

Field Summary
protected  long dbid
           
protected  int dbversion
           
protected  List<ObjectReference<EventListener>> eventListenerReferences
           
protected  String exceptionClassName
           
protected  boolean isRethrowMasked
           
protected  boolean isTransactional
           
protected  String nodeName
           
protected  String transitionName
           
 
Constructor Summary
ExceptionHandlerImpl()
           
 
Method Summary
 ObjectReference<EventListener> createActivityReference(String expression)
           
 ObjectReference<EventListener> createEventListenerReference()
           
 ObjectReference<EventListener> createEventListenerReference(Descriptor descriptor)
           
 ObjectReference<EventListener> createEventListenerReference(EventListener eventListener)
           
protected  void executeHandler(ExecutionImpl execution, Exception exception, ProcessElementImpl processElementImpl)
          Compensating code for the exception.
 long getDbid()
           
 List<ObjectReference<EventListener>> getEventListenerReferences()
           
 List<EventListener> getEventListeners()
           
 String getExceptionClassName()
           
 String getNodeName()
           
 String getTransitionName()
           
 void handle(ExecutionImpl execution, Exception exception, ProcessElementImpl processElementImpl)
          Handles the exception.
 boolean isRethrowMasked()
           
 boolean isTransactional()
           
 boolean matches(Class<?> exceptionClass)
           
 boolean matches(Exception exception)
           
static void rethrow(Exception exception, String prefixMessage)
           
 void setEventListenerReferences(List<ObjectReference<EventListener>> activityReferences)
           
 void setExceptionClassName(String exceptionClassName)
           
 void setNodeName(String nodeName)
           
 void setRethrowMasked(boolean isRethrowMasked)
           
 void setTransactional(boolean isTransactional)
           
 void setTransitionName(String transitionName)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dbid

protected long dbid

dbversion

protected int dbversion

exceptionClassName

protected String exceptionClassName

isTransactional

protected boolean isTransactional

isRethrowMasked

protected boolean isRethrowMasked

eventListenerReferences

protected List<ObjectReference<EventListener>> eventListenerReferences

transitionName

protected String transitionName

nodeName

protected String nodeName
Constructor Detail

ExceptionHandlerImpl

public ExceptionHandlerImpl()
Method Detail

createEventListenerReference

public ObjectReference<EventListener> createEventListenerReference(EventListener eventListener)

createEventListenerReference

public ObjectReference<EventListener> createEventListenerReference(Descriptor descriptor)

createActivityReference

public ObjectReference<EventListener> createActivityReference(String expression)

createEventListenerReference

public ObjectReference<EventListener> createEventListenerReference()

getEventListeners

public List<EventListener> getEventListeners()

matches

public boolean matches(Exception exception)

matches

public boolean matches(Class<?> exceptionClass)

handle

public void handle(ExecutionImpl execution,
                   Exception exception,
                   ProcessElementImpl processElementImpl)
Handles the exception. This method will execute compensating code in the same TX or in another TX (depending on the value of isTransactional field). The compensating code is not in this method, but in executeHandler(ExecutionImpl, Exception, ProcessElementImpl) method.

Parameters:
execution - the execution which produced the exception
exception - the exception to handle
processElementImpl - the process element the exception handler was triggered from.

executeHandler

protected void executeHandler(ExecutionImpl execution,
                              Exception exception,
                              ProcessElementImpl processElementImpl)
Compensating code for the exception. This method is called from handle(ExecutionImpl, Exception, ProcessElementImpl) or from ExceptionHandlerSynchronization and should not be called directly. Extensions should overwrite this method.

Parameters:
execution - the execution which produced the exception
exception - the exception to handle
processElementImpl - the process element the exception handler was triggered from.

rethrow

public static void rethrow(Exception exception,
                           String prefixMessage)

toString

public String toString()
Overrides:
toString in class Object

getDbid

public long getDbid()

getExceptionClassName

public String getExceptionClassName()

setExceptionClassName

public void setExceptionClassName(String exceptionClassName)

isTransactional

public boolean isTransactional()

setTransactional

public void setTransactional(boolean isTransactional)

getTransitionName

public String getTransitionName()

setTransitionName

public void setTransitionName(String transitionName)

getNodeName

public String getNodeName()

setNodeName

public void setNodeName(String nodeName)

isRethrowMasked

public boolean isRethrowMasked()

setRethrowMasked

public void setRethrowMasked(boolean isRethrowMasked)

getEventListenerReferences

public List<ObjectReference<EventListener>> getEventListenerReferences()

setEventListenerReferences

public void setEventListenerReferences(List<ObjectReference<EventListener>> activityReferences)


Copyright © 2011 OW2 Consortium. All Rights Reserved.