org.netbeans.modules.bpel.model.xam.spi
Interface InnerEventDispatcher

All Known Implementing Classes:
ArraySetterService, CheckNameService, CheckQNameService, CookieCopierService, DefaultNameService, DuplicateVariableDeclarationCheck, ExpressionConsistencyService, ImportChangeHandlingService, InnerEventDispatcherAdapter, MarkBuilderElement, NamespaceOptimizer, ReferenceInitilizerService, ReferenceIntegrityService, ResetBuilderElement, SetDeletedService, SetInTreeService, UIDCreationService, UniqueNameCheck

public interface InnerEventDispatcher

This interface could be implemented by various inner services for model. F.e. it could be used for setting UIDs for entities after creation, copying, cut. May be used for saving information from one entity ( with children ) for setting it to another entity ( after cut f.e. ). Any such service should implement this interface and put as service in META-INF. It will be loaded and each OM modification will be handled by those services. Please note that each class that implements this interface will be one for IDE, not one for each BPEL model. So you should care about race conditions in implementation. Because any model when it call methods of this interface will be locked exclusively. But this lock is per model. Not global lock. So there is possibility to change something from other thread from other model impl in the same instance of impl. This means that you should care about saving "context" information when method is called. You need either not hold any context at all or hold this context in ThreadLocal variables.

Author:
ads

Method Summary
 boolean isApplicable(ChangeEvent event)
          This method called for checking either we need to call this visitor for event.
 void postDispatch(ChangeEvent event)
          This method will be called after action on model was performed.
 void preDispatch(ChangeEvent event)
          This method will be called before action on model will be performed.
 void reset(ChangeEvent event)
          This method is called when some exception is detected in one of dispatchers.
 

Method Detail

isApplicable

boolean isApplicable(ChangeEvent event)
This method called for checking either we need to call this visitor for event.

Parameters:
event - Fired event.
Returns:
Is applicable this visitor for event.

preDispatch

void preDispatch(ChangeEvent event)
                 throws VetoException
This method will be called before action on model will be performed. This method could throw VetoException. It should not throw any exception on events about accessing to children ( setting/adding/removing child in parent ). This is because OM doesn't have methods that could be incorrectly used. Only setting incorrect attribute value could throw such exception.

Parameters:
event - Event that will be fired after OM will be changed. It is not yet happened.
Throws:
VetoException - VetoException Could be thrown if event is rejected by visitor.

postDispatch

void postDispatch(ChangeEvent event)
This method will be called after action on model was performed. It could perform additional changes in OM based on event information. F.e. it could change name of attribute that reference to some entity by name and this name was changed.

Parameters:
event - Event that fired by OM after change was performed.

reset

void reset(ChangeEvent event)
This method is called when some exception is detected in one of dispatchers. Then all dispatchers that collect some information on preDispatch stage can clear this information. Suggested use - when one of inner dispatchers throws VetoException then all diaspatchers need to clean internal state, because postDispatch will never be called.

Parameters:
event - Event that fired by OM after change was performed.