当前位置: 首页>>代码示例>>Java>>正文


Java ResourcePatternUtils.getResourcePatternResolver方法代码示例

本文整理汇总了Java中org.springframework.core.io.support.ResourcePatternUtils.getResourcePatternResolver方法的典型用法代码示例。如果您正苦于以下问题:Java ResourcePatternUtils.getResourcePatternResolver方法的具体用法?Java ResourcePatternUtils.getResourcePatternResolver怎么用?Java ResourcePatternUtils.getResourcePatternResolver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.core.io.support.ResourcePatternUtils的用法示例。


在下文中一共展示了ResourcePatternUtils.getResourcePatternResolver方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LocalSessionFactoryBuilder

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
/**
 * Create a new LocalSessionFactoryBuilder for the given DataSource.
 * @param dataSource the JDBC DataSource that the resulting Hibernate SessionFactory should be using
 * (may be {@code null})
 * @param resourceLoader the ResourceLoader to load application classes from
 */
@SuppressWarnings("deprecation")  // to be able to build against Hibernate 4.3
public LocalSessionFactoryBuilder(DataSource dataSource, ResourceLoader resourceLoader) {
	getProperties().put(Environment.CURRENT_SESSION_CONTEXT_CLASS, SpringSessionContext.class.getName());
	if (dataSource != null) {
		getProperties().put(Environment.DATASOURCE, dataSource);
	}
	// APP_CLASSLOADER is deprecated as of Hibernate 4.3 but we need to remain compatible with 4.0+
	getProperties().put(AvailableSettings.APP_CLASSLOADER, resourceLoader.getClassLoader());
	this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:LocalSessionFactoryBuilder.java

示例2: LocalSessionFactoryBuilder

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
/**
 * Create a new LocalSessionFactoryBuilder for the given DataSource.
 * @param dataSource the JDBC DataSource that the resulting Hibernate SessionFactory should be using
 * (may be {@code null})
 * @param resourceLoader the ResourceLoader to load application classes from
 */
public LocalSessionFactoryBuilder(DataSource dataSource, ResourceLoader resourceLoader) {
	getProperties().put(Environment.CURRENT_SESSION_CONTEXT_CLASS, SpringSessionContext.class.getName());
	if (dataSource != null) {
		getProperties().put(Environment.DATASOURCE, dataSource);
	}
	getProperties().put(AvailableSettings.CLASSLOADERS, Collections.singleton(resourceLoader.getClassLoader()));
	this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:15,代码来源:LocalSessionFactoryBuilder.java

示例3: setApplicationContext

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
    resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(applicationContext);
    String dsName = ConnectionSource.DEFAULT.equals(dataSourceName) ? "dataSource" : "dataSource_" + dataSourceName;
    Properties properties = getProperties();

    if(applicationContext.containsBean(dsName)) {
        properties.put(Environment.DATASOURCE, applicationContext.getBean(dsName));
    }
    properties.put(Environment.CURRENT_SESSION_CONTEXT_CLASS, currentSessionContext.getName());
    properties.put(AvailableSettings.CLASSLOADERS, applicationContext.getClassLoader());
}
 
开发者ID:grails,项目名称:gorm-hibernate5,代码行数:13,代码来源:HibernateMappingContextConfiguration.java

示例4: HibernateSpringSessionFactoryBuilder

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
/**
 * Create a new LocalSessionFactoryBuilder for the given DataSource.
 *
 * @param dataSource      the JDBC DataSource that the resulting Hibernate SessionFactory should be using
 *                        (may be {@code null})
 * @param resourceLoader  the ResourceLoader to load application classes from
 * @param metadataSources the Hibernate MetadataSources service to use (e.g. reusing an existing one)
 * @since 4.3
 */
public HibernateSpringSessionFactoryBuilder(DataSource dataSource, ResourceLoader resourceLoader, MetadataSources metadataSources) {
    super(metadataSources);

    getProperties().put(AvailableSettings.CURRENT_SESSION_CONTEXT_CLASS, SpringSessionContext.class.getName());
    if (dataSource != null) {
        getProperties().put(AvailableSettings.DATASOURCE, dataSource);
    }

    // Hibernate 5.1/5.2: manually enforce connection release mode ON_CLOSE (the former default)
    try {
        // Try Hibernate 5.2
        AvailableSettings.class.getField("CONNECTION_HANDLING");
        getProperties().put("hibernate.connection.handling_mode", "DELAYED_ACQUISITION_AND_HOLD");
    } catch (NoSuchFieldException ex) {
        // Try Hibernate 5.1
        try {
            AvailableSettings.class.getField("ACQUIRE_CONNECTIONS");
            getProperties().put("hibernate.connection.release_mode", "ON_CLOSE");
        } catch (NoSuchFieldException ex2) {
            // on Hibernate 5.0.x or lower - no need to change the default there
        }
    }

    getProperties().put(AvailableSettings.CLASSLOADERS, Collections.singleton(resourceLoader.getClassLoader()));
    this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
}
 
开发者ID:baomidou,项目名称:hibernate-plus,代码行数:36,代码来源:HibernateSpringSessionFactoryBuilder.java

示例5: setResourceLoader

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
/**
 * 设定 ResourceLoader
 * @param resourceLoader {@link ResourceLoader}
 */
public void setResourceLoader(ResourceLoader resourceLoader) {
    this.resourcePatternResolver = ResourcePatternUtils
            .getResourcePatternResolver(resourceLoader);  
    this.metadataReaderFactory = new CachingMetadataReaderFactory(  
            resourceLoader);  
}
 
开发者ID:piggsoft,项目名称:wx_api,代码行数:11,代码来源:ClassScaner.java

示例6: buildApplication

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
public static SdcctApplication buildApplication() {
    ResourceLoader resourceLoader = new DefaultResourceLoader();
    ResourcePatternResolver resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);

    SdcctApplication app = ((SdcctApplication) new SdcctApplicationBuilder(buildSources(resourcePatternResolver)).addCommandLineProperties(false)
        .bannerMode(Mode.OFF).headless(true).resourceLoader(resourceLoader).application());

    app.setPropertySource(buildPropertySource(resourcePatternResolver));

    app.setListeners(
        app.getListeners().stream().filter((appListener -> !appListener.getClass().equals(LoggingApplicationListener.class))).collect(Collectors.toList()));

    return app;
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:15,代码来源:SdcctApplicationConfiguration.java

示例7: LocalSessionFactoryBuilder

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
/**
 * Create a new LocalSessionFactoryBuilder for the given DataSource.
 * @param dataSource the JDBC DataSource that the resulting Hibernate SessionFactory should be using
 * (may be {@code null})
 * @param resourceLoader the ResourceLoader to load application classes from
 */
public LocalSessionFactoryBuilder(DataSource dataSource, ResourceLoader resourceLoader) {
	getProperties().put(Environment.CURRENT_SESSION_CONTEXT_CLASS, SpringSessionContext.class.getName());
	if (dataSource != null) {
		getProperties().put(Environment.DATASOURCE, dataSource);
	}
	getProperties().put(AvailableSettings.APP_CLASSLOADER, resourceLoader.getClassLoader());
	this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:15,代码来源:LocalSessionFactoryBuilder.java

示例8: SortedResourcesFactoryBean

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
public SortedResourcesFactoryBean(ResourceLoader resourceLoader, List<String> locations) {
	this.locations = locations;
	this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SortedResourcesFactoryBean.java

示例9: setResourceLoader

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
@Override
public void setResourceLoader(ResourceLoader resourceLoader) {
	this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SortedResourcesFactoryBean.java

示例10: getResources

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
private Resource[] getResources(String packagePath) throws IOException {
	ResourcePatternResolver resourceResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
	Resource[] resources = resourceResolver.getResources(packagePath);
	return resources;
}
 
开发者ID:swxiao,项目名称:bubble2,代码行数:6,代码来源:MyBatisConfig.java

示例11: setResourceLoader

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
public void setResourceLoader(ResourceLoader resourceLoader) {
this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
this.metadataReaderFactory = new CachingMetadataReaderFactory(resourceLoader);
   }
 
开发者ID:ilivoo,项目名称:game,代码行数:5,代码来源:ClassPathClassScanner.java

示例12: ReverseOrderResourceLoader

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
ReverseOrderResourceLoader(ResourceLoader loader) {
	this.resolver = ResourcePatternUtils.getResourcePatternResolver(loader);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:4,代码来源:DataSourceInitializerTests.java

示例13: setResourceLoader

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
public void setResourceLoader(ResourceLoader resourceLoader) {
    resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
}
 
开发者ID:grails,项目名称:gorm-hibernate5,代码行数:4,代码来源:HibernateMappingContextSessionFactoryBean.java

示例14: ClassPathScanner

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
public ClassPathScanner(ClassLoader classLoader) {
    DefaultResourceLoader defaultResourceLoader = new DefaultResourceLoader(classLoader);
    this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(defaultResourceLoader);
    this.metadataReaderFactory = new CachingMetadataReaderFactory(defaultResourceLoader);
}
 
开发者ID:Indoqa,项目名称:indoqa-spring,代码行数:6,代码来源:ClassPathScanner.java

示例15: setResourceLoader

import org.springframework.core.io.support.ResourcePatternUtils; //导入方法依赖的package包/类
@Override
public void setResourceLoader(ResourceLoader resourceLoader) {
    this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:5,代码来源:ResourceSourceResolverImpl.java


注:本文中的org.springframework.core.io.support.ResourcePatternUtils.getResourcePatternResolver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。