use of org.eclipse.ecf.core.ContainerTypeDescription in project ecf by eclipse.
the class RestContainerTest method testCreateContainer3.
public void testCreateContainer3() throws Exception {
ContainerTypeDescription description = getContainerFactory().getDescriptionByName(RestConstants.REST_CONTAINER_TYPE);
IContainer container = getContainerFactory().createContainer(description, new Object[] { new URI(RestConstants.TEST_DE_TARGET) });
assertNotNull(container);
assertTrue(container instanceof RestClientContainer);
}
use of org.eclipse.ecf.core.ContainerTypeDescription in project ecf by eclipse.
the class RestContainerTest method testCreateContainer2.
public void testCreateContainer2() throws Exception {
ContainerTypeDescription description = getContainerFactory().getDescriptionByName(RestConstants.REST_CONTAINER_TYPE);
IContainer container = getContainerFactory().createContainer(description, new Object[] { new URL(RestConstants.TEST_DE_TARGET) });
assertNotNull(container);
assertTrue(container instanceof RestClientContainer);
}
use of org.eclipse.ecf.core.ContainerTypeDescription in project ecf by eclipse.
the class RpcContainerTest method testCreateContainer3.
public void testCreateContainer3() throws Exception {
ContainerTypeDescription description = getContainerFactory().getDescriptionByName(RpcConstants.RPC_CONTAINER_TYPE);
IContainer container = getContainerFactory().createContainer(description, new Object[] { new URI(RpcConstants.TEST_ECHO_TARGET) });
assertNotNull(container);
assertTrue(container instanceof RpcClientContainer);
}
use of org.eclipse.ecf.core.ContainerTypeDescription in project ecf by eclipse.
the class Activator method start.
/**
* Called when the OSGi framework starts the bundle.
*
* @param bc
* the bundle context.
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(final BundleContext bc) throws Exception {
this.context = bc;
r_osgi_tracker = new ServiceTracker(context, RemoteOSGiService.class.getName(), null);
r_osgi_tracker.open();
// bug 495535
if (DELETE_PROXY_BUNDLES_ON_INIT)
deleteProxyBundles();
SafeRunner.run(new ExtensionRegistryRunnable(bc) {
protected void runWithoutRegistry() throws Exception {
bc.registerService(Namespace.class, new R_OSGiNamespace(), null);
bc.registerService(Namespace.class, new R_OSGiWSNamespace(), null);
bc.registerService(Namespace.class, new R_OSGiWSSNamespace(), null);
bc.registerService(Namespace.class, new R_OSGiRemoteServiceNamespace(), null);
// $NON-NLS-1$
bc.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(R_OSGiContainerInstantiator.NAME, new R_OSGiContainerInstantiator(), "R_OSGi Container", true, false), null);
// $NON-NLS-1$
bc.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(R_OSGiContainerInstantiator.NAME_HTTP, new R_OSGiContainerInstantiator(), "R_OSGi Websockets Container", true, false), null);
// $NON-NLS-1$
bc.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(R_OSGiContainerInstantiator.NAME_HTTPS, new R_OSGiContainerInstantiator(), "R_OSGi Secure Websockets Container", true, false), null);
}
});
}
use of org.eclipse.ecf.core.ContainerTypeDescription in project ecf by eclipse.
the class AbstractRemoteServiceRegisterTest method getServerContainerAdapter.
private IRemoteServiceContainerAdapter getServerContainerAdapter() {
if (this.server != null)
return (IRemoteServiceContainerAdapter) this.server.getAdapter(IRemoteServiceContainerAdapter.class);
IContainer[] containers = getContainerManager().getAllContainers();
String containerType = getServerContainerTypeName();
for (int i = 0; i < containers.length; i++) {
ContainerTypeDescription ctd = getContainerManager().getContainerTypeDescription(containers[i].getID());
if (ctd != null && ctd.getName().equals(containerType))
return (IRemoteServiceContainerAdapter) containers[i].getAdapter(IRemoteServiceContainerAdapter.class);
}
return null;
}
Aggregations