|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
MessageReply is used to describe communication status. Both backend and
client may fire the MessageReply message. Available types of MessageReply
are defined in MessageReplyType.
SmartSync notifies applications the MessageReply when applications register
a MessageReplyObserver with InboxNotifier.
Example:
To perform pre and post synchronization tasks.
Class MyMessageReplyObserver implememts MessageReplyObserver{
//Return the message types that the application needs to monitor.
public MessageReplyType[] observeMessageReplyTypes(){
MessageReplyType[] reply = new MessageReplyType[2];
reply[0]=MessageReplyType.SYNC_BEGIN;
reply[1]=MessageReplyType.SYNC_END;
return reply;
}
//Action to be performed
public messageReplyReceived(MessageReply messageReply){
if(messageReply.getType=MessageReply.SYNC_BEGIN){
// do pre synhronization tasks
}
else if(messageReply.getType=MessageReply.SYNC_END){
// do post synhronization tasks
}
}
}
// Register the observer.
SmartSyncRuntime.getInboxNotifier().registerMessageReplyObserver(MyMessageReplyObserver);
MessageReplyType
,
MessageReplyObserver
,
InboxNotifier
Method Summary | |
java.lang.String |
getMsgClass()
Gets the class of the message reply. |
int |
getNumber()
Gets the number of the message reply. |
java.lang.String |
getText()
Gets the text of the MessageReply. |
MessageReplyType |
getType()
Gets the type of the MessageReply. |
Method Detail |
public java.lang.String getText()
public MessageReplyType getType()
MessageReplyType
public java.lang.String getMsgClass()
public int getNumber()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |