Java等待IClientNotificationService

Java等待IClientNotificationService

本文介绍了Java等待IClientNotificationService的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在服务器和客户端之间创建通知系统。

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));

客户端收到此通知后,客户端将显示MessageBox(是否)。

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.

请求帮助

Marko

推荐答案

不可能...

是从服务器发送到所有客户端的消息。该功能是基本的(无应答,无故障切换,...​​)。通知客户端缓存需要失效,但不要做一些服务器/客户端/服务器的交互是非常完美的。

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.

这篇关于Java等待IClientNotificationService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 19:02