use of org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter in project ecf by eclipse.
the class RemoteServiceHandlerUtil method getActiveIRemoteServiceReferencesChecked.
public static IRemoteServiceReference[] getActiveIRemoteServiceReferencesChecked(ExecutionEvent event) throws ExecutionException {
final IServiceInfo serviceInfo = DiscoveryHandlerUtil.getActiveIServiceInfoChecked(event);
final IRemoteServiceContainerAdapter adapter = getActiveIRemoteServiceContainerAdapterChecked(event);
try {
return getRemoteServiceReferencesForRemoteServiceAdapter(adapter, serviceInfo);
} catch (IDCreateException e) {
throw new ExecutionException(e.getMessage(), e);
} catch (InvalidSyntaxException e) {
throw new ExecutionException(e.getMessage(), e);
}
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter in project ecf by eclipse.
the class AbstractRemoteServiceTest method testGetServiceReferencesWithFilterFail.
public void testGetServiceReferencesWithFilterFail() throws Exception {
final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters();
final Properties props = new Properties();
props.put("foo", "bar");
props.put("foo1", "bar");
registerService(adapters[0], IConcatService.class.getName(), createService(), customizeProperties(props), SLEEPTIME);
// Create dictionary that is *not* the same as props, so the filter
// should miss
final Properties missProps = new Properties();
missProps.put("bar", "foo");
final String missFilter = getFilterFromServiceProperties(missProps);
final IRemoteServiceReference[] refs = getRemoteServiceReferences(adapters[1], getConnectTargetID(), getIDFilter(), IConcatService.class.getName(), missFilter);
assertTrue(refs == null);
Thread.sleep(SLEEPTIME);
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter 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);
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter in project ecf by eclipse.
the class AbstractRemoteServiceTest method testGetProxyNoRemoteServiceProxy.
public void testGetProxyNoRemoteServiceProxy() throws Exception {
final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters();
Properties props = new Properties();
props.put(Constants.SERVICE_PREVENT_RSPROXY, "true");
final IRemoteService service = registerAndGetRemoteService(adapters[0], adapters[1], getClient(0).getConnectedID(), getIDFilter(), IConcatService.class.getName(), customizeProperties(props), SLEEPTIME);
assertNotNull(service);
Object proxy = service.getProxy();
assertTrue(!(proxy instanceof IRemoteServiceProxy));
Thread.sleep(SLEEPTIME);
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter in project ecf by eclipse.
the class AbstractRemoteServiceTest method testRemoteServiceNamespace.
public void testRemoteServiceNamespace() throws Exception {
final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters();
assertNotNull(adapters);
for (int i = 0; i < adapters.length; i++) {
Namespace namespace = adapters[i].getRemoteServiceNamespace();
assertNotNull(namespace);
}
Thread.sleep(SLEEPTIME);
}
Aggregations