问题
I am trying to create notification system between server and client side.
In my service I have something like this :
IClientNotificationService service = SERVICES.getService(IClientNotificationService.class);
service.putNotification(notification, new AllUserFilter(TIMEOUT));
On client side, when receive this notification, client present MessageBox with Yes No options.
MessageBox.showYesNoMessage(....)
What I would like to have is to be able to inform service what user select, yes or no.
For this I would need some wait, notify system, but I don't know how to do it.
Pleas help.
Marko
回答1:
What you are describing is not possible...
A client notification is a message send from the server to all clients. The feature is basic (no acknowledge, no failover, ...). It is perfect to notify the clients that a cache needs to be invalidated, but not to do some server/client/server interaction.
What you want to do make no sense to me... Imagine the performance impact if it was allowed to stop a server thread, waiting for some event transported over the network and requiring some user interaction... No framework on earth will provide something like that.
My guess is you try to misuse client notifications for your problem described in your other question: Scout Eclipse present optional message on server side. This is not a good idea at all.
来源:https://stackoverflow.com/questions/32496888/java-wait-for-iclientnotificationservice