de.cau.cs.kieler.synccharts.listener
Class FailSafeTriggerListener

java.lang.Object
  extended by org.eclipse.emf.transaction.ResourceSetListenerImpl
      extended by org.eclipse.emf.transaction.TriggerListener
          extended by de.cau.cs.kieler.synccharts.listener.FailSafeTriggerListener
All Implemented Interfaces:
EventListener, ResourceSetListener, ResourceSetListener.Internal
Direct Known Subclasses:
FireOnceTriggerListener

public abstract class FailSafeTriggerListener
extends TriggerListener

An abstract TriggerListener, that catches all Exceptions and logs them. Problem with TriggerListeners is that in case of an Exception, the whole corresponding transaction will be rolled back. Even commands that have not much to do with the trigger listener will be undone. Subclasses of this class can throw any exceptions which get only logged (to get some not annoying fail silent behavior) and still return a null Command, which will be correctly processed by the transaction service. Hence the original transaction can be executed correctly and will not be disturbed by this TriggerListener.

Rating red

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.transaction.ResourceSetListener
ResourceSetListener.Internal
 
Constructor Summary
FailSafeTriggerListener()
           
FailSafeTriggerListener(NotificationFilter filter)
           
 
Method Summary
 Command transactionAboutToCommit(ResourceSetChangeEvent event)
           
 
Methods inherited from class org.eclipse.emf.transaction.TriggerListener
isPrecommitOnly, trigger
 
Methods inherited from class org.eclipse.emf.transaction.ResourceSetListenerImpl
getFilter, getTarget, isAggregatePrecommitListener, isPostcommitOnly, resourceSetChanged, setTarget, unsetTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FailSafeTriggerListener

public FailSafeTriggerListener()

FailSafeTriggerListener

public FailSafeTriggerListener(NotificationFilter filter)
Method Detail

transactionAboutToCommit

public Command transactionAboutToCommit(ResourceSetChangeEvent event)
                                 throws RollbackException
Specified by:
transactionAboutToCommit in interface ResourceSetListener
Overrides:
transactionAboutToCommit in class TriggerListener
Throws:
RollbackException