Quartz 2.1.7 + spring-core-3.2.2.RELEASE
http://blog.csdn.net/lk_blog/article/details/11744621
http://blog.csdn.net/cuihaiyang/article/details/6742869
http://ronxin999.blog.163.com/blog/static/422179202011521147054/
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">
<!-- 默认以settings.xml为全局配置文件 -->
<context:property-placeholder location="classpath:settings.xml" ignore-resource-not-found="true" />
<!-- 定义数据源 -->
<bean id="dataSource" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="${db.driver}" />
<property name="url" value="${db.url}" />
<property name="username" value="${db.username}" />
<property name="password" value="${db.password}" />
<property name="maxActive" value="${db.maxActive}" />
<property name="maxIdle" value="${db.maxIdle}" />
<property name="maxWait" value="${db.maxWait}" />
</bean>
<bean id="scheduler"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean"
lazy-init="false">
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>
<bean id="sessionFactory" parent="baseSessionFactory">
<!-- <property name="packagesToScan">
<list>
<value>com.gs.os.entity</value>
</list>
</property> -->
</bean>
<!-- 定义基本的Hibernate SessionFactory,供继承。 -->
<bean id="baseSessionFactory" abstract="true"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<!-- 加载自定义UserType -->
<property name="annotatedPackages" value="coo.core.hibernate.usertype" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">${db.show_sql}</prop>
<prop key="hibernate.hbm2ddl.auto">${db.hbm2ddl.auto}</prop>
<prop key="hibernate.dialect">${db.dialect}</prop>
<prop key="hibernate.cache.use_query_cache">${db.cache.use_query_cache}</prop>
<prop key="hibernate.cache.use_second_level_cache">${db.cache.use_second_level_cache}</prop>
<prop key="hibernate.cache.region.factory_class">${db.cache.region.factory_class}</prop>
<prop key="hibernate.jdbc.fetch_size">${db.jdbc.fetch_size}</prop>
<prop key="hibernate.jdbc.batch_size">${db.jdbc.batch_size}</prop>
</props>
</property>
</bean>
<!-- 定义事务管理 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!-- 加载应用组件 -->
<context:component-scan base-package="com.gs.os" />
<context:component-scan base-package="core.base" />
<!-- shiro security -->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager"/>
</bean>
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="realm" ref="customRealm"/>
</bean>
<bean id="customRealm" class="core.base.security.CustomRealm" />
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor" />
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
<property name="securityManager" ref="securityManager"/>
</bean>
</beans>