Package org.osgi.framework

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


            for (org.apache.openejb.jee.Servlet servlet : webApp.getServlet()) {
                if (servlet.getServletClass() == null || servlet.getServletClass().isEmpty()) {
                    continue;
                }
                String servletClassName = servlet.getServletClass();
                Class<?> cls = bundle.loadClass(servletClassName);
                if (!Servlet.class.isAssignableFrom(cls)) {
                    continue;
                }
                ServletSecurity servletSecurity = cls.getAnnotation(ServletSecurity.class);
                if (servletSecurity == null) {
View Full Code Here


        for (EnterpriseBeanInfo bean : ejbModule.getEjbJarInfo().enterpriseBeans) {
            if (bean.type != EnterpriseBeanInfo.STATELESS && bean.type != EnterpriseBeanInfo.SINGLETON) {
                continue;
            }
            try {
                Class<?> ejbClass = bundle.loadClass(bean.ejbClass);
                if (JAXWSUtils.isWebService(ejbClass)) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Found EJB Web Service: " + bean.ejbName);
                    }
                    PortInfo portInfo = new PortInfo();
View Full Code Here

            for (Servlet servletType : servletTypes) {
                String servletName = servletType.getServletName().trim();
                if (servletType.getServletClass() != null) {
                    String servletClassName = servletType.getServletClass().trim();
                    try {
                        Class<?> servletClass = bundle.loadClass(servletClassName);
                        if (JAXWSUtils.isWebService(servletClass)) {
                            if (LOG.isDebugEnabled()) {
                                LOG.debug("Found POJO Web Service: " + servletName);
                            }
                            PortInfo portInfo = new PortInfo();
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

         final Bundle bundle = ref.get();
         // ISPN-4679 may get a null handle from the weak refrence
         if(bundle == null) continue;
         if (bundle.getState() == Bundle.ACTIVE) {
            try {
               final Class clazz = bundle.loadClass(name);
               if (clazz != null) {
                  classCache.put(name, clazz);
                  return clazz;
               }
            } catch (Exception ignore) {
View Full Code Here

      for (WeakReference<Bundle> ref : bundles) {
         final Bundle bundle = ref.get();
         if (bundle.getState() == Bundle.ACTIVE) {
            try {
               final Class clazz = bundle.loadClass(name);
               if (clazz != null) {
                  classCache.put(name, clazz);
                  return clazz;
               }
            } catch (Exception ignore) {
View Full Code Here

                        } catch (Throwable t) {
                            // Check if the bundle can see the class
                            try {
                                PassThroughMetadata ptm = (PassThroughMetadata) context.getComponentDefinitionRegistry().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

                        } catch (Throwable t) {
                            // Check if the bundle can see the class
                            try {
                                PassThroughMetadata ptm = (PassThroughMetadata) context.getComponentDefinitionRegistry().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) context.getComponentDefinitionRegistry().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

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.