Package org.apache.xbean.kernel

Examples of org.apache.xbean.kernel.ServiceFactory


    }
   
    public ClassLoader getConfigurationClassLoader() {
        if (classLoader == null && kernel != null && configuration != null) {
            try {
                ServiceFactory sf = kernel.getServiceFactory(configuration);
                classLoader = sf.getClassLoader();
            } catch (ServiceNotFoundException e) {
                // This should never happen
            }
        }
        ClassLoader cl = classLoader;
View Full Code Here


    }
   
    public ClassLoader getConfigurationClassLoader() throws ServiceNotFoundException {
        ClassLoader cl = null;
        if (kernel != null) {
            ServiceFactory sf = kernel.getServiceFactory(configuration);
            cl = sf.getClassLoader();
        }
        if (cl == null) {
            cl = Thread.currentThread().getContextClassLoader();
        }
        if (cl == null) {
View Full Code Here

            try {
                AbstractXmlApplicationContext applicationContext = new ResourceXmlApplicationContext(new FileSystemResource(file), xmlPreprocessors, parentContext, beanFactoryPostProcessors, false);
                applicationContext.setDisplayName(name);
                applicationContext.setClassLoader(classLoader);

                ServiceFactory serviceFactory = new SpringConfigurationServiceFactory(applicationContext);

                log.info("Registering spring services service: " + name + " from: " + file.getAbsolutePath() + " into the Kernel");

                kernel.registerService(new StringServiceName(name), serviceFactory);
            }
View Full Code Here

        if (classLoader == null) {
            classLoader = SpringLoader.class.getClassLoader();
        }

        ServiceName serviceName = new StringServiceName("configuration:" + location);
        ServiceFactory springConfigurationServiceFactory = new SpringConfigurationServiceFactory(applicationContext);
        kernel.registerService(serviceName, springConfigurationServiceFactory);
        return serviceName;
    }
View Full Code Here

        // add owned service stop conditions
        Set ownedServices = springConfiguration.getServiceFactories().keySet();
        for (Iterator iterator = springConfiguration.getServiceFactories().entrySet().iterator(); iterator.hasNext();) {
            Map.Entry entry = (Map.Entry) iterator.next();
            ServiceName serviceName = (ServiceName) entry.getKey();
            ServiceFactory serviceFactory = (ServiceFactory) entry.getValue();
            if (ownedServices.contains(serviceName)) {
                serviceFactory.addStopCondition(configurationStopCondition.createOwnedServiceStopCondition());
            }
        }

        return springConfiguration;
    }
View Full Code Here

TOP

Related Classes of org.apache.xbean.kernel.ServiceFactory

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.