Package org.eclipse.ecf.internal.osgi.services.remoteserviceadmin

Examples of org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.Activator


        endpointDescription);
  }

  private BundleContext getProxyServiceFactoryContext(
      EndpointDescription endpointDescription) throws Exception {
    Activator a = Activator.getDefault();
    if (a == null)
      throw new NullPointerException(
          "ECF RemoteServiceAdmin Activator cannot be null."); //$NON-NLS-1$
    if (a.isOldEquinox()) {
      // In this case, we get the Bundle that exposes the first service
      // interface class
      BundleContext rsaContext = Activator.getContext();
      if (rsaContext == null)
        throw new NullPointerException(
            "RSA BundleContext cannot be null"); //$NON-NLS-1$
      List<String> interfaces = endpointDescription.getInterfaces();
      Collection<Class> serviceInterfaceClasses = loadServiceInterfacesViaBundle(
          rsaContext.getBundle(),
          interfaces.toArray(new String[interfaces.size()]));
      if (serviceInterfaceClasses.size() == 0)
        throw new NullPointerException(
            "No interface classes loadable for endpointDescription=" //$NON-NLS-1$
                + endpointDescription);
      // Get the bundle responsible for the first service interface class
      Class serviceInterfaceClass = serviceInterfaceClasses.iterator()
          .next();
      Bundle bundle = FrameworkUtil.getBundle(serviceInterfaceClass);
      if (bundle == null)
        throw new BundleException("Bundle for service interface class=" //$NON-NLS-1$
            + serviceInterfaceClass.getName() + " cannot be found"); //$NON-NLS-1$
      int bundleState = bundle.getState();
      BundleContext bundleContext = bundle.getBundleContext();
      if (bundleContext == null)
        throw new BundleException("Bundle=" + bundle.getSymbolicName() //$NON-NLS-1$
            + " in wrong state (" + bundleState //$NON-NLS-1$
            + ") for using BundleContext proxy service factory"); //$NON-NLS-1$
      return bundleContext;
    }
    return a.getProxyServiceFactoryBundleContext();
  }
View Full Code Here


  protected BundleContext getContext() {
    return context;
  }

  protected String getFrameworkUUID() {
    Activator a = Activator.getDefault();
    if (a == null)
      return null;
    return a.getFrameworkUUID();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.Activator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.