|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SyncBoInDeltaObserver
because it reduces performance of inbound processing.
This interface has to be implemented for any class observing SyncBO inbound
delta. SmartSync does not provide any abstract class or concrete class for
this interface. It has to specify which SyncBO inbound delta it is
notified for by naming the SyncBO types it is obeserving. The observers are
being notified thru the method syncBoInDeltaReceived
when an
inbound SyncBo delta data for any of the specified SyncBO types is received.
As opposed to SyncBoDeltaObserver, this observer's method is called before
modification (posting of SyncBoInDelta into local data store) takes place.
It is only used for SyncBo delta from the backend, no inbound delta that is
initiated from within the client.
To activate the observer, its instance needs to be registered with
InboxNotifier.
note
Transaction is not allowed to be used inside callback method syncBoInDeltaReceived(SyncBoInDelta),
and therefore SmartSyncTransactionManager.beginTransaction() musn't be called inside.
Example:
To perform some post operation on success.
Class MySynBoInDelta implements SyncBoInDeltaObserver{
// Return the SyncBo desc which the application should monitor
public SyncBoDescriptor[] observeSyncBoTypes(){
SyncBoDescriptor[] syncDescs = new SyncBoDescriptor[1];
syncDescs[0]= syncBoDesc2Observe;
}
//Implement the action
public SyncBoInDelta receivedSyncBoInDelta(SyncBoInDelta syncBoInDelta){
if(syncBoInDelta.getSyncReply().getType()==SyncReplyType.SUCCESS){
// perform post success operation.
}
}
}
// Register the observer.
SmartSyncRuntime.getInboxNotifier().registerSyncBoInDeltaObserver(MySynBoInDelta);
InboxNotifier
,
SyncBoInDelta
Method Summary | |
SyncBoDescriptor[] |
observeSyncBoTypes()
Deprecated. Specifies SyncBo descriptors that application needs to observe. |
SyncBoInDelta |
receivedSyncBoInDelta(SyncBoInDelta syncBoInDelta)
Deprecated. Notifies the observer with the inbound data which is designated by application |
Method Detail |
public SyncBoDescriptor[] observeSyncBoTypes()
public SyncBoInDelta receivedSyncBoInDelta(SyncBoInDelta syncBoInDelta)
Notifies the observer with the inbound data which is designated by application
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |