use of org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceContainerAdapterFactory in project ecf by eclipse.
the class Activator method start.
public void start(final BundleContext ctxt) throws Exception {
this.context = ctxt;
SafeRunner.run(new ExtensionRegistryRunnable(this.context) {
protected void runWithoutRegistry() throws Exception {
// $NON-NLS-1$
ctxt.registerService(Namespace.class, new RemoteServiceNamespace(org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceNamespace.NAME, "Generic remote service namespace"), null);
IAdapterManager am = getAdapterManager(ctxt);
if (am != null) {
rscAdapterFactories = new ArrayList();
IAdapterFactory af = new RemoteServiceContainerAdapterFactory();
am.registerAdapters(af, org.eclipse.ecf.provider.generic.SSLServerSOContainer.class);
rscAdapterFactories.add(af);
af = new RemoteServiceContainerAdapterFactory();
am.registerAdapters(af, org.eclipse.ecf.provider.generic.TCPServerSOContainer.class);
rscAdapterFactories.add(af);
af = new RemoteServiceContainerAdapterFactory();
am.registerAdapters(af, org.eclipse.ecf.provider.generic.SSLClientSOContainer.class);
rscAdapterFactories.add(af);
af = new RemoteServiceContainerAdapterFactory();
am.registerAdapters(af, org.eclipse.ecf.provider.generic.TCPClientSOContainer.class);
rscAdapterFactories.add(af);
}
}
});
}
use of org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceContainerAdapterFactory in project ecf by eclipse.
the class Activator method start.
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext ctxt) throws Exception {
this.context = ctxt;
plugin = this;
this.discoveryTracker = new ServiceTracker(ctxt, IDiscoveryAdvertiser.class.getName(), null);
this.discoveryTracker.open();
try {
// for backward compatibility
serverManager = new ServerManager();
} catch (Throwable t) {
t.printStackTrace();
}
// Register generic server container group factory service
this.gscgFactory = new GenericServerContainerGroupFactory();
this.gscgRegistration = this.context.registerService(IGenericServerContainerGroupFactory.class.getName(), gscgFactory, null);
SafeRunner.run(new ExtensionRegistryRunnable(this.context) {
protected void runWithoutRegistry() throws Exception {
AdapterManagerTracker t = new AdapterManagerTracker(getContext());
t.open();
IAdapterManager am = t.getAdapterManager();
t.close();
if (am != null) {
am.registerAdapters(new RemoteServiceContainerAdapterFactory(), org.eclipse.ecf.server.generic.GenericServerContainer.class);
am.registerAdapters(new RemoteServiceContainerAdapterFactory(), org.eclipse.ecf.server.generic.SSLGenericServerContainer.class);
}
}
});
}
Aggregations