use of com.googlecode.gwtphonegap.client.rpc.PhonegapRPCService in project gwtphonegap by dankurka.
the class PhonegapUtilImplDevice method prepareService.
@Override
public void prepareService(ServiceDefTarget service, final String moduleUrl, String relativeServiceUrl) {
service.setServiceEntryPoint(moduleUrl + relativeServiceUrl);
service.setRpcRequestBuilder(new RpcRequestBuilder() {
@Override
protected void doFinish(RequestBuilder rb) {
super.doFinish(rb);
rb.setHeader(MODULE_BASE_HEADER, moduleUrl);
}
});
if (!(service instanceof PhonegapRPCService)) {
throw new IllegalStateException("the rpc service you are trying to use was not generated by Phonegap RPC Serivce Generator");
}
PhonegapRPCService phonegapRPCService = (PhonegapRPCService) service;
phonegapRPCService.setModuleBaseUrl(moduleUrl);
}
Aggregations