Package org.osgi.framework

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


        BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
        Bundle bundle = EasyMock.createNiceMock(Bundle.class);
        bc.getBundle();
        EasyMock.expectLastCall().andReturn(bundle).times(2);
        bundle.loadClass(AegisElementProvider.class.getName());
        EasyMock.expectLastCall().andReturn(AegisElementProvider.class);
        bundle.loadClass(JAXBElementProvider.class.getName());
        EasyMock.expectLastCall().andReturn(JAXBElementProvider.class);
        EasyMock.replay(bc, bundle);
View Full Code Here


        Bundle bundle = EasyMock.createNiceMock(Bundle.class);
        bc.getBundle();
        EasyMock.expectLastCall().andReturn(bundle).times(2);
        bundle.loadClass(AegisElementProvider.class.getName());
        EasyMock.expectLastCall().andReturn(AegisElementProvider.class);
        bundle.loadClass(JAXBElementProvider.class.getName());
        EasyMock.expectLastCall().andReturn(JAXBElementProvider.class);
        EasyMock.replay(bc, bundle);

        Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.RS_PROVIDER_PROP_KEY,
View Full Code Here

        BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
        Bundle bundle = EasyMock.createNiceMock(Bundle.class);
        bc.getBundle();
        EasyMock.expectLastCall().andReturn(bundle).times(2);
        bundle.loadClass(AegisElementProvider.class.getName());
        EasyMock.expectLastCall().andReturn(AegisElementProvider.class);
        bundle.loadClass(JAXBElementProvider.class.getName());
        EasyMock.expectLastCall().andReturn(JAXBElementProvider.class);
        EasyMock.replay(bc, bundle);
View Full Code Here

        Bundle bundle = EasyMock.createNiceMock(Bundle.class);
        bc.getBundle();
        EasyMock.expectLastCall().andReturn(bundle).times(2);
        bundle.loadClass(AegisElementProvider.class.getName());
        EasyMock.expectLastCall().andReturn(AegisElementProvider.class);
        bundle.loadClass(JAXBElementProvider.class.getName());
        EasyMock.expectLastCall().andReturn(JAXBElementProvider.class);
        EasyMock.replay(bc, bundle);

        Map<String, Object> props = new HashMap<String, Object>();
        props.put(Constants.RS_PROVIDER_PROP_KEY, new String[] {
View Full Code Here

      if (typeClass != null) {
          interfaceClassLoader = typeClass.getClassLoader();
      } else {
        try {
          Bundle clientBundle = blueprintContainer.getBundleContext().getBundle();
          interfaceClassLoader = clientBundle.loadClass(typeName).getClassLoader();
        } catch (ClassNotFoundException cnfe) {
          throw new ComponentDefinitionException("Unable to load class " + typeName + " from recipe " + this, cnfe);
        }
      }
     
View Full Code Here

    public Class findClass(String name) throws ClassNotFoundException {
        for (Map.Entry<Long, Bundle> entry : bundles.entrySet()) {
            try {
                Bundle bundle = entry.getValue();
                if (bundle.getState() == Bundle.ACTIVE || bundle.getState() == Bundle.STARTING) {
                    return bundle.loadClass(name);
                }
            } catch (ClassNotFoundException cnfe) {
                // Try next
            }
        }
View Full Code Here

        for (Iterator<IConfigurationElement> iter = ExtensionPointList.getExtensionPointList(
                RenderExecutor.EXTENSION_ID).iterator(); iter.hasNext();) {
            IConfigurationElement elem = iter.next();
            try {
                Bundle bundle = Platform.getBundle(elem.getNamespaceIdentifier());
                Class<?> rendererClass = bundle.loadClass(elem
                        .getAttribute(RenderExecutor.RENDERER_ATTR));
                if (rendererClass.isAssignableFrom(renderer.getClass()))
                    list.add(elem);
            } catch (Exception e) {
                ProjectPlugin.log(null, e);
View Full Code Here

            Collections.sort(list, new Comparator<IConfigurationElement>() {

                public int compare(IConfigurationElement o1, IConfigurationElement o2) {
                    try {
                        Bundle bundle = Platform.getBundle(o1.getNamespaceIdentifier());
                        Class clazz1 = bundle.loadClass(o1
                                .getAttribute(RenderExecutor.RENDERER_ATTR));

                        bundle = Platform.getBundle(o2.getNamespaceIdentifier());
                        Class clazz2 = bundle.loadClass(o2
                                .getAttribute(RenderExecutor.RENDERER_ATTR));
View Full Code Here

                        Bundle bundle = Platform.getBundle(o1.getNamespaceIdentifier());
                        Class clazz1 = bundle.loadClass(o1
                                .getAttribute(RenderExecutor.RENDERER_ATTR));

                        bundle = Platform.getBundle(o2.getNamespaceIdentifier());
                        Class clazz2 = bundle.loadClass(o2
                                .getAttribute(RenderExecutor.RENDERER_ATTR));

                        int dist1 = getDistance(renderer.getClass(), clazz1);
                        int dist2 = getDistance(renderer.getClass(), clazz2);
                        if (dist1 == dist2)
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

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.