Package org.apache.xbean.osgi.bundle.util

Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader


                    log.warn("jar file {} not found in bundle: {}", urlString, bundle.toString());
                }
            }
        }

        classLoader = new BundleClassLoader(bundle, BundleResourceHelper.getSearchWiredBundles(false), BundleResourceHelper.getConvertResourceUrls(true));

        if (managedClassNames == null) {
            managedClassNames = NO_STRINGS;
        }
        if (properties == null) {
View Full Code Here


            this.classLoader = classLoader;
            this.transformers = new ArrayList<TransformerWrapper>();

            // This classloader can only be used during PersistenceProvider.createContainerEntityManagerFactory() calls
            // Possible that it could be cleaned up sooner, but for now it's destroyed when the PUGBean is stopped
            this.tempClassLoader = new TemporaryClassLoader(new BundleClassLoader(bundle,true,false));
            this.bundle = bundle;
        }
View Full Code Here

        Set<ConfigurationResource> faceletsLibraries = new HashSet<ConfigurationResource>();
        faceletsLibraries.addAll(JSF_FACELET_CONFIG_RESOURCES.get(webModule.getEarContext().getGeneralData()));
        faceletsLibraries.addAll(getContextFaceletsLibraries(webApp, webModule));
        myFacesWebAppContextData.setAttribute("faceletConfigResources", faceletsLibraries);

        ClassLoader deploymentClassLoader = new BundleClassLoader(bundle);
        ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(deploymentClassLoader);
            StandaloneExternalContext standaloneExternalContext = new StandaloneExternalContext(deploymentClassLoader);
            FacesConfigurationProviderFactory.setFacesConfigurationProviderFactory(standaloneExternalContext, new GeronimoFacesConfigurationProviderFactory(standardFacesConfig, webAppFacesConfig,
View Full Code Here

        } catch (URISyntaxException e) {
            throw new DeploymentException("Invalid wsdl URI", e);

        }

        AxisWebServiceContainer axisWebServiceContainer = new AxisWebServiceContainer(location, wsdlURI, service, serviceInfo.getWsdlMap(), new BundleClassLoader(bundle));
        AbstractName webServiceContainerFactoryName = context.getNaming().createChildName(targetGBean.getAbstractName(), "webServiceContainer", GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
        GBeanData webServiceContainerFactoryGBean = new GBeanData(webServiceContainerFactoryName, SerializableWebServiceContainerFactoryGBean.GBEAN_INFO);
        webServiceContainerFactoryGBean.setAttribute("webServiceContainer", axisWebServiceContainer);
        try {
            context.addGBean(webServiceContainerFactoryGBean);
View Full Code Here

            Callback callback = getPortMethodInterceptor();
            this.methodInterceptors = new Callback[] {NoOp.INSTANCE, callback};

            // create service class
            Enhancer enhancer = new Enhancer();
            enhancer.setClassLoader(new BundleClassLoader(bundle));
            enhancer.setSuperclass(superClass);
            enhancer.setCallbackFilter(new PortMethodFilter());
            enhancer.setCallbackTypes(new Class[] { NoOp.class, MethodInterceptor.class });
            enhancer.setUseFactory(false);
            enhancer.setUseCache(false);
View Full Code Here

                    String relative = persistenceLocation.substring(pos + rootBase.length(), endPos);
                    //find path relative to module base uri
                    relative = module.getRelativePath(relative);
                    PersistenceDocument persistenceDocument;
                    try {
                        XmlObject xmlObject = XmlBeansUtil.parse(persistenceUrl, new BundleClassLoader(moduleContext.getDeploymentBundle()));
                        persistenceDocument = convertToPersistenceDocument(xmlObject);
                    } catch (XmlException e) {
                        throw new DeploymentException("Could not parse persistence.xml file: " + persistenceUrl, e);
                    }
                    PersistenceDocument.Persistence persistence = persistenceDocument.getPersistence();
View Full Code Here

        this.abstractName = gbeanData.getAbstractName();
        this.kernel = kernel;
        this.lifecycleBroadcaster = lifecycleBroadcaster;
        this.gbeanInstanceState = new GBeanInstanceState(abstractName, kernel, dependencyManager, this, lifecycleBroadcaster);
        this.bundleContext = bundleContext;
        this.classLoader = new BundleClassLoader(bundleContext.getBundle());

        GBeanInfo gbeanInfo = gbeanData.getGBeanInfo();
        try {
            type = bundleContext.getBundle().loadClass(gbeanInfo.getClassName());
        } catch (ClassNotFoundException e) {
View Full Code Here

        addGBeanToConfiguration(configuration, gbean, start);
    }

    private void addGBeanToConfiguration(Configuration configuration, GBeanData gbean, boolean start) throws InvalidConfigException {
        ClassLoader configurationClassLoader = new BundleClassLoader(configuration.getBundle());
        ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(configurationClassLoader);

            log.trace("Registering GBean " + gbean.getAbstractName());
View Full Code Here

    }

    public ClassLoader getClassLoaderFor(ObjectName objectName) throws InstanceNotFoundException {
        AbstractName abstractName = toAbstractName(objectName);
        try {
            return new BundleClassLoader(kernel.getBundleFor(abstractName));
        } catch (GBeanNotFoundException e) {
            throw (InstanceNotFoundException)new InstanceNotFoundException(objectName.getCanonicalName()).initCause(e);
        }
    }
View Full Code Here

    private EjbJarInfo getEjbJarInfo(EARContext earContext, EjbModule ejbModule, Bundle bundle) throws DeploymentException {
        EarData earData = EarData.KEY.get(earContext.getGeneralData());
        if (earData.getEjbJars().isEmpty()) {

            ClassLoader bundleLoader = new BundleClassLoader(bundle);

            // temporary classloader is used for processing ejb annotations and byte code manipulation during ejb load
            TemporaryClassLoader temporaryClassLoader = new TemporaryClassLoader(new URL[0], bundleLoader);

            // create an openejb app module for the ear containing all ejb modules
View Full Code Here

TOP

Related Classes of org.apache.xbean.osgi.bundle.util.BundleClassLoader

Copyright © 2018 www.massapicom. 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.