Listening for events is a relatively straightforward process.
- 1. Create a class that implements SyncEventListener
- 2. Register (call addSyncEventListener) with the target
The target may be either the SyncManager
SyncManager sm = SyncManagerFactory.getSyncManager();
sm.addSyncEventListener( new EventListener("SyncManagerListener"));
or a SyncUnit returned from the SyncManager
su = sm.add( su );
su.addSyncEventListener( new EventListener( "SyncUnitListener") );
Adding a SyncEventListener to a SyncUnit before adding it to the SyncManager will result in no events being received.
Synchronization events: XPD622
The set of events that may be received are defined by the EventType class.
The Event context: XPD622
Each event that is received has an Event context that provides more information about the event. The type of context is dependent upon the event type, and also the source of the event.
Parent topic: SyncManager class uses: XPD622