Package org.osgi.framework

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


    private Object buildReference(Module module, String name, String type, GerResourceRefType gerResourceRef) throws DeploymentException {
        Bundle bundle = module.getEarContext().getDeploymentBundle();

        Class<?> iface;
        try {
            iface = bundle.loadClass(type);
        } catch (ClassNotFoundException e) {
            throw new DeploymentException("Could not resource-ref entry class " + type, e);
        }

        if (iface == URL.class) {
View Full Code Here


            throws DeploymentException {
        Bundle bundle = module.getEarContext().getDeploymentBundle();

        Class iface;
        try {
            iface = bundle.loadClass(type);
        } catch (ClassNotFoundException e) {
            throw new DeploymentException("Could not load resource-env-ref entry class " + type, e);
        }
        if (gerResourceEnvRef != null && gerResourceEnvRef.isSetReferenceClass()) {
            String clazz = gerResourceEnvRef.getReferenceClass();
View Full Code Here

            throws DeploymentException {
        Bundle bundle = module.getEarContext().getDeploymentBundle();

        Class iface;
        try {
            iface = bundle.loadClass(type);
        } catch (ClassNotFoundException e) {
            throw new DeploymentException("Could not load message-destination-ref entry type class " + type, e);
        }

        String moduleURI = null;
View Full Code Here

            }
        }
        ArrayList clses = new ArrayList<Class>(classNames.size());
        for (String className : classNames) {
            try {
                Class<?> cls = bundle.loadClass(className);
                //Invoke getConstructors() to force the classloader to resolve the target class
                cls.getConstructors();
                clses.add(cls);
            } catch (Throwable e) {
                String message = "Fail to load class " + className + " in GeronimoBundleClassFinder, it might not be considered while processing SOAP message due to " + e.getMessage();
View Full Code Here

        this.subject = subject;
        this.callbackHandler = callbackHandler;
        Bundle bundle = (Bundle) options.get(JaasLoginModuleUse.CLASSLOADER_LM_OPTION);
        String principalClassName = (String) options.get("principalClass");
        try {
            principalClass = (Class<Principal>) bundle.loadClass(principalClassName);
        } catch (ClassNotFoundException e) {
            throw new IllegalArgumentException(principalClassName + " not found", e);
        }
        String allNames = (String) options.get("principalNames");
        allowedNames = Arrays.asList(allNames.split(","));
View Full Code Here

        // Get the main class from the module
        String mainClass = appClientModule.getMainClassName();
        Class<?> mainClas;
        try {
            mainClas = bundle.loadClass(mainClass);
        }
        catch (ClassNotFoundException e) {
            throw new DeploymentException("AppClientModuleBuilder: Could not load main class: " + mainClass, e);
        }
        while (mainClas != null && mainClas != Object.class) {
View Full Code Here

        // 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

                        value = new KernelReference();
                    }
                } else {
                    Class<?> typeClass;
                    try {
                        typeClass = bundle.loadClass(type);
                    } catch (ClassNotFoundException e) {
                        throw new DeploymentException("Could not env-entry type class " + type, e);
                    }
                    try {
                        if (String.class.equals(typeClass)) {
View Full Code Here

            if (servletContainerInitializerClassNamesMap != null) {
                for (Map.Entry<String, Set<String>> entry : servletContainerInitializerClassNamesMap.entrySet()) {
                    String servletContainerInitializerClassName = entry.getKey();
                    Set<String> classNames = entry.getValue();
                    try {
                        ServletContainerInitializer servletContainerInitializer = (ServletContainerInitializer) bundle.loadClass(servletContainerInitializerClassName).newInstance();
                        if (classNames == null || classNames.size() == 0) {
                            addServletContainerInitializer(servletContainerInitializer, null);
                        } else {
                            Set<Class<?>> classSet = new HashSet<Class<?>>();
                            for (String cls : classNames) {
View Full Code Here

                            addServletContainerInitializer(servletContainerInitializer, null);
                        } else {
                            Set<Class<?>> classSet = new HashSet<Class<?>>();
                            for (String cls : classNames) {
                                try {
                                    classSet.add(bundle.loadClass(cls));
                                } catch (ClassNotFoundException e) {
                                    getLogger().warn("Fail to load class " + cls + " interested by ServletContainerInitializer " + servletContainerInitializerClassName, e);
                                }
                            }
                            addServletContainerInitializer(servletContainerInitializer, classSet);
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.