Search in sources :

Example 16 with IRemoteServiceReference

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

the class RpcRemoteServiceAdapterTest method testGetRemoteServiceReference.

public void testGetRemoteServiceReference() {
    IRemoteServiceRegistration registration = createRpcRegistration(RpcConstants.TEST_ECHO_METHOD);
    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 17 with IRemoteServiceReference

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

the class AbstractConcatConsumerTestCase method testGetRemoteServiceIDs.

public void testGetRemoteServiceIDs() throws Exception {
    final IRemoteServiceReference[] refs = getRemoteServiceReferences(targetID, getRemoteServiceClass().getName(), getRemoteServiceFilter());
    assertTrue(refs != null);
    assertTrue(refs.length > 0);
    for (int i = 0; i < refs.length; i++) {
        IRemoteServiceID rsid = refs[i].getID();
        assertNotNull(rsid);
    }
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IRemoteServiceID(org.eclipse.ecf.remoteservice.IRemoteServiceID)

Example 18 with IRemoteServiceReference

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

the class AbstractConcatConsumerTestCase method testGetRemoteServiceWithLocallyRegisteredService.

public void testGetRemoteServiceWithLocallyRegisteredService() throws Exception {
    String classname = getRemoteServiceClass().getName();
    // Register service locally
    registerLocalService(classname, createRemoteService(), createRemoteServiceProperties());
    // Now get remote service
    final IRemoteService service = getRemoteService(targetID, getRemoteServiceClass().getName(), getRemoteServiceFilter());
    assertNotNull(service);
    // Now get both
    IRemoteServiceReference[] references = getRemoteServiceReferences(new ID[] { rsContainer.getContainer().getID(), targetID }, classname, getRemoteServiceFilter());
    assertNotNull(references);
    assertTrue(references.length == 2);
    Thread.sleep(ASYNC_WAITTIME);
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 19 with IRemoteServiceReference

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

the class AbstractConcatConsumerTestCase method testGetRemoteServiceReferenceServiceID.

public void testGetRemoteServiceReferenceServiceID() throws Exception {
    final IRemoteServiceReference[] refs = getRemoteServiceReferences(targetID, getRemoteServiceClass().getName(), getRemoteServiceFilter());
    assertTrue(refs != null);
    assertTrue(refs.length > 0);
    for (int i = 0; i < refs.length; i++) {
        IRemoteServiceID rsid = refs[i].getID();
        Long sid = (Long) refs[i].getProperty(org.eclipse.ecf.remoteservice.Constants.SERVICE_ID);
        assertNotNull(sid);
        assertTrue(sid.longValue() > -1);
        assertTrue(sid.longValue() == rsid.getContainerRelativeID());
    }
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IRemoteServiceID(org.eclipse.ecf.remoteservice.IRemoteServiceID)

Example 20 with IRemoteServiceReference

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

the class AbstractLocalRemoteServiceTest method testGetAllLocalRemoteServiceReference.

public void testGetAllLocalRemoteServiceReference() 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(null, 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