本文整理汇总了Java中com.google.gwt.user.client.rpc.ServiceDefTarget.setServiceEntryPoint方法的典型用法代码示例。如果您正苦于以下问题:Java ServiceDefTarget.setServiceEntryPoint方法的具体用法?Java ServiceDefTarget.setServiceEntryPoint怎么用?Java ServiceDefTarget.setServiceEntryPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.rpc.ServiceDefTarget
的用法示例。
在下文中一共展示了ServiceDefTarget.setServiceEntryPoint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetDomainTree
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public void testGetDomainTree() {
// Create the service that we will test.
AtomServiceAsync atomService = GWT.create(AtomService.class);
ServiceDefTarget target = (ServiceDefTarget) atomService;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "ATOM/rpc");
// Since RPC calls are asynchronous, we will need to wait for a response
// after this test method returns. This line tells the test runner to
// wait
// up to 10 seconds before timing out.
delayTestFinish(Integer.MAX_VALUE);
atomService.getDomainTree(authBackDoor, new AsyncCallback<DomainClass>() {
public void onFailure(Throwable caught) {
fail("Request failure: " + caught.getMessage());
}
public void onSuccess(DomainClass result) {
assertEquals(result.getName(), domainObjectClassName);
finishTest();
}
});
}
示例2: CalendarProvider
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public CalendarProvider() {
// Initialize the service.
//
calService = (SchoolCalendarServiceAsync) GWT.create(SchoolCalendarService.class);
// By default, we assume we'll make RPCs to a servlet, but see
// updateRowData(). There is special support for canned RPC responses.
// (Which is a totally demo hack, by the way :-)
//
ServiceDefTarget target = (ServiceDefTarget) calService;
// Use a module-relative URLs to ensure that this client code can find
// its way home, even when the URL changes (as might happen when you
// deploy this as a webapp under an external servlet container).
String moduleRelativeURL = GWT.getModuleBaseURL() + "calendar";
target.setServiceEntryPoint(moduleRelativeURL);
}
示例3: testGreetingService
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
/**
* This test will send a request to the server using the greetServer method in
* GreetingService and verify the response.
*/
public void testGreetingService() {
// Create the service that we will test.
GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
ServiceDefTarget target = (ServiceDefTarget) greetingService;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "EssenceFrontEnd/greet");
// Since RPC calls are asynchronous, we will need to wait for a response
// after this test method returns. This line tells the test runner to wait
// up to 10 seconds before timing out.
delayTestFinish(10000);
// Send a request to the server.
greetingService.greetServer("GWT User", new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
// The request resulted in an unexpected error.
fail("Request failure: " + caught.getMessage());
}
public void onSuccess(String result) {
// Verify that the response is correct.
assertTrue(result.startsWith("Hello, GWT User!"));
// Now that we have received a response, we need to tell the test runner
// that the test is complete. You must call finishTest() after an
// asynchronous test finishes successfully, or the test will time out.
finishTest();
}
});
}
示例4: getRPCService
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public static RPCServiceAsync getRPCService() {
RPCServiceAsync rpcService = (RPCServiceAsync) GWT.create(RPCService.class);
ServiceDefTarget endpoint = (ServiceDefTarget) rpcService;
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
String rpcURL = "";
String base_path = URLUtil.getBaseURL();
rpcURL = base_path + "rpc";
endpoint.setServiceEntryPoint(rpcURL);
return rpcService;
}
示例5: getRemoteServieAsyncObject
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
/**
* Allows to allocate the remote service object
* @param classObj the service class object for instantiation
* @param URL_SUFFIX the url-suffix on the server t send the requests to
* @return returns the remote service object
*/
public static <R> R getRemoteServieAsyncObject( R remoteService, final String URL_SUFFIX ) {
ServiceDefTarget endpoint = (ServiceDefTarget) remoteService;
String moduleRelativeURL = GWT.getModuleBaseURL() + URL_SUFFIX;
endpoint.setServiceEntryPoint( moduleRelativeURL );
return remoteService;
}
示例6: getAsyncService
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
protected GreetingServiceAsync getAsyncService() {
GreetingServiceAsync greetingService = GWT
.create(GreetingService.class);
ServiceDefTarget target = (ServiceDefTarget) greetingService;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "spawebtest/greet");
return greetingService;
}
示例7: getInstance
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public static LoginServiceAsync getInstance()
{
if (instance == null) {
instance = (LoginServiceAsync) GWT.create(LoginService.class);
ServiceDefTarget target = (ServiceDefTarget) instance;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "rpc/LoginService");
}
return instance;
}
示例8: getInstance
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public static UserServiceAsync getInstance()
{
if (instance == null) {
instance = (UserServiceAsync) GWT.create(UserService.class);
ServiceDefTarget target = (ServiceDefTarget) instance;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "rpc/UserService");
}
return instance;
}
示例9: getInstance
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public static PasswordServiceAsync getInstance()
{
if (instance == null) {
instance = (PasswordServiceAsync) GWT.create(PasswordService.class);
ServiceDefTarget target = (ServiceDefTarget) instance;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "rpc/PasswordService");
}
return instance;
}
示例10: init
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
private void init(RootPanel root) {
ServiceDefTarget endpoint = (ServiceDefTarget)_service;
endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "person-service");
Column[] columns = {
new Column(0, false, "First Name", "50%"),
new Column(1, false, "Last Name", "50%")
};
Table table = new Table(new ColumnLayout(columns));
table.setSize("100%", "100%");
table.setContentProvider(new PersonContentProvider(table));
table.update();
root.add(table);
}
示例11: getInstance
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public static IOneCMDBGWTServiceAsync getInstance() {
if (service == null) {
service = (IOneCMDBGWTServiceAsync) GWT.create(IOneCMDBGWTService.class);
ServiceDefTarget target = (ServiceDefTarget) service;
// Use a module-relative URLs to ensure that this client code can find
// its way home, even when the URL changes (as might happen when you
// deploy this as a webapp under an external servlet container).
String moduleRelativeURL = GWT.getModuleBaseURL() + "onecmdb-gwt/wsdl";
target.setServiceEntryPoint(moduleRelativeURL);
}
return(service);
}
示例12: get
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public static IModelServiceAsync get() {
if (service == null) {
service = (IModelServiceAsync) GWT.create(IModelService.class);
ServiceDefTarget target = (ServiceDefTarget) service;
// Use a module-relative URLs to ensure that this client code can find
// its way home, even when the URL changes (as might happen when you
// deploy this as a webapp under an external servlet container).
String moduleRelativeURL = GWT.getModuleBaseURL() + "/onecmdb-rpc/IModelService";
target.setServiceEntryPoint(moduleRelativeURL);
}
return(service);
}
示例13: get
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public static IContentServiceAsync get() {
if (service == null) {
service = (IContentServiceAsync) GWT.create(IContentService.class);
ServiceDefTarget target = (ServiceDefTarget) service;
// Use a module-relative URLs to ensure that this client code can find
// its way home, even when the URL changes (as might happen when you
// deploy this as a webapp under an external servlet container).
String moduleRelativeURL = GWT.getModuleBaseURL() + "/onecmdb-rpc/IContentService";
target.setServiceEntryPoint(moduleRelativeURL);
}
return(service);
}
示例14: get
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public static IChangeServiceAsync get() {
if (changeService == null) {
changeService = (IChangeServiceAsync) GWT.create(IChangeService.class);
ServiceDefTarget target = (ServiceDefTarget) changeService;
// Use a module-relative URLs to ensure that this client code can find
// its way home, even when the URL changes (as might happen when you
// deploy this as a webapp under an external servlet container).
String moduleRelativeURL = GWT.getModuleBaseURL() + "onecmdb-rpc/IChangeService";
target.setServiceEntryPoint(moduleRelativeURL);
}
return(changeService);
}
示例15: getService
import com.google.gwt.user.client.rpc.ServiceDefTarget; //导入方法依赖的package包/类
public synchronized T getService() {
if (service == null) {
service = createService();
if (service instanceof ServiceDefTarget) {
ServiceDefTarget sdt = (ServiceDefTarget) service;
sdt.setServiceEntryPoint(WebUtil.encodeUrl(GWT.getModuleBaseURL() + location));
sdt.setRpcRequestBuilder(new CustomBuilder());
}
}
return service;
}