Search in sources :

Example 1 with IRemoteServiceReference

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

the class RestRemoteServiceAdapterTest method testGetRemoteServiceReference.

public void testGetRemoteServiceReference() {
    IRemoteServiceRegistration registration = createRestRegistration("resourcePath");
    IRemoteServiceReference remoteServiceReference = getRemoteServiceClientContainerAdapter().getRemoteServiceReference(registration.getID());
    assertEquals(registration.getReference(), remoteServiceReference);
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)

Example 2 with IRemoteServiceReference

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

the class RestRemoteServiceAdapterTest method testUngetRemoteService.

public void testUngetRemoteService() {
    IRemoteServiceRegistration registration = createRestRegistration("resourcePath");
    IRemoteServiceReference reference = registration.getReference();
    getRemoteServiceClientContainerAdapter().getRemoteService(reference);
    assertTrue(getRemoteServiceClientContainerAdapter().ungetRemoteService(reference));
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)

Example 3 with IRemoteServiceReference

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

the class RpcRemoteServiceAdapterTest method testGetRemoteService.

public void testGetRemoteService() {
    IRemoteServiceRegistration registration = createRpcRegistration(RpcConstants.TEST_ECHO_METHOD);
    IRemoteServiceReference reference = registration.getReference();
    assertNotNull(reference);
    IRemoteService remoteService = getRemoteServiceClientContainerAdapter().getRemoteService(reference);
    assertNotNull(remoteService);
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 4 with IRemoteServiceReference

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

the class AbstractConcatConsumerTestCase method testGetRemoteServiceReferenceObjectClass.

public void testGetRemoteServiceReferenceObjectClass() throws Exception {
    String className = getRemoteServiceClass().getName();
    final IRemoteServiceReference[] refs = getRemoteServiceReferences(targetID, className, getRemoteServiceFilter());
    assertTrue(refs != null);
    assertTrue(refs.length > 0);
    for (int i = 0; i < refs.length; i++) {
        String[] intfClasses = (String[]) refs[i].getProperty(org.eclipse.ecf.remoteservice.Constants.OBJECTCLASS);
        List classNames = Arrays.asList(intfClasses);
        assertTrue(classNames.contains(className));
    }
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) List(java.util.List)

Example 5 with IRemoteServiceReference

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

the class AbstractLocalRemoteServiceTest method testGetLocalRemoteServiceReferences.

public void testGetLocalRemoteServiceReferences() throws Exception {
    // First register some service locally
    IRemoteServiceRegistration registration = containerAdapter.registerRemoteService(new String[] { IConcatService.class.getName() }, createConcatService(), null);
    // Now lookup all references
    IRemoteServiceReference[] allRefs = containerAdapter.getAllRemoteServiceReferences(IConcatService.class.getName(), null);
    assertNotNull(allRefs);
    assertTrue(allRefs.length == 1);
    // Unregister
    registration.unregister();
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)

Aggregations

IRemoteServiceReference (org.eclipse.ecf.remoteservice.IRemoteServiceReference)28 IRemoteServiceContainerAdapter (org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter)16 IConcatService (org.eclipse.ecf.tests.remoteservice.IConcatService)10 IRemoteService (org.eclipse.ecf.remoteservice.IRemoteService)8 IRemoteServiceRegistration (org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)8 IRemoteServiceListener (org.eclipse.ecf.remoteservice.IRemoteServiceListener)6 IRemoteServiceEvent (org.eclipse.ecf.remoteservice.events.IRemoteServiceEvent)6 IRemoteServiceRegisteredEvent (org.eclipse.ecf.remoteservice.events.IRemoteServiceRegisteredEvent)6 IFuture (org.eclipse.equinox.concurrent.future.IFuture)6 ID (org.eclipse.ecf.core.identity.ID)4 IRemoteServiceID (org.eclipse.ecf.remoteservice.IRemoteServiceID)3 Dictionary (java.util.Dictionary)2 Hashtable (java.util.Hashtable)2 Properties (java.util.Properties)2 ContainerCreateException (org.eclipse.ecf.core.ContainerCreateException)2 IContainer (org.eclipse.ecf.core.IContainer)2 IRemoteServiceContainer (org.eclipse.ecf.remoteservice.IRemoteServiceContainer)2 IRemoteServiceProxy (org.eclipse.ecf.remoteservice.IRemoteServiceProxy)2 RemoteServiceContainer (org.eclipse.ecf.remoteservice.RemoteServiceContainer)2 RemoteServiceTracker (org.eclipse.ecf.remoteservice.util.tracker.RemoteServiceTracker)2