Rename modules {org.springframework.*=>spring-*}
This renaming more intuitively expresses the relationship between
subprojects and the JAR artifacts they produce.
Tracking history across these renames is possible, but it requires
use of the --follow flag to `git log`, for example
$ git log spring-aop/src/main/java/org/springframework/aop/Advisor.java
will show history up until the renaming event, where
$ git log --follow spring-aop/src/main/java/org/springframework/aop/Advisor.java
will show history for all changes to the file, before and after the
renaming.
See http://chrisbeams.com/git-diff-across-renamed-directories
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:p="http://www.springframework.org/schema/p"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="foo" class="org.springframework.beans.TestBean" p:name="Baz"/>
|
||||
|
||||
<bean id="bar" class="org.springframework.beans.TestBean" p:name="#{foo.name}"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:p="http://www.springframework.org/schema/p"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
|
||||
|
||||
<bean id="apc" class="org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator"/>
|
||||
|
||||
<bean id="annotationSource" class="org.springframework.cache.annotation.AnnotationCacheOperationSource"/>
|
||||
|
||||
<aop:config>
|
||||
<aop:advisor advice-ref="debugInterceptor" pointcut="execution(* *..CacheableService.*(..))" order="1"/>
|
||||
</aop:config>
|
||||
|
||||
<bean id="cacheInterceptor" class="org.springframework.cache.interceptor.CacheInterceptor">
|
||||
<property name="cacheManager" ref="cacheManager"/>
|
||||
<property name="cacheOperationSources" ref="annotationSource"/>
|
||||
</bean>
|
||||
|
||||
<bean id="advisor" class="org.springframework.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor">
|
||||
<property name="cacheOperationSource" ref="annotationSource"/>
|
||||
<property name="adviceBeanName" value="cacheInterceptor"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
|
||||
<property name="caches">
|
||||
<set>
|
||||
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="default"/>
|
||||
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="primary"/>
|
||||
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="secondary"/>
|
||||
</set>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="debugInterceptor" class="org.springframework.aop.interceptor.DebugInterceptor"/>
|
||||
|
||||
<bean id="service" class="org.springframework.cache.config.DefaultCacheableService"/>
|
||||
|
||||
<bean id="classService" class="org.springframework.cache.config.AnnotatedClassCacheableService"/>
|
||||
|
||||
<bean id="keyGenerator" class="org.springframework.cache.config.SomeKeyGenerator"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:cache="http://www.springframework.org/schema/cache"
|
||||
xmlns:p="http://www.springframework.org/schema/p"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
|
||||
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
|
||||
|
||||
<cache:annotation-driven proxy-target-class="false" order="0" key-generator="keyGenerator"/>
|
||||
|
||||
<aop:config>
|
||||
<aop:advisor advice-ref="debugInterceptor" pointcut="execution(* *..CacheableService.*(..))" order="1"/>
|
||||
</aop:config>
|
||||
|
||||
<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
|
||||
<property name="caches">
|
||||
<set>
|
||||
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="default"/>
|
||||
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="primary"/>
|
||||
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="secondary"/>
|
||||
</set>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="debugInterceptor" class="org.springframework.aop.interceptor.DebugInterceptor"/>
|
||||
|
||||
<bean id="service" class="org.springframework.cache.config.DefaultCacheableService"/>
|
||||
|
||||
<bean id="classService" class="org.springframework.cache.config.AnnotatedClassCacheableService"/>
|
||||
|
||||
<bean id="keyGenerator" class="org.springframework.cache.config.SomeKeyGenerator"/>
|
||||
|
||||
</beans>
|
||||
109
spring-context/src/test/resources/org/springframework/cache/config/cache-advice.xml
vendored
Normal file
109
spring-context/src/test/resources/org/springframework/cache/config/cache-advice.xml
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:cache="http://www.springframework.org/schema/cache"
|
||||
xmlns:p="http://www.springframework.org/schema/p"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
|
||||
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
|
||||
|
||||
<cache:advice id="cacheAdviceInterface" cache-manager="cacheManager">
|
||||
<cache:caching cache="default">
|
||||
<cache:cacheable method="cache"/>
|
||||
<cache:cacheable method="conditional" condition="#classField == 3"/>
|
||||
<cache:cacheable method="key" key="#p0"/>
|
||||
<cache:cacheable method="nam*" key="#root.methodName"/>
|
||||
<cache:cacheable method="rootVars" key="#root.methodName + #root.method.name + #root.targetClass + #root.target"/>
|
||||
<cache:cacheable method="nullValue" cache="default"/>
|
||||
</cache:caching>
|
||||
<cache:caching>
|
||||
<cache:cache-evict method="invalidate" cache="default"/>
|
||||
<cache:cache-evict method="evict" key="#p0" cache="default"/>
|
||||
<cache:cache-evict method="evictWithException" cache="default"/>
|
||||
<cache:cache-evict method="evictEarly" cache="default" before-invocation="true"/>
|
||||
<cache:cache-evict method="invalidateEarly" key="#p0" cache="default" before-invocation="true"/>
|
||||
<cache:cache-evict method="evictAll" cache="default" all-entries="true"/>
|
||||
</cache:caching>
|
||||
<cache:caching cache="default">
|
||||
<cache:cache-put method="update"/>
|
||||
<cache:cache-put method="conditionalUpdate" condition="#arg.equals(3)"/>
|
||||
</cache:caching>
|
||||
<cache:caching method="mult*Cache">
|
||||
<cache:cacheable cache="primary"/>
|
||||
<cache:cacheable cache="secondary"/>
|
||||
</cache:caching>
|
||||
<cache:caching method="multiEvict">
|
||||
<cache:cache-evict cache="primary"/>
|
||||
<cache:cache-evict cache="primary" key="#p0 + 'A'"/>
|
||||
<cache:cache-evict method="multiEvict" cache="secondary" key="#p0"/>
|
||||
</cache:caching>
|
||||
<cache:caching>
|
||||
<cache:cacheable method="multiCacheAndEvict" cache="primary" key="#root.methodName"/>
|
||||
<cache:cache-evict method="multiCacheAndEvict" cache="secondary"/>
|
||||
<cache:cacheable method="multiConditionalCacheAndEvict" cache="primary" condition="#p0 == 3"/>
|
||||
<cache:cache-evict method="multiConditionalCacheAndEvict" cache="secondary"/>
|
||||
<cache:cache-put method="multiUpdate" cache="primary"/>
|
||||
<cache:cache-put method="multiUpdate" cache="secondary"/>
|
||||
</cache:caching>
|
||||
</cache:advice>
|
||||
|
||||
<cache:advice id="cacheAdviceClass" cache-manager="cacheManager" key-generator="keyGenerator">
|
||||
<cache:caching cache="default">
|
||||
<cache:cacheable method="key" key="#p0"/>
|
||||
<cache:cacheable method="nam*" key="#root.methodName + #root.caches[0].name"/>
|
||||
<cache:cacheable method="rootVars" key="#root.methodName + #root.method.name + #root.targetClass + #root.target"/>
|
||||
<cache:cacheable method="cache"/>
|
||||
<cache:cacheable method="conditional"/>
|
||||
<cache:cacheable method="null*"/>
|
||||
</cache:caching>
|
||||
<cache:caching>
|
||||
<cache:cache-evict method="invalidate" cache="default"/>
|
||||
<cache:cache-evict method="evict" key="#p0" cache="default"/>
|
||||
<cache:cache-evict method="evictWithException" cache="default"/>
|
||||
<cache:cache-evict method="evictEarly" cache="default" before-invocation="true"/>
|
||||
<cache:cache-evict method="invalidateEarly" key="#p0" cache="default" before-invocation="true"/>
|
||||
<cache:cache-evict method="evictAll" cache="default" all-entries="true"/>
|
||||
</cache:caching>
|
||||
<cache:caching cache="default">
|
||||
<cache:cache-put method="update"/>
|
||||
<cache:cache-put method="conditionalUpdate" condition="#arg.equals(3)"/>
|
||||
</cache:caching>
|
||||
<cache:caching>
|
||||
<cache:cacheable method="multiCache" cache="primary"/>
|
||||
<cache:cacheable method="multiCache" cache="secondary"/>
|
||||
<cache:cache-evict method="multiEvict" cache="primary"/>
|
||||
<cache:cache-evict method="multiEvict" cache="secondary" key="#p0"/>
|
||||
<cache:cache-evict method="multiEvict" cache="primary" key="#p0 + 'A'"/>
|
||||
<cache:cacheable method="multiCacheAndEvict" cache="primary" key="#root.methodName"/>
|
||||
<cache:cache-evict method="multiCacheAndEvict" cache="secondary"/>
|
||||
<cache:cacheable method="multiConditionalCacheAndEvict" cache="primary" condition="#p0 == 3"/>
|
||||
<cache:cache-evict method="multiConditionalCacheAndEvict" cache="secondary"/>
|
||||
<cache:cache-put method="multiUpdate" cache="primary"/>
|
||||
<cache:cache-put method="multiUpdate" cache="secondary"/>
|
||||
</cache:caching>
|
||||
</cache:advice>
|
||||
|
||||
<aop:config>
|
||||
<aop:advisor advice-ref="cacheAdviceInterface" pointcut="execution(* *..DefaultCacheableService.*(..))" order="1"/>
|
||||
<aop:advisor advice-ref="cacheAdviceClass" pointcut="execution(* *..AnnotatedClassCacheableService.*(..))" order="1"/>
|
||||
<aop:advisor advice-ref="debugInterceptor" pointcut="execution(* *..CacheableService.*(..))" order="2"/>
|
||||
</aop:config>
|
||||
|
||||
<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
|
||||
<property name="caches">
|
||||
<set>
|
||||
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="default"/>
|
||||
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="primary"/>
|
||||
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="secondary"/>
|
||||
</set>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="keyGenerator" class="org.springframework.cache.config.SomeKeyGenerator"/>
|
||||
|
||||
<bean id="debugInterceptor" class="org.springframework.aop.interceptor.DebugInterceptor"/>
|
||||
|
||||
<bean id="service" class="org.springframework.cache.config.DefaultCacheableService"/>
|
||||
|
||||
<bean id="classService" class="org.springframework.cache.config.AnnotatedClassCacheableService"/>
|
||||
</beans>
|
||||
50
spring-context/src/test/resources/org/springframework/cache/ehcache/testEhcache.xml
vendored
Normal file
50
spring-context/src/test/resources/org/springframework/cache/ehcache/testEhcache.xml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<ehcache>
|
||||
|
||||
<!-- Sets the path to the directory where cache .data files are created.
|
||||
|
||||
If the path is a Java System Property it is replaced by
|
||||
its value in the running VM.
|
||||
|
||||
The following properties are translated:
|
||||
user.home - User's home directory
|
||||
user.dir - User's current working directory
|
||||
java.io.tmpdir - Default temp file path -->
|
||||
<diskStore path="java.io.tmpdir"/>
|
||||
|
||||
|
||||
<!--Default Cache configuration. These will applied to caches programmatically created through
|
||||
the CacheManager.
|
||||
|
||||
The following attributes are required for defaultCache:
|
||||
|
||||
maxInMemory - Sets the maximum number of objects that will be created in memory
|
||||
eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
|
||||
is never expired.
|
||||
timeToIdleSeconds - Sets the time to idle for an element before it expires.
|
||||
i.e. The maximum amount of time between accesses before an element expires
|
||||
Is only used if the element is not eternal.
|
||||
Optional attribute. A value of 0 means that an Element can idle for infinity
|
||||
timeToLiveSeconds - Sets the time to live for an element before it expires.
|
||||
i.e. The maximum time between creation time and when an element expires.
|
||||
Is only used if the element is not eternal.
|
||||
overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
|
||||
has reached the maxInMemory limit.
|
||||
|
||||
-->
|
||||
<defaultCache
|
||||
maxElementsInMemory="10000"
|
||||
eternal="false"
|
||||
timeToIdleSeconds="120"
|
||||
timeToLiveSeconds="120"
|
||||
overflowToDisk="true"
|
||||
/>
|
||||
|
||||
<cache name="myCache1"
|
||||
maxElementsInMemory="300"
|
||||
eternal="false"
|
||||
timeToIdleSeconds="500"
|
||||
timeToLiveSeconds="500"
|
||||
overflowToDisk="true"
|
||||
/>
|
||||
|
||||
</ehcache>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
|
||||
|
||||
<context:property-placeholder
|
||||
location="classpath*:/org/springframework/context/config/test-*.properties,classpath*:/org/springframework/context/config/empty-*.properties,classpath*:/org/springframework/context/config/missing-*.properties"
|
||||
file-encoding="ISO-8859-1"/>
|
||||
|
||||
<bean id="foo" class="java.lang.String">
|
||||
<constructor-arg value="${foo}" />
|
||||
</bean>
|
||||
|
||||
<bean id="bar" class="java.lang.String">
|
||||
<constructor-arg value="${bar}" />
|
||||
</bean>
|
||||
|
||||
<bean id="spam" class="java.lang.String">
|
||||
<constructor-arg value="${spam}" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
|
||||
|
||||
<util:properties id="overrideProps">
|
||||
<prop key="date.minutes">42</prop>
|
||||
</util:properties>
|
||||
|
||||
<context:property-override properties-ref="overrideProps" order="1" />
|
||||
|
||||
<bean id="date" class="java.util.Date">
|
||||
<property name="minutes" value="10"/>
|
||||
</bean>
|
||||
|
||||
<context:property-override location="not/here" ignore-resource-not-found="true" order="2"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
|
||||
|
||||
<util:properties id="placeholderProps">
|
||||
<prop key="foo">bar</prop>
|
||||
</util:properties>
|
||||
|
||||
<context:property-placeholder properties-ref="placeholderProps" ignore-unresolvable="true"/>
|
||||
|
||||
<bean id="string" class="java.lang.String">
|
||||
<constructor-arg value="${bar}"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
|
||||
|
||||
<util:properties id="placeholderProps">
|
||||
<prop key="foo">bar</prop>
|
||||
</util:properties>
|
||||
|
||||
<util:properties id="emptyProps"/>
|
||||
|
||||
<context:property-placeholder properties-ref="placeholderProps" order="2"/>
|
||||
|
||||
<context:property-placeholder properties-ref="emptyProps" order="1" ignore-unresolvable="true"/>
|
||||
|
||||
<context:property-placeholder location="not/here" ignore-resource-not-found="true" order="2"/>
|
||||
|
||||
<bean id="string" class="java.lang.String">
|
||||
<constructor-arg value="${foo}"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
|
||||
|
||||
<context:property-placeholder/>
|
||||
|
||||
<bean id="string" class="java.lang.String">
|
||||
<constructor-arg value="${foo}"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
|
||||
|
||||
<util:properties id="placeholderProps">
|
||||
<prop key="foo">bar</prop>
|
||||
</util:properties>
|
||||
|
||||
<context:property-placeholder properties-ref="placeholderProps" system-properties-mode="OVERRIDE"/>
|
||||
|
||||
<bean id="string" class="java.lang.String">
|
||||
<constructor-arg value="${foo}"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
bar=foo
|
||||
spam=maps
|
||||
@@ -0,0 +1 @@
|
||||
foo=bar
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
|
||||
|
||||
<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean">
|
||||
<property name="converters">
|
||||
<bean class="org.springframework.context.conversionservice.StringToBarConverter" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="testClient" class="org.springframework.context.conversionservice.TestClient">
|
||||
<property name="bool" value="true"/>
|
||||
<property name="stringList">
|
||||
<list>
|
||||
<value>#{'test-' + strValue + '-end'}</value>
|
||||
<value>#{'test-' + strValue}</value>
|
||||
<value>#{'test-' + numValue+ '-end'}</value>
|
||||
<value>#{'test-' + numValue}</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="resourceArray">
|
||||
<value>classpath:test.xml</value>
|
||||
</property>
|
||||
<property name="resourceList">
|
||||
<list>
|
||||
<value>classpath:test.xml</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="resourceMap">
|
||||
<map>
|
||||
<entry key="res1" value="classpath:test1.xml"/>
|
||||
<entry key="res2" value="classpath:test2.xml"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.context.conversionservice.Bar">
|
||||
<constructor-arg value ="value1" />
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.context.conversionservice.Bar">
|
||||
<constructor-arg value ="value2" />
|
||||
</bean>
|
||||
|
||||
<bean id="numValue" class="java.lang.Integer">
|
||||
<constructor-arg value="111"/>
|
||||
</bean>
|
||||
|
||||
<bean id="strValue" class="java.lang.String">
|
||||
<constructor-arg value="222"/>
|
||||
</bean>
|
||||
|
||||
<context:annotation-config />
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
|
||||
|
||||
<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
|
||||
<property name="scopes">
|
||||
<map>
|
||||
<entry key="thread">
|
||||
<bean class="org.springframework.context.support.SimpleThreadScope"/>
|
||||
</entry>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="threadScopedObject" class="org.springframework.beans.TestBean" scope="thread"/>
|
||||
|
||||
<!--
|
||||
<bean id="requestScopedDisposableObject" class="org.springframework.beans.DerivedTestBean" scope="request"/>
|
||||
|
||||
<bean id="requestScopedFactoryBean" class="org.springframework.beans.factory.DummyFactory" scope="request"/>
|
||||
|
||||
<bean id="requestScopedObjectCircle1" class="org.springframework.beans.TestBean" scope="request">
|
||||
<property name="spouse" ref="requestScopedObjectCircle2"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestScopedObjectCircle2" class="org.springframework.beans.TestBean" scope="request">
|
||||
<property name="spouse" ref="requestScopedObjectCircle1"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestScopedOuterBean" class="org.springframework.beans.DerivedTestBean" scope="request">
|
||||
<property name="name" value="outer"/>
|
||||
<property name="spouse">
|
||||
<bean class="org.springframework.beans.DerivedTestBean">
|
||||
<property name="name" value="inner"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="singletonOuterBean" class="org.springframework.beans.DerivedTestBean" lazy-init="true">
|
||||
<property name="name" value="outer"/>
|
||||
<property name="spouse">
|
||||
<bean class="org.springframework.beans.DerivedTestBean" scope="request">
|
||||
<property name="name" value="inner"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
-->
|
||||
</beans>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:task="http://www.springframework.org/schema/task"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/task
|
||||
http://www.springframework.org/schema/task/spring-task.xsd">
|
||||
|
||||
<task:annotation-driven executor="testExecutor" scheduler="testScheduler"/>
|
||||
|
||||
<task:executor id="testExecutor"/>
|
||||
|
||||
<task:scheduler id="testScheduler"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:task="http://www.springframework.org/schema/task"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<task:executor id="default"/>
|
||||
|
||||
<task:executor id="singleSize" pool-size="42"/>
|
||||
|
||||
<task:executor id="rangeWithBoundedQueue" pool-size="7-42" queue-capacity="11"/>
|
||||
|
||||
<task:executor id="rangeWithUnboundedQueue" pool-size="0-9" keep-alive="37"/>
|
||||
|
||||
<task:executor id="invalidPoolSize" pool-size="zzz"/>
|
||||
|
||||
<task:executor id="propertyPlaceholderWithSingleSize" pool-size="${size.single}"/>
|
||||
|
||||
<task:executor id="propertyPlaceholderWithRange" pool-size="${size.range}" queue-capacity="10"/>
|
||||
|
||||
<task:executor id="propertyPlaceholderWithRangeAndCoreThreadTimeout" pool-size="${size.rangeFromZero}"/>
|
||||
|
||||
<task:executor id="propertyPlaceholderWithInvalidPoolSize" pool-size="${size.invalid}"/>
|
||||
|
||||
<context:property-placeholder properties-ref="props"/>
|
||||
|
||||
<util:properties id="props">
|
||||
<prop key="size.single">123</prop>
|
||||
<prop key="size.range">5-25</prop>
|
||||
<prop key="size.rangeFromZero">0-99</prop>
|
||||
<prop key="size.invalid">22-abc</prop>
|
||||
</util:properties>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:task="http://www.springframework.org/schema/task"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd"
|
||||
default-lazy-init="true">
|
||||
|
||||
<task:scheduled-tasks>
|
||||
<task:scheduled ref="myTask" method="doWork" fixed-rate="10"/>
|
||||
</task:scheduled-tasks>
|
||||
|
||||
<bean id="myTask" class="org.springframework.scheduling.config.LazyScheduledTasksBeanDefinitionParserTests$Task"/>
|
||||
</beans>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:task="http://www.springframework.org/schema/task"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/task
|
||||
http://www.springframework.org/schema/task/spring-task.xsd">
|
||||
|
||||
<task:scheduled-tasks scheduler="testScheduler">
|
||||
<task:scheduled ref="testBean" method="test" fixed-rate="1000"/>
|
||||
<task:scheduled ref="testBean" method="test" fixed-rate="2000"/>
|
||||
<task:scheduled ref="testBean" method="test" fixed-delay="3000"/>
|
||||
<task:scheduled ref="testBean" method="test" cron="*/4 * 9-17 * * MON-FRI"/>
|
||||
<task:scheduled ref="testBean" method="test" trigger="customTrigger"/>
|
||||
</task:scheduled-tasks>
|
||||
|
||||
<task:scheduler id="testScheduler"/>
|
||||
|
||||
<bean id="testBean" class="org.springframework.scheduling.config.ScheduledTasksBeanDefinitionParserTests$TestBean"/>
|
||||
|
||||
<bean id="customTrigger" class="org.springframework.scheduling.config.ScheduledTasksBeanDefinitionParserTests$TestTrigger"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:task="http://www.springframework.org/schema/task"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/task
|
||||
http://www.springframework.org/schema/task/spring-task.xsd">
|
||||
|
||||
<task:scheduler id="defaultScheduler"/>
|
||||
|
||||
<task:scheduler id="customScheduler" pool-size="42"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.springframework.scripting.config
|
||||
|
||||
class TestBean implements ITestBean {
|
||||
|
||||
ITestBean otherBean
|
||||
|
||||
boolean initialized
|
||||
|
||||
boolean destroyed
|
||||
|
||||
void setOtherBean(ITestBean otherBean) {
|
||||
this.otherBean = otherBean;
|
||||
}
|
||||
|
||||
void startup() { this.initialized = true }
|
||||
|
||||
void shutdown() { this.destroyed = true }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:lang="http://www.springframework.org/schema/lang"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/lang
|
||||
http://www.springframework.org/schema/lang/spring-lang-3.1.xsd"
|
||||
default-autowire="byName"
|
||||
default-init-method="startup"
|
||||
default-destroy-method="shutdown">
|
||||
|
||||
<lang:defaults refresh-check-delay="5000" proxy-target-class="true"/>
|
||||
|
||||
<lang:groovy id="testBean" name="/url" script-source="classpath:org/springframework/scripting/config/TestBean.groovy"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:lang="http://www.springframework.org/schema/lang"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/lang
|
||||
http://www.springframework.org/schema/lang/spring-lang-3.0.xsd"
|
||||
default-autowire="byName"
|
||||
default-init-method="startup"
|
||||
default-destroy-method="shutdown">
|
||||
|
||||
<lang:defaults refresh-check-delay="5000"/>
|
||||
|
||||
<lang:groovy id="testBean" name="/url" script-source="classpath:org/springframework/scripting/config/TestBean.groovy"/>
|
||||
|
||||
<lang:groovy id="nonRefreshableTestBean" refresh-check-delay="-1"
|
||||
script-source="classpath:org/springframework/scripting/config/TestBean.groovy"/>
|
||||
|
||||
<bean id="otherBean" class="org.springframework.scripting.config.OtherTestBean"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1 @@
|
||||
typeMismatch=Field {0} did not have correct type
|
||||
@@ -0,0 +1,2 @@
|
||||
typeMismatch=Field {0} did not have correct type
|
||||
age=Age
|
||||
@@ -0,0 +1,2 @@
|
||||
typeMismatch=Field {0} did not have correct type
|
||||
person.age=Person Age
|
||||
Reference in New Issue
Block a user