Search in sources :

Example 11 with IRemoteServiceRegistration

use of org.eclipse.ecf.remoteservice.IRemoteServiceRegistration 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 12 with IRemoteServiceRegistration

use of org.eclipse.ecf.remoteservice.IRemoteServiceRegistration 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)

Example 13 with IRemoteServiceRegistration

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

the class AbstractRemoteServiceTest method testUnregisterService.

public void testUnregisterService() throws Exception {
    final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters();
    // adapter [0] is the service 'server'
    final IRemoteServiceRegistration reg = registerService(adapters[0], IConcatService.class.getName(), createService(), customizeProperties(null), SLEEPTIME);
    assertNotNull(reg);
    assertNotNull(reg.getContainerID());
    reg.unregister();
    Thread.sleep(SLEEPTIME);
}
Also used : IRemoteServiceContainerAdapter(org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter) IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)

Example 14 with IRemoteServiceRegistration

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

the class AbstractRemoteServiceTest method registerService.

protected IRemoteServiceRegistration registerService(IRemoteServiceContainerAdapter adapter, String serviceInterface, Object service, Dictionary serviceProperties, int sleepTime) {
    final IRemoteServiceRegistration result = adapter.registerRemoteService(new String[] { serviceInterface }, service, serviceProperties);
    sleep(sleepTime);
    return result;
}
Also used : IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)

Example 15 with IRemoteServiceRegistration

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

the class RestRemoteServiceAdapterTest method testGetRemoteServiceID.

public void testGetRemoteServiceID() {
    IRemoteServiceRegistration registration = createRestRegistration("resourcePath");
    long containerRelativeID = registration.getID().getContainerRelativeID();
    IRemoteServiceID remoteServiceID = getRemoteServiceClientContainerAdapter().getRemoteServiceID(container.getID(), containerRelativeID);
    assertEquals(registration.getID(), remoteServiceID);
}
Also used : IRemoteServiceID(org.eclipse.ecf.remoteservice.IRemoteServiceID) IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)

Aggregations

IRemoteServiceRegistration (org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)18 IRemoteServiceReference (org.eclipse.ecf.remoteservice.IRemoteServiceReference)8 IRemoteServiceContainerAdapter (org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter)3 IRemoteServiceID (org.eclipse.ecf.remoteservice.IRemoteServiceID)3 Dictionary (java.util.Dictionary)2 IRemoteService (org.eclipse.ecf.remoteservice.IRemoteService)2 Hashtable (java.util.Hashtable)1 TreeMap (java.util.TreeMap)1 IContainer (org.eclipse.ecf.core.IContainer)1 IExtendedRemoteServiceRegistration (org.eclipse.ecf.remoteservice.IExtendedRemoteServiceRegistration)1 IOSGiRemoteServiceContainerAdapter (org.eclipse.ecf.remoteservice.IOSGiRemoteServiceContainerAdapter)1 IRemoteCallable (org.eclipse.ecf.remoteservice.client.IRemoteCallable)1 HttpGetRequestType (org.eclipse.ecf.remoteservice.rest.client.HttpGetRequestType)1