Package org.osgi.framework

Examples of org.osgi.framework.Bundle.loadClass()


    String adapter = config.getAttribute("adapter");
    IContributor contrib = config.getContributor();
    String pluginID = contrib.getName();
    Bundle bundle = Platform.getBundle(pluginID);
    try {
      Class interClass = bundle.loadClass(interf);
      Class adapterClass = bundle.loadClass(adapter);
      listenerAdapters.put(interClass, adapterClass);
    } catch (Exception e) {
      ParserPlugin.getLogger().error(e);
    }
View Full Code Here


    IContributor contrib = config.getContributor();
    String pluginID = contrib.getName();
    Bundle bundle = Platform.getBundle(pluginID);
    try {
      Class interClass = bundle.loadClass(interf);
      Class adapterClass = bundle.loadClass(adapter);
      listenerAdapters.put(interClass, adapterClass);
    } catch (Exception e) {
      ParserPlugin.getLogger().error(e);
    }
  }
View Full Code Here

    if (compatibility == null)
      throw new IllegalStateException();

    Class oldInternalPlatform = null;
    try {
      oldInternalPlatform = compatibility.loadClass("org.eclipse.core.internal.plugins.InternalPlatform"); //$NON-NLS-1$
      Method getPluginRegistry = oldInternalPlatform.getMethod("getPluginRegistry", null); //$NON-NLS-1$
      return (IPluginRegistry) getPluginRegistry.invoke(oldInternalPlatform, null);
    } catch (Exception e) {
      //Ignore the exceptions, return null
    }
View Full Code Here

        assertEquals("One bundle", 1, bundles.length);

        Bundle bundle = bundles[0];
        assertEquals("Bundle INSTALLED", Bundle.INSTALLED, bundle.getState());

        Class<?> clazz = bundle.loadClass(SimpleService.class.getName());
        assertNotNull("Loaded class", clazz);
        assertEquals("Bundle RESOLVED", Bundle.RESOLVED, bundle.getState());

        ExportedPackage[] exportedPackages = pa.getExportedPackages(bundle);
        assertNotNull("ExportedPackages not null", exportedPackages);
View Full Code Here

      textSelectionPossible = true;
      return null;
    }

    try {
      Class c = bundle.loadClass(TEXT_SELECTION_CLASS);
      // remember for next time
      iTextSelectionClass = c;
      return iTextSelectionClass;
    } catch (ClassNotFoundException e) {
      // unable to load ITextSelection - sounds pretty serious
View Full Code Here

            throw new IllegalStateException("Found MODULE attachment for Bundle deployment: " + depUnit);

        Class<?> testClass;
        if (osgiDep != null) {
            Bundle bundle = osgiDep.getAttachment(Bundle.class);
            testClass = bundle.loadClass(className);
            BundleAssociation.setBundle(bundle);
        } else {
            testClass = module.getClassLoader().loadClass(className);
        }
View Full Code Here

        // use reflection to try to access the plugin object
        try {
            // IPluginDescriptor pluginDesc =
            //     extension.getDeclaringPluginDescriptor();
            Class extensionClass = compatBundle.loadClass(EXTENSION_CLASS);
            Method getDescMethod = extensionClass.getDeclaredMethod(
                    GET_DESC_METHOD, new Class[0]);
            Object pluginDesc = getDescMethod.invoke(extension, new Object[0]);
            if (pluginDesc == null) {
        return null;
View Full Code Here

            // assume it might come alive later
            resourceAdapterPossible = true;
            return null;
        }
        try {
            return bundle.loadClass(className);
        } catch (ClassNotFoundException e) {
            // unable to load the class - sounds pretty serious
            // treat as if the plug-in were unavailable
            resourceAdapterPossible = false;
            return null;
View Full Code Here

            // Attempt to load the activator of the ui bundle.  This will force lazy start
            // of the ui bundle.  Using the bundle activator class here because it is a
            // class that needs to be loaded anyway so it should not cause extra classes
            // to be loaded.
          if(uiBundle != null)
            uiBundle.loadClass(UI_BUNDLE_ACTIVATOR);
        } catch (ClassNotFoundException e) {
            WorkbenchPlugin.log("Unable to load UI activator", e); //$NON-NLS-1$
        }
    /*
     * DO NOT RUN ANY OTHER CODE AFTER THIS LINE.  If you do, then you are
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  private static List<String> gwtEntryPointModules(IProject project) throws Exception {
    Bundle bundle = Platform.getBundle("com.google.gwt.eclipse.core");
    Class<?> clazz =
        bundle.loadClass("com.google.gwt.eclipse.core.properties.GWTProjectProperties");
    return (List<String>) ReflectionUtils.invokeMethod(
        clazz,
        "getEntryPointModules(org.eclipse.core.resources.IProject)",
        project);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.