List of usage examples for com.google.gwt.user.client.rpc ServiceDefTarget getServiceEntryPoint
String getServiceEntryPoint();
From source file:com.github.manishahluwalia.gwt.rpcwrapper.client.RpcWrapper.java
License:Apache License
/** * Given a basic GWT-RPC proxy service, wrap it to have the qualities of * {@link RpcWrapper}/*from ww w .j a v a 2 s.c o m*/ * * @param service * A GWT-RPC proxy. Usually, acquired through * {@link GWT#create(Class)} * @return A wrapped GWT-RPC proxy */ public ServiceDefTarget wrapService(ServiceDefTarget service) { logger.finest("Wrapping service: " + service.getClass().getName() + " at " + service.getServiceEntryPoint() + " with policy " + service.getSerializationPolicyName()); service.setRpcRequestBuilder(builder); return service; }
From source file:com.google.gwt.gadgets.sample.gadgetrpc.client.GadgetRPC.java
License:Apache License
@Override protected void init(GadgetRPC.Preferences preferences) { gadgetService = GWT.create(GadgetService.class); ServiceDefTarget serviceDef = (ServiceDefTarget) gadgetService; String rpcUrl = serviceDef.getServiceEntryPoint(); // Uses Gadgets container as proxy for GWT RPC requests GadgetsGwtRpc.redirectThroughProxy(serviceDef); // Build the user interface. VerticalPanel vp = new VerticalPanel(); vp.setWidth("100%"); vp.add(new Label("RPC to: " + rpcUrl)); HorizontalPanel startedHp = new HorizontalPanel(); startedHp.add(new Label("Server Start Time: ")); startedHp.add(serverStartedText);//from w w w .j av a 2 s . c o m vp.add(startedHp); HorizontalPanel currentHp = new HorizontalPanel(); currentHp.add(new Label("Server Current Time: ")); currentHp.add(serverCurrentText); vp.add(currentHp); Button doRPCButton = new Button("Call RPC Method"); vp.add(doRPCButton); vp.add(exceptionInfo); RootPanel.get().add(vp); // Setup a button listener to invoke the RPC. doRPCButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { gadgetService.getServerInfo(rpcCallback); } }); }
From source file:com.tasktop.c2c.server.profile.web.ui.client.ProfileEntryPoint.java
License:Open Source License
static void updateServiceTarget(ServiceDefTarget target, String servletMappingBase, String servletMappingSuffix) { String ep = target.getServiceEntryPoint(); String expectedPath = Path.getBasePath() + servletMappingBase + "/" + servletMappingSuffix; int i = ep.lastIndexOf(expectedPath); if (i != -1) { ep = ep.substring(0, i) + Path.getBasePath() + "profile" + "/" + servletMappingSuffix; }/*ww w. j a v a2 s.co m*/ target.setServiceEntryPoint(ep); }
From source file:de.novanic.eventservice.client.event.GWTRemoteEventConnector.java
License:Open Source License
/** * Refreshes / re-initializes the {@link de.novanic.eventservice.client.event.service.EventService} when an explicit * connection id is assigned for the client. When the connection id is NULL (no explicit connection id assigned), the * {@link de.novanic.eventservice.client.event.service.EventService} will not be refreshed, because no separate connection * id has to be transferred back to the server. * @param aConnectionId connection id//from ww w . j a v a2s . c om * @return refreshed / re-initialized {@link de.novanic.eventservice.client.event.service.EventService} */ private EventServiceAsync refreshEventService(String aConnectionId) { if (aConnectionId != null) { EventServiceAsync theEventService = myEventServiceCreator.createEventService(); final ServiceDefTarget theServiceDefTarget = (ServiceDefTarget) theEventService; theServiceDefTarget .setServiceEntryPoint(theServiceDefTarget.getServiceEntryPoint() + "?id=" + aConnectionId); return theEventService; } return myEventService; }
From source file:de.novanic.eventservice.client.event.RemoteEventServiceFactory.java
License:Open Source License
/** * Registers an user-/client-specific {@link de.novanic.eventservice.client.ClientHandler} to an existing service instance to provide the connection-/client-id with every request / server-call. * That makes it possible to add user-specific events or domain-user-specific EventFilters dynamically when the {@link de.novanic.eventservice.client.ClientHandler} * is provided. The {@link de.novanic.eventservice.client.ClientHandler} can be got from * {@link de.novanic.eventservice.client.event.RemoteEventServiceFactory#requestClientHandler(com.google.gwt.user.client.rpc.AsyncCallback)}. * The {@link de.novanic.eventservice.client.ClientHandler} could also be transferred manually to your custom service to manage or use the connection-/client-ids * for user-specific events or domain-user-specific EventFilters. * The service could extend from RemoteEventServiceServlet or use the EventExecutorService to execute events. * Events (also user-specific) can also be executed directly from the client-side (see {@link de.novanic.eventservice.client.event.RemoteEventService}). * @param anAsyncServiceInstance an async service (instance) which needs to add user-specific events or domain-user-specific EventFilters dynamically from the server-side * @param aClientHandler {@link de.novanic.eventservice.client.ClientHandler} to provide the connection-/client-id for user-specific events or domain-user-specific EventFilters * @return (re-)mapped service instance with a provided {@link de.novanic.eventservice.client.ClientHandler} *//* ww w. ja v a2s . c om*/ public void registerClientSpecificHandler(ServiceDefTarget anAsyncServiceInstance, ClientHandler aClientHandler) { StringBuilder theServiceURLStringBuilder = new StringBuilder(anAsyncServiceInstance.getServiceEntryPoint()); theServiceURLStringBuilder.append("?id="); theServiceURLStringBuilder.append(aClientHandler.getConnectionId()); anAsyncServiceInstance.setServiceEntryPoint(theServiceURLStringBuilder.toString()); }
From source file:org.homedns.mkh.dataservice.client.AbstractEntryPoint.java
License:Apache License
/** * Sets service URL/*from w w w .java 2 s . co m*/ * * @param endPoint * the service definition target * @param sServiceDomain * the service domain */ private void setServiceURL(ServiceDefTarget endPoint, String sServiceDomain) { endPoint.setServiceEntryPoint(GWT.getModuleBaseURL() + sServiceDomain); LOG.config(endPoint.getServiceEntryPoint()); }
From source file:org.pentaho.samples.gecho.client.GEcho.java
License:Open Source License
private void getServerMessage() { GEchoServiceAsync gechoService = GWT.create(GEchoService.class); ServiceDefTarget endpoint = (ServiceDefTarget) gechoService; endpoint.setServiceEntryPoint(getBaseUrl()); debugLabel.setText("posting to: " + endpoint.getServiceEntryPoint()); AsyncCallback<String> callback = new AsyncCallback<String>() { public void onFailure(Throwable caught) { serverResponseLabel.setText("Error communicating with GEchoService: " + caught.toString()); caught.printStackTrace();//from w ww . j av a2 s . c om } public void onSuccess(String result) { serverResponseLabel.setText(result); } }; gechoService.echo("GEcho client", callback); }
From source file:org.silverpeas.mobile.client.common.ServicesLocator.java
License:Open Source License
private static void changeServiceEntryPoint(ServiceDefTarget service, boolean guiWaiting) { if (guiWaiting) Notification.activityStart(); String serviceEntryPoint = service.getServiceEntryPoint(); if (!serviceEntryPoint.contains("services")) { serviceEntryPoint = serviceEntryPoint.replace("spmobile", "services/spmobile"); }//from www .j a v a 2 s.co m service.setServiceEntryPoint(serviceEntryPoint); }
From source file:org.silverpeas.mobile.client.common.ServicesLocator.java
License:Open Source License
private static void changeAuthentificationServiceEntryPoint(ServiceDefTarget service) { String serviceEntryPoint = service.getServiceEntryPoint(); if (!serviceEntryPoint.contains("AuthenticationServlet")) { serviceEntryPoint = serviceEntryPoint.replace("spmobile", "AuthenticationServlet/spmobile"); }/*from www . j a v a 2 s .co m*/ service.setServiceEntryPoint(serviceEntryPoint); }