Search in sources :

Example 11 with IRemoteService

use of org.eclipse.ecf.remoteservice.IRemoteService in project ecf by eclipse.

the class AbstractRemoteServiceTest method testGetService.

public void testGetService() throws Exception {
    final IRemoteService service = registerAndGetRemoteService();
    assertNotNull(service);
    Thread.sleep(SLEEPTIME);
}
Also used : IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 12 with IRemoteService

use of org.eclipse.ecf.remoteservice.IRemoteService in project ecf by eclipse.

the class AbstractRemoteServiceTest method testGetProxy.

public void testGetProxy() throws Exception {
    final IRemoteService service = registerAndGetRemoteService();
    assertNotNull(service);
    Object proxy = service.getProxy();
    assertTrue(proxy instanceof IRemoteServiceProxy);
    Thread.sleep(SLEEPTIME);
}
Also used : IRemoteServiceProxy(org.eclipse.ecf.remoteservice.IRemoteServiceProxy) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 13 with IRemoteService

use of org.eclipse.ecf.remoteservice.IRemoteService in project ecf by eclipse.

the class SimpleTest method testSimpleClientAndServerWithCallAsyncListener.

public void testSimpleClientAndServerWithCallAsyncListener() throws Exception {
    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    remoteService.callAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1), new IRemoteCallListener() {

        public void handleEvent(IRemoteCallEvent event) {
            if (event instanceof IRemoteCallCompleteEvent) {
                result = (String) ((IRemoteCallCompleteEvent) event).getResponse();
            }
        }
    });
    Thread.sleep(1000);
    assertNotNull(result);
    assertTrue(result.equals(TEST_STRING_2 + TEST_STRING_1));
}
Also used : IRemoteCallEvent(org.eclipse.ecf.remoteservice.events.IRemoteCallEvent) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService) IRemoteCallListener(org.eclipse.ecf.remoteservice.IRemoteCallListener) IRemoteCallCompleteEvent(org.eclipse.ecf.remoteservice.events.IRemoteCallCompleteEvent)

Example 14 with IRemoteService

use of org.eclipse.ecf.remoteservice.IRemoteService in project ecf by eclipse.

the class SimpleTest method testSimpleClientAndServerWithFireAsync.

public void testSimpleClientAndServerWithFireAsync() throws Exception {
    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    remoteService.fireAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1));
    Thread.sleep(1000);
}
Also used : IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 15 with IRemoteService

use of org.eclipse.ecf.remoteservice.IRemoteService in project ecf by eclipse.

the class SimpleTest method testSimpleClientAndServerWithFuture.

public void testSimpleClientAndServerWithFuture() throws Exception {
    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    IFuture future = remoteService.callAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1));
    assertNotNull(future);
    String result = (String) future.get();
    assertTrue(result.equals(TEST_STRING_2 + TEST_STRING_1));
}
Also used : IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService) IFuture(org.eclipse.equinox.concurrent.future.IFuture)

Aggregations

IRemoteService (org.eclipse.ecf.remoteservice.IRemoteService)64 ServiceReference (org.osgi.framework.ServiceReference)11 IFuture (org.eclipse.equinox.concurrent.future.IFuture)10 ECFException (org.eclipse.ecf.core.util.ECFException)9 IRemoteServiceContainerAdapter (org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter)9 IRemoteServiceReference (org.eclipse.ecf.remoteservice.IRemoteServiceReference)8 IRemoteCallListener (org.eclipse.ecf.remoteservice.IRemoteCallListener)6 IRemoteCallCompleteEvent (org.eclipse.ecf.remoteservice.events.IRemoteCallCompleteEvent)6 IRemoteCallEvent (org.eclipse.ecf.remoteservice.events.IRemoteCallEvent)6 IConcatService (org.eclipse.ecf.tests.remoteservice.IConcatService)6 Dictionary (java.util.Dictionary)5 IRemoteServiceProxy (org.eclipse.ecf.remoteservice.IRemoteServiceProxy)5 JSONObject (org.json.JSONObject)5 Hashtable (java.util.Hashtable)4 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)4 RemoteServiceTracker (org.eclipse.ecf.remoteservice.util.tracker.RemoteServiceTracker)4 IRemoteServiceRegistration (org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)3 ExecutionException (java.util.concurrent.ExecutionException)2 ExecutionException (org.eclipse.core.commands.ExecutionException)2 IContainerManager (org.eclipse.ecf.core.IContainerManager)2