Example usage for org.springframework.jca.context ResourceAdapterApplicationContext setClassLoader

List of usage examples for org.springframework.jca.context ResourceAdapterApplicationContext setClassLoader

Introduction

In this page you can find the example usage for org.springframework.jca.context ResourceAdapterApplicationContext setClassLoader.

Prototype

@Override
    public void setClassLoader(@Nullable ClassLoader classLoader) 

Source Link

Usage

From source file:org.springframework.jca.context.SpringContextResourceAdapter.java

/**
 * Build a Spring ApplicationContext for the given JCA BootstrapContext.
 * <p>The default implementation builds a {@link ResourceAdapterApplicationContext}
 * and delegates to {@link #loadBeanDefinitions} for actually parsing the
 * specified configuration files.//from www.j a  va  2  s  .c  o m
 * @param bootstrapContext this ResourceAdapter's BootstrapContext
 * @return the Spring ApplicationContext instance
 */
protected ConfigurableApplicationContext createApplicationContext(BootstrapContext bootstrapContext) {
    ResourceAdapterApplicationContext applicationContext = new ResourceAdapterApplicationContext(
            bootstrapContext);

    // Set ResourceAdapter's ClassLoader as bean class loader.
    applicationContext.setClassLoader(getClass().getClassLoader());

    // Extract individual config locations.
    String[] configLocations = StringUtils.tokenizeToStringArray(getContextConfigLocation(),
            CONFIG_LOCATION_DELIMITERS);

    loadBeanDefinitions(applicationContext, configLocations);
    applicationContext.refresh();

    return applicationContext;
}