Application의 용도에 따라 GlueService Meta와 관련된 bean 설정을 수정합니다.
Web Appliclation 용도일 경우엔 MetaData 동기화와 관련된 Cache 설정도 수정합니다.
<bean id="serviceLoader" class="com.posco.glue.reuse.PoscoServiceLoader"> <property name="dataSource" ref=". . ."/> <property name="queryManager" ref="queryManager"/> <property name="queryExtraBindingInfo"> <list> <value>. . .</value> </list> </property> </bean> . . . <bean id="queryLoader" class="com.poscoict.glueframework.dao.manager.GlueQueryLoader"> <property name="extraQueryFiles"> <list> . . . <value>libquery/posco-meta-access-query.glue_sql</value> </list> </property> </bean>
serviceLoader 의 dataSource property의 값은 다음과 같이 2가지 중 하나로 설정할 수 있습니다.
Web Application 용의 dataSource
<bean id="serviceLoader" class="com.posco.glue.reuse.PoscoServiceLoader"> <property name="dataSource" ref="m0a-ds"/> . . . </bean> <bean id="m0a-ds" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/rw/M00A10DS"/> . . . </bean>
Scheduled Job Application 용의 dataSource
<bean id="serviceLoader" class="com.posco.glue.reuse.PoscoServiceLoader"> <property name="dataSource" ref="m0a-ds"/> . . . </bean> <bean id="m0a-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/> <property name="url" value=". . ." /> <property name="username" value=". . ." /> <property name="password" value=". . ." /> <property name="defaultAutoCommit" value="false" /> <property name="minIdle" value="0" /> <property name="maxActive" value="-1" /> <property name="maxIdle" value="1000" /> </bean>
serviceLoader 의 queryExtraBindingInfo property의 값은 다음과 같이 2가지 중 하나로 설정할 수 있습니다.
상수 사용 queryExtraBindingInfo
<bean id="serviceLoader" class="com.posco.glue.reuse.PoscoServiceLoader"> . . . <property name="queryExtraBindingInfo"> <list> <value>BZ</value> </list> </property> </bean>
변수 사용 queryExtraBindingInfo
<bean id="serviceLoader" class="com.posco.glue.reuse.PoscoServiceLoader"> . . . <property name="queryExtraBindingInfo"> <list> <value>${GCS_COMP_CODE}</value> </list> </property> </bean>
Application의 용도에 따라 캐싱과 관련된 bean 및 설정파일(ehcache.xml)을 수정합니다.
Web Appliclation 용도일 경우엔 MetaData 동기화 기능을 사용하기 위해 다음과 같이 수정합니다.
<bean id="cacheManager" class="com.poscoict.glueframework.cache.ehcache.GlueEhCacheManager"> <property name="location" value="file:${CONFIG_PATH}/ehcache.xml"/> </bean>
<?xml version="1.0" encoding="UTF-8"?> <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="false" name="__DEFAULT__"> <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" properties="hostName=172.31.47.161, port=40001, socketTimeoutMillis=2000" /> <cache ...> </ehcache>
<cache name="_service-region" maxElementsInMemory="500" maxElementsOnDisk="0" eternal="false" timeToIdleSeconds="0" timeToLiveSeconds="0" memoryStoreEvictionPolicy="LRU" > <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties="replicateAsynchronously=true, replicatePuts=false, replicateUpdates=false, replicateUpdatesViaCopy=false, replicateRemovals=false" /> </cache>
다음을 참고해서 applicationContext.xml 을 수정합니다.
<?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-3.0.xsd"> <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="file:${CONFIG_PATH}/M60A010WEB.properties" /> <property name="ignoreUnresolvablePlaceholders" value="true" /> </bean> <bean id="serviceManager" class="com.poscoict.glueframework.biz.control.GlueServiceManagerImpl"> <property name="cacheManager" ref="cacheManager" /> <property name="serviceLoader" ref="serviceLoader" /> </bean> <bean id="cacheManager" class="com.poscoict.glueframework.cache.ehcache.GlueEhCacheManager"> <property name="location" value="file:${CONFIG_PATH}/ehcache.xml"/> </bean> <bean id="serviceLoader" class="com.posco.glue.reuse.PoscoServiceLoader"> <property name="dataSource" ref="meta-service-dataSource"/> <property name="queryManager" ref="queryManager"/> <property name="queryExtraBindingInfo"> <list> <value>${M60A010WEB.serviceLoader.GCS_COMP_CODE}</value> </list> </property> </bean> <bean id="meta-service-dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/rw/M00A10DS"/> <property name="resourceRef" value="false"/> </bean> <bean id="queryManager" class="com.poscoict.glueframework.dao.manager.GlueQueryManagerImpl"> <property name="cacheManager" ref="cacheManager" /> <property name="queryLoader" ref="queryLoader" /> </bean> <bean id="queryLoader" class="com.poscoict.glueframework.dao.manager.GlueQueryLoader"> <property name="extraQueryFiles"> <list> <value>libquery/posco-meta-access-query.glue_sql</value> </list> </property> </bean> </beans>
다음을 참고해서 ehcache.xml 을 수정합니다. (참고)
<?xml version="1.0" encoding="UTF-8"?> <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="false" name="__DEFAULT__"> <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" properties="hostName=172.31.47.146, port=40001, socketTimeoutMillis=2000" /> <cache name="_default-region" maxElementsInMemory="500" eternal="true" /> <cache name="_sql-region" maxElementsInMemory="500" eternal="true" /> <cache name="_message-definition-region" maxElementsInMemory="500" eternal="true" /> <cache name="_service-region" maxElementsInMemory="500" eternal="false" maxElementsOnDisk="0" timeToIdleSeconds="0" timeToLiveSeconds="0" memoryStoreEvictionPolicy="LRU" > <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties="replicateAsynchronously=true, replicatePuts=false, replicateUpdates=false, replicateUpdatesViaCopy=false, replicateRemovals=false"> </cacheEventListenerFactory> </cache> <cache name="_column-region" maxElementsInMemory="500" eternal="true" /> </ehcache>