Search in sources :

Example 1 with IRemoteServiceRegistration

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

the class RestContainerTest method testRegisterRestService.

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);
}
Also used : IRemoteCallable(org.eclipse.ecf.remoteservice.client.IRemoteCallable) Dictionary(java.util.Dictionary) Hashtable(java.util.Hashtable) HttpGetRequestType(org.eclipse.ecf.remoteservice.rest.client.HttpGetRequestType) IContainer(org.eclipse.ecf.core.IContainer) IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)

Example 2 with IRemoteServiceRegistration

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

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

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

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

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