Communicate whith a service
1. 创建一个接口XXX继承RemoteService接口
2. 再创建一个借口继承RemoteServiceServlet并实现XXX
3. 创建一个异步接口,名字为服务接口名字再加上Async,(即XXXAsync),两个
接口放在同一个包下,定义异步兄弟方法
4. 确定客户端代码可以通过在web.xml中映射的SERVLET的URL进行服务调用。
例子
假定你想调用一个服务接口中的方法,如下定义
public interface MyEmailService extends RemoteService { void emptyMyInbox(String username, String password); }
它的异步对应接口会如下所示:
public interface MyEmailServiceAsync {
void emptyMyInbox(String username, String password, AsyncCallback callback);
}
客户端调用如下所示:
public void menuCommandEmptyInbox() {
// (1) Create the client proxy. Note that although you are creating the
// service interface proper, you cast the result to the asynchronous
// version of
// the interface. The cast is always safe because the generated proxy
// implements the asynchronous interface automatically. //
MyEmailServiceAsync emailService = (MyEmailServiceAsync) GWT.create(MyEmailService.class);
// (2) Specify the URL at which our service implementation is running.
// Note that the target URL must reside on the same domain and port from
// which the host page was served.
//
Plugins (JBI components) do not communicate directly with one another; they only communicate with the NMR (in order to achieve decoupling between service ...
Quality of Service, Multiple Points Communications, Differentiated Service, ... wants to communicate with others, it firstly requests the token from MCUi...
Jabber for windows 无法登陆,cannt communicate with server_计算机软件及应用_IT/计算机_专业资料。Jabber for windows 无法登陆,报错cannt communicate with server...
―My computer crashed.‖(25)___(communicate) with journalists makes a difference...The first cable car came into public service in 1873, and the slow...
How to Communicate With Others 怎样与人沟通_英语_初中教育_教育专区 暂无评价0人阅读0次下载举报文档 How to Communicate With Others 怎样与人沟通_英语_...
How to communicate with customers_英语学习_外语学习_教育专区。How to ...Try to contact the customer service department. (key words: defect, ...
The IEEE 802.11s Extended Service Set Mesh etworking Standard_电脑基础知识...Furthermore, if a synchronizing MP wishes to communicate with a ...
How to communicate with classmates Hello everyone, attention please! As we all know, communication is one of the most essential social skills that we ...
JD-Agent Guest Service酒店前台岗位说明书_人力资源管理_经管营销_专业资料。...??Communicate correctly and efficiently with other guest services departments ...
how to communicate with people_英语学习_外语学习_教育专区。How To Communicate With People Seven Keys To Effective C o m m u n i c a t i o n ...
热门文档