Package org.eclipse.ecf.remoteservice.client

Examples of org.eclipse.ecf.remoteservice.client.IRemoteCallable


  public void connect(ID targetID, IConnectContext connectContext1)
      throws ContainerConnectException {
    super.connect(targetID, connectContext1);
    // Create the IRemoteCallable to represent
    // access to the ITimeService method. 
    IRemoteCallable callable = RestCallableFactory.createCallable(
        "getCurrentTime", ITimeService.class.getName(), null,
        new HttpGetRequestType(), 30000);
    // Register the callable and associate it with the ITimeService class
    // name
    reg = registerCallables(new String[] { ITimeService.class.getName() },
View Full Code Here


    adapter.setResponseDeserializer(createRestResource());

    // Create and register callable to register service
    IRemoteCallParameter [] parameters1 = RemoteCallParameterFactory.createParameters("count",null);
    // Setup callable
    IRemoteCallable callable1 = RestCallableFactory.createCallable("getUserStatuses","/statuses/user_timeline.json",parameters1);
   
   
    IRemoteCallParameter [] parameters2 = RemoteCallParameterFactory.createParameters("body",null);
    HttpPostRequestType requestType2 = new HttpPostRequestType(HttpPostRequestType.STRING_REQUEST_ENTITY);
    IRemoteCallable callable2 = RestCallableFactory.createCallable("postMethodString","/statuses/user_timeline.json",parameters2,requestType2);

    IRemoteCallParameter [] parameters3 = RemoteCallParameterFactory.createParameters("body",null);
    HttpPostRequestType requestType3 = new HttpPostRequestType(HttpPostRequestType.INPUT_STREAM_REQUEST_ENTITY);
    IRemoteCallable callable3 = RestCallableFactory.createCallable("postMethodInputStream","/statuses/user_timeline.json",parameters3,requestType3);

    IRemoteCallParameter [] parameters4 = RemoteCallParameterFactory.createParameters("body",null);
    HttpPostRequestType requestType4 = new HttpPostRequestType(HttpPostRequestType.BYTEARRAY_REQUEST_ENTITY);
    IRemoteCallable callable4 = RestCallableFactory.createCallable("postMethodByteArray","/statuses/user_timeline.json",parameters4,requestType4);

    registration = adapter.registerCallables(new String[] { IUserTimeline.class.getName() }, new IRemoteCallable[][] { { callable1, callable2, callable3, callable4 } }, null);
}
View Full Code Here

  IRemoteServiceClientContainerAdapter getRemoteServiceClientContainerAdapter() {
    return super.getRemoteServiceClientContainerAdapter(container);
  }
 
  IRemoteServiceRegistration createRestRegistration(String resourcePath) {
    IRemoteCallable callable = RestCallableFactory.createCallable(resourcePath,resourcePath);
    return registerCallable(container, callable, null);
  }
View Full Code Here

  public void testRegisterRestService() throws Exception {
    IContainer container = createRestContainer(RestConstants.TEST_DE_TARGET);
    Dictionary properties = new Hashtable();
    properties.put("user", "null");
    IRemoteCallable callable = RestCallableFactory.createCallable("methodName","resourcePath",null,new HttpGetRequestType());
    IRemoteServiceRegistration registration = registerCallable(container, callable, properties);
    assertNotNull(registration);
  }
View Full Code Here

          throws NotSerializableException {
        return null;
      }});

    // Create callable and register
    IRemoteCallable callable = RestCallableFactory.createCallable(method,resourcePath,
        new IRemoteCallParameter[] { new RemoteCallParameter("body")} ,
        new HttpPutRequestType(HttpPutRequestType.STRING_REQUEST_ENTITY,"application/xml",-1,"UTF-8"));
    // register callable
    registration = adapter.registerCallables(new IRemoteCallable[] { callable } , null);
   
View Full Code Here

  IContainer container;
  IRemoteServiceRegistration registration;
 
  protected void setUp() throws Exception {
    container = createRestContainer(RestConstants.TEST_TWITTER_TARGET);
    IRemoteCallable callable = RestCallableFactory.createCallable(RestConstants.TEST_TWITTER_RESOURCEPATH);
    registration = registerCallable(container, callable, null);
  }
View Full Code Here

  protected void setUp() throws Exception {
    container = createRestContainer(RestConstants.TEST_TWITTER_TARGET);
    Dictionary properties = new Hashtable();
    properties.put("user", "null");
    IRemoteCallable callable = RestCallableFactory.createCallable("resourcePath");
    registration = registerCallable(container, callable, properties);
  }
View Full Code Here

  IRemoteServiceRegistration registrationCalc;
 
  protected void setUp() throws Exception {
    container = createRpcContainer(RpcConstants.TEST_ECHO_TARGET);
   
    IRemoteCallable callableEcho = RemoteCallableFactory.createCallable(RpcConstants.TEST_ECHO_METHOD_NAME, RpcConstants.TEST_ECHO_METHOD,
        new IRemoteCallParameter[]{new RemoteCallParameter(RpcConstants.TEST_ECHO_METHOD_PARAM)});
    registrationEcho = registerCallable(container, callableEcho, null);
   
    IRemoteCallable callableEchoProxy = RemoteCallableFactory.createCallable(IEcho.class.getName());
    registrationEchoProxy = registerCallable(container, callableEchoProxy, null);
   
    IRemoteCallable callableCalc = RemoteCallableFactory.createCallable(RpcConstants.TEST_CALC_PLUS_METHOD_NAME, RpcConstants.TEST_CALC_PLUS_METHOD,
        new IRemoteCallParameter[]{
          new RemoteCallParameter(RpcConstants.TEST_CALC_PLUS_METHOD_PARAM1),
          new RemoteCallParameter(RpcConstants.TEST_CALC_PLUS_METHOD_PARAM2)});
    registrationCalc = registerCallable(container, callableCalc, null);
  }
View Full Code Here

  IRemoteServiceClientContainerAdapter getRemoteServiceClientContainerAdapter() {
    return super.getRemoteServiceClientContainerAdapter(container);
  }
 
  IRemoteServiceRegistration createRpcRegistration(String method) {
    IRemoteCallable callable = RemoteCallableFactory.createCallable(method);   
    return registerCallable(container, callable, null);
  }
View Full Code Here

        System.out.println("async called...");
    }

    private IRemoteServiceRegistration registerCall()
    {
        IRemoteCallable callable = RestCallableFactory.createCallable(RSS_PATH, RSS_PATH, null,
                new HttpGetRequestType());

        registration = registerCallable(callable, null);

        return registration;
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.remoteservice.client.IRemoteCallable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.