Package org.broadleafcommerce.common.extensibility.context

Examples of org.broadleafcommerce.common.extensibility.context.MergeFileSystemAndClassPathXMLApplicationContext


        return classPath;
    }

    @Override
    public void execute() {
        MergeFileSystemAndClassPathXMLApplicationContext mergeContext;
        try {
            ConfigurationOnlyState state = new ConfigurationOnlyState();
            state.setConfigurationOnly(true);
            ConfigurationOnlyState.setState(state);
            Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
            // launch the service merge application context to get the entity configuration for the entire framework
            String[] contexts = StandardConfigLocations.retrieveAll(StandardConfigLocations.TESTCONTEXTTYPE);
            LinkedHashMap<String, MergeFileSystemAndClassPathXMLApplicationContext.ResourceType> locations = new LinkedHashMap<String, MergeFileSystemAndClassPathXMLApplicationContext.ResourceType>();
            for (String context : contexts) {
                locations.put(context, MergeFileSystemAndClassPathXMLApplicationContext.ResourceType.CLASSPATH);
            }
            for (Task task : appContexts) {
                if (task instanceof ClassPathApplicationContextTask) {
                    locations.put(((ClassPathApplicationContextTask) task).getPath(), MergeFileSystemAndClassPathXMLApplicationContext.ResourceType.CLASSPATH);
                } else if (task instanceof FileSystemApplicationContextTask) {
                    locations.put(((FileSystemApplicationContextTask) task).getPath(), MergeFileSystemAndClassPathXMLApplicationContext.ResourceType.FILESYSTEM);
                }
            }
            mergeContext = new MergeFileSystemAndClassPathXMLApplicationContext(locations, null);
        } catch (Exception e) {
            throw new BuildException(e, getLocation());
        } finally {
            ConfigurationOnlyState.setState(null);
        }
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.common.extensibility.context.MergeFileSystemAndClassPathXMLApplicationContext

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.