2014-04-13 4 views
0

XML을 사용하고 있습니다. (Ehcache.xml) classpath에 속성 파일의 속성을 입력하고 싶습니다.관리되지 않는 Spring xml에 속성을 삽입

그러나이 XML은 스프링 관리 빈이 아니기 때문에 그렇게 할 수 없습니다.

모든 권장 사항을 극복하는 방법?

는 XML :

... 
      properties="peerDiscovery=manual,rmiUrls=//**${other.node.hostname}**:41001/org.jasig.cas.ticket.ServiceTicket|//**${other.node.hostname}**:41001/org.jasig.cas.ticket.TicketGrantingTicket" 
      propertySeparator="," /> 



    <cacheManagerPeerListenerFactory 
      class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" 
      properties="port=41001,socketTimeoutMillis=5000" /> 

</ehcache> 

내가 $ {other.node.hostname} 다른 특성 파일에서를 주입합니다. 인덱스 2에서 권한에 잘못된 문자 : java.net.URISyntaxException :에 의한

:

는하지만 런타임에 얻을 // $ {other.node.hostname} : 41001/org.jasig .cas.ticket.TicketGrantingTicket

감사합니다, 레이. 012h eccache.xml에서

답변

0

이 스프링 구성이 아니기 때문에 작동하지 않습니다. 대신으로 Ehcache 파일의 봄에 해당하는 구성을 정의하는 경우 그것은 작동합니다 :

<context:property-placeholder location="classpath:config.properties"/> 

<bean id="myCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean"> 
    <property name="cacheManager" ref="cacheManager"/> 
    <property name="maxElementsInMemory" value="${cache.maxMemoryElements}"/> 
</bean> 

최고의에서, ehcache.xml 봄에 모든 것을 최소한의 파일 및 구성 사용하는 것입니다에서 대부분의 옵션으로 파일에는 스프링이 있습니다.

+0

하지만 cacheManagerPeerProviderFactory, cacheManagerPeerListenerFactory 속성을 사용하여 새 스프링 XML을 어떻게 수정 하시겠습니까? – rayman