Java 类com.google.gwt.user.client.rpc.ServiceDefTarget 实例源码

项目:salasanasiilo    文件:WebPasswordSafe.java   
private void initXsrfProtection(final LoginWindow loginWindow)
{
    XsrfTokenServiceAsync xsrf = (XsrfTokenServiceAsync)GWT.create(XsrfTokenService.class);
    ((ServiceDefTarget)xsrf).setServiceEntryPoint(GWT.getModuleBaseURL() + "xsrf");
    xsrf.getNewXsrfToken(new AsyncCallback<XsrfToken>() {
        @Override
        public void onSuccess(XsrfToken token)
        {
            ServiceHelper.setXsrfToken(token);
            doGetLoggedInUser(loginWindow);
        }
        @Override
        public void onFailure(Throwable caught)
        {
            WebPasswordSafe.handleServerFailure(caught);
        }
    });
}
项目:google-gin    文件:InjectTest.java   
public void testRemoteService() {
  MyAppGinjector injector = GWT.create(MyAppGinjector.class);

  // A remote service proxy
  MyRemoteServiceAsync service = injector.getMyRemoteServiceAsync();

  // Make sure that the returned object is a service proxy generated by GWT
  Object gwtCreatedService = GWT.create(MyRemoteService.class);
  assertEquals(gwtCreatedService.getClass(), service.getClass());

  // Make sure that the @RemoteServiceRelativePath annotation worked
  assertEquals(GWT.getModuleBaseURL() + "myRemoteService",
      ((ServiceDefTarget) service).getServiceEntryPoint());

  // Make sure that we always return the same instance
  assertSame(service, injector.getMyRemoteServiceAsync());
}
项目:mvp4g    文件:Mvp4gGenerator.java   
String[] getClassesToImport() {
  return new String[] { com.mvp4g.client.history.PlaceService.class.getName(),
                        GWT.class.getName(),
                        com.google.gwt.user.client.History.class.getName(),
                        ServiceDefTarget.class.getName(),
                        PresenterInterface.class.getName(),
                        EventBus.class.getName(),
                        Mvp4gException.class.getName(),
                        HistoryConverter.class.getName(),
                        Mvp4gEventPasser.class.getName(),
                        Mvp4gModule.class.getName(),
                        GinModules.class.getName(),
                        Ginjector.class.getName(),
                        BaseEventBus.class.getName(),
                        EventFilter.class.getName(),
                        EventHandlerInterface.class.getName(),
                        List.class.getName(),
                        NavigationEventCommand.class.getName(),
                        NavigationConfirmationInterface.class.getName(),
                        RunAsyncCallback.class.getName(),
                        Mvp4gRunAsync.class.getName(),
                        Command.class.getName(),
                        HistoryProxyProvider.class.getName(),
                        DefaultHistoryProxy.class.getName() };
}
项目:atom    文件:GwtTestATOM.java   
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();
        }
    });
}
项目:Peergos    文件:SchoolCalendarWidget.java   
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);
}
项目:swarm    文件:SchoolCalendarWidget.java   
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);
}
项目:essence    文件:GwtTestEssenceFrontEnd.java   
/**
 * 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();
    }
  });
}
项目:LAS    文件:Util.java   
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;
}
项目:x-gwt    文件:XLoggerFactory.java   
public static Handler makeRemoteLogHandler(String remoteLoggingPath) {
    RemoteLoggingServiceAsync service = GWT.create(RemoteLoggingService.class);
    ((ServiceDefTarget) service).setServiceEntryPoint(remoteLoggingPath);
    Handler handler = GWT.create(XLoggerRemoteHandler.class);
    if (handler instanceof XLoggerRemoteHandler) {
        ((XLoggerRemoteHandler) handler).setService(service);
    }
    return handler;
}
项目:x-cure-chat    文件:RPCAccessManager.java   
/**
 * 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;
}
项目:gwt-syncproxy    文件:GreetingServiceTest.java   
protected GreetingServiceAsync getAsyncService() {
    GreetingServiceAsync greetingService = GWT
            .create(GreetingService.class);
    ServiceDefTarget target = (ServiceDefTarget) greetingService;
    target.setServiceEntryPoint(GWT.getModuleBaseURL() + "spawebtest/greet");
    return greetingService;
}
项目:gwt-syncproxy    文件:RemoteServiceInvocationHandler.java   
/**
 * Handles method invocations to the {@link ServiceDefTarget} interface
 * implemented by the service.
 */
protected Object handleServiceDefTarget(Object proxy, Method method,
        Object[] args) throws Throwable {
    if (ServiceDefTarget.class.getMethod("getSerializationPolicyName")
            .equals(method)) {
        return this.settings.getPolicyName();
    } else if (ServiceDefTarget.class.getMethod("setServiceEntryPoint",
            String.class).equals(method)) {
        this.serviceEntryPoint = (String) args[0];
        // Modify current base and relative Path to newly specific
        // serviceEntryPoint assuming that base path is part of
        // serviceEntryPoint
        // TODO May not be a valid assumption
        if (this.serviceEntryPoint.contains(this.settings
                .getModuleBaseUrl())) {
            this.settings
                    .setRemoteServiceRelativePath(this.serviceEntryPoint
                            .split(this.settings.getModuleBaseUrl())[1]);
        } else {
            this.logger.warning("Unable to determine base (orig: "
                    + this.settings.getModuleBaseUrl() + ") against: "
                    + this.serviceEntryPoint);
            throw new SyncProxyException(
                    determineProxyServiceBaseInterface(proxy),
                    InfoType.SERVICE_BASE_DELTA);
        }
        return null;
    } else if (ServiceDefTarget.class.getMethod("getServiceEntryPoint")
            .equals(method)) {
        return this.serviceEntryPoint;
    }
    // TODO handle all methods
    throw new MethodNotSupportedException("Method: " + method.getName()
            + " in class: " + method.getDeclaringClass().getName()
            + " not defined for class: " + proxy.getClass().getName());
}
项目:gwt-syncproxy    文件:SyncProxy.java   
/**
 * @deprecated since 0.5, {@link #createProxy(Class, ProxySettings)} with
 *             {@link ProxySettings#setRemoteServiceRelativePath(String)},
 *             {@link ProxySettings#setCookieManager(CookieManager)},
 *             {@link ProxySettings#policyName}, and
 *             {@link ProxySettings#setWaitForInvocation(boolean)}
 */
@Deprecated
@SuppressWarnings("unchecked")
public static <ServiceIntf> ServiceIntf newProxyInstance(
        Class<ServiceIntf> serviceIntf, String moduleBaseURL,
        String serverBaseUrl, String remoteServiceRelativePath,
        String policyName, CookieManager cookieManager,
        boolean waitForInvocation) {
    if (cookieManager == null) {
        cookieManager = DEFAULT_COOKIE_MANAGER;
    }

    if (policyName == null) {
        try {
            POLICY_MAP.putAll(RpcPolicyFinder
                    .fetchSerializationPolicyName(moduleBaseURL));
            policyName = POLICY_MAP.get(serviceIntf.getName());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    ServiceIntf i = (ServiceIntf) Proxy.newProxyInstance(SyncProxy.class
            .getClassLoader(), new Class[] { serviceIntf,
            ServiceDefTarget.class, HasRpcToken.class,
            SerializationStreamFactory.class },
            new RemoteServiceInvocationHandler(serverBaseUrl,
                    remoteServiceRelativePath, policyName, cookieManager,
                    waitForInvocation));
    return i;
}
项目:FreeBuilder    文件:MapTest.java   
private MapTestServiceAsync getServiceAsync() {
    if (customFieldSerializerTestService == null) {
        customFieldSerializerTestService =
                (MapTestServiceAsync) GWT.create(MapTestService.class);
        ((ServiceDefTarget) customFieldSerializerTestService)
                .setServiceEntryPoint(GWT.getModuleBaseURL() + "map");
    }
    return customFieldSerializerTestService;
}
项目:FreeBuilder    文件:NestedListTest.java   
private NestedListTestServiceAsync getServiceAsync() {
    if (customFieldSerializerTestService == null) {
        customFieldSerializerTestService =
                (NestedListTestServiceAsync) GWT.create(NestedListTestService.class);
        ((ServiceDefTarget) customFieldSerializerTestService)
                .setServiceEntryPoint(GWT.getModuleBaseURL() + "nested-list");
    }
    return customFieldSerializerTestService;
}
项目:FreeBuilder    文件:StringListTest.java   
private StringListTestServiceAsync getServiceAsync() {
    if (customFieldSerializerTestService == null) {
        customFieldSerializerTestService =
                (StringListTestServiceAsync) GWT.create(StringListTestService.class);
        ((ServiceDefTarget) customFieldSerializerTestService)
                .setServiceEntryPoint(GWT.getModuleBaseURL() + "string-list");
    }
    return customFieldSerializerTestService;
}
项目:FreeBuilder    文件:OptionalTest.java   
private OptionalTestServiceAsync getServiceAsync() {
    if (customFieldSerializerTestService == null) {
        customFieldSerializerTestService =
                (OptionalTestServiceAsync) GWT.create(OptionalTestService.class);
        ((ServiceDefTarget) customFieldSerializerTestService)
                .setServiceEntryPoint(GWT.getModuleBaseURL() + "optional");
    }
    return customFieldSerializerTestService;
}
项目:gwt-chronoscope    文件:FontRendererService.java   
public static synchronized FontRendererServiceAsync getInstance() {
  if (ourInstance == null) {
    String endpoint = Chronoscope.getFontBookServiceEndpoint();
    if (Util.isSameDomain(GWT.getHostPageBaseURL(), endpoint)) {
      ourInstance = (FontRendererServiceAsync) GWT
          .create(FontRendererService.class);
      ((ServiceDefTarget) ourInstance).setServiceEntryPoint(endpoint);
    } else {
      ourInstance = new FontRendererServiceAsyncJson(endpoint);
    }
  }
  return ourInstance;
}
项目:salasanasiilo    文件:LoginService.java   
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;
}
项目:salasanasiilo    文件:UserService.java   
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;
}
项目:salasanasiilo    文件:PasswordService.java   
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;
}
项目:gwtlib    文件:RPCTableEntryPoint.java   
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);
}
项目:onecmdb    文件:OneCMDBConnector.java   
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);    
}
项目:onecmdb    文件:ModelServiceFactory.java   
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);    
}
项目:onecmdb    文件:ContentServiceFactory.java   
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);    
}
项目:onecmdb    文件:ChangeServiceFactory.java   
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);
}
项目:firefly    文件:ServiceLocator.java   
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;
}
项目:qafe-platform    文件:MainFactoryActions.java   
public static RPCServiceAsync createService() {
    if (rpcService == null) {
        rpcService = (RPCServiceAsync) GWT.create(RPCService.class);
        ServiceDefTarget endpoint = (ServiceDefTarget) rpcService;
        String moduleRelativeURL = GWT.getModuleBaseURL() + "/rpc.service";
        endpoint.setServiceEntryPoint(moduleRelativeURL);
    }
    return rpcService;
}
项目:qafe-platform    文件:CallbackHandler.java   
final private static AsyncCallback<?> createCallBack(final String listenerType) {
    ServiceDefTarget endpoint = (ServiceDefTarget) service;
    String moduleRelativeURL = GWT.getModuleBaseURL() + "rpc.service";
    endpoint.setServiceEntryPoint(moduleRelativeURL);

    if (callback == null){
            callback = new AsyncCallback<Object>() {
            @Override
            public void onSuccess(Object result) {
                GDataObject data = (GDataObject) result;
                //this is to trigger handler registered to do on success of event body execution.
                ClientApplicationContext.getInstance().fireResult(data);
                /* Data is processed after the event firing is done.
                 * This makes it possible to get handle to newly added rows on a datagrid when the add button event on datagrid tool bar is triggered.
                 * Also enables to set a cell value when new row is added in the same event.
                 */
                processOutput(data);
                ClientApplicationContext.getInstance().setBusy(false);
            }

            @Override
            public void onFailure(Throwable caught) {
                ClientApplicationContext.getInstance().log("Event execution for " + listenerType + " failed", caught.getMessage(), true, false, caught);
                ClientApplicationContext.getInstance().setBusy(false);
                if (caught instanceof GWTServiceException) {
                    GWTServiceException gWTServiceException = (GWTServiceException) caught;
                    processOutput(gWTServiceException.getGDataObject());
                }
            }

        };
    }
    return callback;
}
项目:qafe-platform    文件:EventHandler.java   
public RPCServiceAsync getRPCService() {
    if (rpcService == null) {
        rpcService = (RPCServiceAsync) GWT.create(RPCService.class);
        final ServiceDefTarget endpoint = (ServiceDefTarget) rpcService;
        final String moduleRelativeURL = GWT.getModuleBaseURL() + "rpc.service";
        endpoint.setServiceEntryPoint(moduleRelativeURL);
    }
    return rpcService;
}
项目:qafe-platform    文件:MainFactoryActions.java   
public static RPCServiceAsync getRPCService() {
    if (rpcService == null) {
        rpcService = (RPCServiceAsync)GWT.create(RPCService.class);
        ServiceDefTarget endpoint = (ServiceDefTarget)rpcService;
        String moduleRelativeURL = GWT.getModuleBaseURL() + "/rpc.service";
        endpoint.setServiceEntryPoint(moduleRelativeURL);
    }
    return rpcService;
}
项目:qafe-platform    文件:CallbackHandler.java   
final private static AsyncCallback<?> createCallBack(final String listenerType) {
    ServiceDefTarget endpoint = (ServiceDefTarget) service;
    String moduleRelativeURL = GWT.getModuleBaseURL() + "rpc.service";
    endpoint.setServiceEntryPoint(moduleRelativeURL);

    if (callback == null){
            callback = new AsyncCallback<Object>() {
            public void onSuccess(Object result) {
                GDataObject data = (GDataObject) result;
                processOutput(data);
                //this is to trigger handler registered to do on success of event body execution.
                ClientApplicationContext.getInstance().fireResult(data);
                ClientApplicationContext.getInstance().setBusy(false);
            }

            public void onFailure(Throwable caught) {
                ClientApplicationContext.getInstance().log("Event execution for " + listenerType + " failed", caught.getMessage(), true, false, caught);
                ClientApplicationContext.getInstance().setBusy(false);
                if (caught instanceof GWTServiceException) {
                    GWTServiceException gWTServiceException = (GWTServiceException) caught;
                    processOutput(gWTServiceException.getGDataObject());
                }
            }

        };
    }
    return callback;
}
项目:gwt-sl    文件:ClientApplication.java   
TestServiceAsync getService() {
    TestServiceAsync service = (TestServiceAsync) GWT.create(TestService.class);
    ServiceDefTarget endpoint = (ServiceDefTarget) service;
    String moduleRelativeURL = GWT.getModuleBaseURL();
    moduleRelativeURL += testUrls[testIndex];
    endpoint.setServiceEntryPoint(moduleRelativeURL);
    return service;
}
项目:OneCMDBwithMaven    文件:OneCMDBConnector.java   
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);    
}
项目:OneCMDBwithMaven    文件:ModelServiceFactory.java   
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);    
}
项目:OneCMDBwithMaven    文件:ContentServiceFactory.java   
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);    
}
项目:OneCMDBwithMaven    文件:ChangeServiceFactory.java   
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);
}
项目:geofence    文件:ConfigurationRemote.java   
/**
 * Gets the instance.
 *
 * @return the instance
 */
public static ConfigurationRemoteAsync getInstance()
{
    if (instance == null)
    {
        instance = (ConfigurationRemoteAsync) GWT.create(ConfigurationRemote.class);

        ServiceDefTarget target = (ServiceDefTarget) instance;
        target.setServiceEntryPoint(GWT.getModuleBaseURL() + "ConfigurationRemote");
    }

    return instance;
}
项目:atom    文件:GwtTestATOM.java   
/**
   * 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.
    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(10000);

    // Send a request to the server.
//      atomService.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();
//          }
//      });
  }
项目:atom    文件:GwtTestATOM.java   
public void testGetListOfDomainObject() {
        // Create the service that we will test.
        AtomServiceAsync atomService = GWT.create(AtomService.class);
        ServiceDefTarget target = (ServiceDefTarget) atomService;
        target.setServiceEntryPoint(GWT.getModuleBaseURL() + "ATOM/rpc");

        delayTestFinish(Integer.MAX_VALUE);
        final int pageSize = 20;

        atomService.getListOfDomainObject(authBackDoor, domainObjectClassName, 0,
                pageSize, null, null, null, false, false,
                new AsyncCallback<DomainObjectList>() {

                    public void onSuccess(DomainObjectList result) {

                        assertNotNull(result);

                        assertEquals(domainObjectClassName,
                                result.getDomainClassName());

                        List<DomainObject> dos = result.getDomainObjects();

                        if (dos != null) {
                            assertTrue(dos.size() <= pageSize);
//                          assertTrue(dos.size() > 0);
                        }

                        finishTest();
                    }

                    public void onFailure(Throwable caught) {
                        fail("Request failure: " + caught.getMessage());
                    }
                });
    }