Examples of BundleClassLoader


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

        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

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

        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

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

    }

    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

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

    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

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

        // ( a TCCL that is consistent with what is set when the same
        // classes are loaded when the configuration is started.
        Thread thread = Thread.currentThread();
        ClassLoader oldCl = thread.getContextClassLoader();
        //TODO OSGI fixme
        thread.setContextClassLoader( new BundleClassLoader(context.getConfiguration().getBundle()));
        try {
            try {
                configurationDatas.add(context.getConfigurationData());
            } catch (DeploymentException e) {
                Configuration configuration = context.getConfiguration();
View Full Code Here

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

                                           Bundle bundle,
                                           boolean isEJB)
            throws DeploymentException {
        Deployable deployable = module.getDeployable();
        if (deployable instanceof DeployableJarFile) {
            return discoverWebServices( ((DeployableJarFile) deployable).getJarFile(), isEJB, new BundleClassLoader(bundle));
        } else if (deployable instanceof DeployableBundle) {
            return discoverWebServices( ((DeployableBundle) deployable).getBundle(), isEJB);
        } else {
            throw new DeploymentException("Unsupported deployable: " + deployable.getClass());
        }
View Full Code Here

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

    }

    public Object getObject(AbstractName objectName) {
        ClassLoader cl = null;
        try {
            cl = new BundleClassLoader(kernel.getBundleFor(objectName));
        } catch(GBeanNotFoundException e) {
            cl = KernelManagementHelper.class.getClassLoader();
        }
        return kernel.getProxyManager().createProxy(objectName, cl);
    }
View Full Code Here

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

            } else if (type.equals(ConfigurationModuleType.WAR)) {
                result = config.findGBean(new AbstractNameQuery(WebModule.class.getName()));
            } else {
                return null;
            }
            ClassLoader classLoader = new BundleClassLoader(kernel.getBundleFor(result));
            return (J2EEDeployedObject) kernel.getProxyManager().createProxy(result, classLoader);
        } catch (GBeanNotFoundException e) {
            throw new IllegalStateException("Bad config ID: " + e.getMessage(), e);
        }
    }
View Full Code Here

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

    @Override
    public void start(BundleContext bundleContext) throws Exception {
        InputStream in = bundleContext.getBundle().getResource(ResourceConfigReader.CONFIG_FILE).openStream();
        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(new BundleClassLoader(bundleContext.getBundle()));
        ResourceConfig config;
        try {
            config = new ResourceConfigReader(new BundleClassLoader(bundleContext.getBundle())).parse(in);
        } finally {
            Thread.currentThread().setContextClassLoader(tccl);
        }

        ConfigService configService = new ConfigServiceImpl(config);
View Full Code Here

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

        // ( a TCCL that is consistent with what is set when the same
        // classes are loaded when the configuration is started.
        Thread thread = Thread.currentThread();
        ClassLoader oldCl = thread.getContextClassLoader();
        //TODO OSGI fixme
        thread.setContextClassLoader(new BundleClassLoader(context.getConfiguration().getBundle()));
        try {
            try {
                configurationDatas.add(context.getConfigurationData());
            } catch (DeploymentException e) {
                Configuration configuration = context.getConfiguration();
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.