Search in sources :

Example 1 with RemoteServiceContainerAdapterFactory

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);
            }
        }
    });
}
Also used : RemoteServiceContainerAdapterFactory(org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceContainerAdapterFactory) RemoteServiceNamespace(org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceNamespace) Namespace(org.eclipse.ecf.core.identity.Namespace) RemoteServiceNamespace(org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceNamespace)

Example 2 with RemoteServiceContainerAdapterFactory

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);
            }
        }
    });
}
Also used : ServiceTracker(org.osgi.util.tracker.ServiceTracker) RemoteServiceContainerAdapterFactory(org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceContainerAdapterFactory)

Aggregations

RemoteServiceContainerAdapterFactory (org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceContainerAdapterFactory)2 Namespace (org.eclipse.ecf.core.identity.Namespace)1 RemoteServiceNamespace (org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceNamespace)1 ServiceTracker (org.osgi.util.tracker.ServiceTracker)1