com.zfabrik.util.sync
Interface ISynchronizer

All Known Implementing Classes:
AbstractComponentRepository

public interface ISynchronizer

A Synchronizer participates in system synchoronization. During a synchronization, a synchronizer may declare any number of resources invalid and subsequently perform synchronization post processing.

The synchronization implementation looks up all synchronizers and implements the following steps:

  1. Pre-invalidation: Ask all synchronizers for invalid resources via the preInvalidation(ISynchronization) method
  2. Invalidate all declared resources.
  3. Completion:: Complete synchronization via the complete(ISynchronization) method.
Synchronizers have a priority. Synchronizers with higher priority will be called later during the pre-invalidation phase and they will be called earlier during the completion phase.

The following table lists priorities of common synchronizers:

SynchronizerprioritypreInvalidationorderCompletionorder
worker adapter800 Reset worker side db
Components550 Verify component query subscriptions at home and workers
Worker500 Propagate invalidations to worker. Attain worker target states
Home1 Attain home states (home_up)

Author:
hb

Field Summary
static java.lang.String PRIO
          Component property defining the priority of a synchronizer
static java.lang.String TYPE
          Component type of a synchronizer
 
Method Summary
 void complete(ISynchronization sync)
          synchronizers implement this method to re-establish any desired system state after all invalidations have been performed.
 void preInvalidation(ISynchronization sync)
          synchronizers implement this method to collect the set of components to invalidate and log messages to the end user.
 

Field Detail

TYPE

static final java.lang.String TYPE
Component type of a synchronizer

See Also:
Constant Field Values

PRIO

static final java.lang.String PRIO
Component property defining the priority of a synchronizer

See Also:
Constant Field Values
Method Detail

preInvalidation

void preInvalidation(ISynchronization sync)
synchronizers implement this method to collect the set of components to invalidate and log messages to the end user.


complete

void complete(ISynchronization sync)
synchronizers implement this method to re-establish any desired system state after all invalidations have been performed. Note that the set of synchronizer in this call may be different to before, due to new system content.