Java wait for IClientNotificationService

本小妞迷上赌 提交于 2019-12-25 06:09:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!