Package org.osgi.framework

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


        // Get the callback-handler from the deployment descriptor
        if (appClient.getCallbackHandler() != null) {
            String cls = appClient.getCallbackHandler();
            Class<?> clas;
            try {
                clas = bundle.loadClass(cls.trim());
            }
            catch (ClassNotFoundException e) {
                throw new DeploymentException("AppClientModuleBuilder: Could not load callback-handler class: " + cls, e);
            }
            classes.add(clas);
View Full Code Here


            //Handle the role permissions and webservices on the servlets.
            Map<String, AbstractName> webServices = new HashMap<String, AbstractName>();
            Class<?> baseServletClass;
            try {
                baseServletClass = webBundle.loadClass(Servlet.class.getName());
            } catch (ClassNotFoundException e) {
                throw new DeploymentException("Could not load javax.servlet.Servlet in bundle " + bundle, e);
            }

            for (org.apache.openejb.jee.Servlet servlet : webApp.getServlet()) {
View Full Code Here

                    continue;
                }
                String servletName = servlet.getServletName();
                Class<?> servletClass;
                try {
                    servletClass = webBundle.loadClass(servletClassName);
                } catch (ClassNotFoundException e) {
                    throw new DeploymentException("Could not load servlet class " + servletClassName, e);
                }
                if (!baseServletClass.isAssignableFrom(servletClass)) {
                    //fake servletData
View Full Code Here

       
        Bundle bundle = bundleContext.getBundle();

        try {
            for (String buildeName : builders) {
                Class aClass = bundle.loadClass(buildeName.trim());
                AssertionBuilder builder = (AssertionBuilder) aClass.newInstance();
                QName[] knownElements = builder.getKnownElements();
                for (QName knownElement : knownElements) {
                    AssertionBuilderFactory.registerBuilder(knownElement, builder);
                }
View Full Code Here

            // jaas.conf location.
            System.setProperty("java.security.auth.login.config", carbonHome + File.separator + "repository"+ File.separator + "conf" + File.separator + "jaas.conf");
           
            //Registering rampart policy builders
            for (String buildeName : builders) {
                Class aClass = bundle.loadClass(buildeName.trim());
                AssertionBuilder builder = (AssertionBuilder) aClass.newInstance();
                QName[] knownElements = builder.getKnownElements();
                for (QName knownElement : knownElements) {
                    AssertionBuilderFactory.registerBuilder(knownElement, builder);
                }
View Full Code Here

            } catch (Throwable t) {
                // Check if the bundle can see the class
                try {
                    PassThroughMetadata ptm = (PassThroughMetadata) componentDefinitionRegistry.getComponentDefinition("blueprintBundle");
                    Bundle b = (Bundle) ptm.getObject();
                    if (b.loadClass(DataFormatResolver.class.getName()) != DataFormatResolver.class) {
                        throw new UnsupportedOperationException();
                    }
                    svc.setInterface(DataFormatResolver.class.getName());
                } catch (Throwable t2) {
                    throw new UnsupportedOperationException();
View Full Code Here

            } catch (Throwable t) {
                // Check if the bundle can see the class
                try {
                    PassThroughMetadata ptm = (PassThroughMetadata) componentDefinitionRegistry.getComponentDefinition("blueprintBundle");
                    Bundle b = (Bundle) ptm.getObject();
                    if (b.loadClass(LanguageResolver.class.getName()) != LanguageResolver.class) {
                        throw new UnsupportedOperationException();
                    }
                    svc.setInterface(LanguageResolver.class.getName());
                } catch (Throwable t2) {
                    throw new UnsupportedOperationException();
View Full Code Here

            } catch (Throwable t) {
                // Check if the bundle can see the class
                try {
                    PassThroughMetadata ptm = (PassThroughMetadata) componentDefinitionRegistry.getComponentDefinition("blueprintBundle");
                    Bundle b = (Bundle) ptm.getObject();
                    if (b.loadClass(ComponentResolver.class.getName()) != ComponentResolver.class) {
                        throw new UnsupportedOperationException();
                    }
                    svc.setInterface(ComponentResolver.class.getName());
                } catch (Throwable t2) {
                    throw new UnsupportedOperationException();
View Full Code Here

        public void bundleChanged(BundleEvent event) {
            Bundle b = event.getBundle();
            if (event.getType() == BundleEvent.STARTING || event.getType() == BundleEvent.LAZY_ACTIVATION) {
                if (b.getEntry("org/apache/aries/isolated/sample/SharedImpl.class") != null) {
                    try {
                        Class<?> cl = b.loadClass("org.apache.aries.isolated.sample.SharedImpl");
                        cl.newInstance();
                        loadedClass.set(true);
                    } catch (Exception e) {
                        e.printStackTrace();
                        throw new RuntimeException(e);
View Full Code Here

            System.out.println("Started "+b.getSymbolicName() + " [" + getState(b) + "]");
            // Get the Platform.getExtensionRegistry()
            if ("org.eclipse.core.runtime".equals(b.getSymbolicName())) {
                // The Platform class loaded by the bundle is different that the one
                // on the classpath
                Class<?> cls = b.loadClass("org.eclipse.core.runtime.Platform");
                Method m = cls.getMethod("getExtensionRegistry");
                Object reg = m.invoke(cls);
                System.out.println(reg);
            }
        }
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.