com.poscoict.glueframework.biz.control
Class GlueServiceDBLoader

java.lang.Object
  extended by com.poscoict.glueframework.biz.control.GlueServiceDBLoader
All Implemented Interfaces:
GlueCacheLoader, org.springframework.beans.factory.InitializingBean

public class GlueServiceDBLoader
extends Object
implements GlueCacheLoader, org.springframework.beans.factory.InitializingBean

CacheLoader ±¸Çöü. GlueServiceDBLoader´Â Cache¿¡¼­ ÇØ´ç Service°´Ã¼(GlueService)¸¦ ã°í ¾øÀ¸¸é DBÀ» Àо Cache¿¡ ÀúÀåÇÑ´Ù.

 Bean Property
 
 - dataSource : (Çʼö) 
 
 - queryManager : (¼±ÅÃ)
 
 - queryIdMap : (¼±ÅÃ) 
 
 
 ¿¹Á¦
 »ç¿ë ¿¹# 1 : Á¦°øµÈ TableÀ» »ç¿ëÇÏ´Â °æ¿ì
 
     <bean id="serviceLoader" class="com.poscoict.glueframework.biz.control.GlueServiceDBLoader">
         <property name="dataSource" ref="dataSource"/>
     </bean>
     <bean id="dataSource" .../>
 
 
 »ç¿ë ¿¹# 2 : glue-core¿¡ Æ÷ÇÔµÈ query fileÀ» ·ÎµùÇؼ­ »ç¿ëÇÒ °æ¿ì.
 
     <bean id="serviceLoader" class="com.poscoict.glueframework.biz.control.GlueServiceDBLoader">
         <property name="dataSource" ref="dataSource"/>
         <property name="queryManager" ref="queryManager"/>
     </bean>
     <bean id="dataSource" .../>
     <bean id="queryManager" class="com.poscoict.glueframework.dao.manager.GlueQueryManagerImpl">
         <property name="cacheManager" ref="cacheManager" />
         <property name="queryLoader" ref="queryLoader" />
     </bean>
     <bean id="cacheManager" .../>
     <bean id="queryLoader" class="com.poscoict.glueframework.dao.manager.GlueQueryLoader">
         <property name="extraQueryFiles">
             <list>
                 <value>com/poscoict/glueframework/biz/control/GlueServiceDBLoader-query.glue_sql</value>
             </list>
         </property>
     </bean>
 
 
 »ç¿ë ¿¹#3 : Table¸¦ Customizing ÇÑ °æ¿ì, query fileÀ» Ãß°¡Çؼ­ »ç¿ëÇÏ´Â °æ¿ì.
 
     <bean id="serviceLoader" class="com.poscoict.glueframework.biz.control.GlueServiceDBLoader">
         <property name="dataSource" ref="dataSource"/>
         <property name="queryManager" ref="queryManager"/>
         <property name="queryIdMap">
             <map>
                 <entry key="serviceList" value="meta.service.list.select" />
                 <entry key="serviceInfo" value="meta.service.select" />
                 <entry key="transactionManagerInfo" value="meta.tx.select" />
                 <entry key="activityList" value="meta.activity.select" />
                 <entry key="transitionInfo" value="meta.transition.select" />
                 <entry key="propertyInfo" value="meta.property.select" />
             </map>
         </property>
     </bean>
     <bean id="dataSource" .../>
     <bean id="queryManager" class="com.poscoict.glueframework.dao.manager.GlueQueryManagerImpl">
         <property name="cacheManager" ref="cacheManager" />
         <property name="queryLoader" ref="queryLoader" />
     </bean>
     <bean id="cacheManager" .../>
     <bean id="queryLoader" class="com.poscoict.glueframework.dao.manager.GlueQueryLoader">
         <property name="extraQueryFiles">
             <list>
                 <value>query_user/serviceLoader-query.glue_sql</value>
             </list>
         </property>
     </bean>
 
 
 
 Âü°í : serviceLoader-query.glue_sql 
      - isNamed="false"ÀÓ. 
      - 6°³ÀÇ query¸¦ ÀÛ¼ºÇϸç, bindinigÀº ¼ø¼­¿Í °³¼ö´Â ¸ÂÃç¾ßÇÔ. 
      - column name ÀÌ ´Ù¸£¸é alias¸¦ ÀÌ¿ëÇØ ¸ÂÃç¾ß ÇÔ.
 
     <?xml version="1.0" encoding="UTF-8"?>
     <queryMap desc="serviceLoader¿ë SQL ¿¹Á¦" xmlns="http://www.poscoict.com/glueframework/query">
         <query id="meta.service.list.select" desc="" resultType="" isNamed="false"><![CDATA[select SERVICE_NAME from SERVICE_INFO]]></query>
         <query id="meta.service.select" desc="" resultType="" isNamed="false"><![CDATA[select INITIAL_ACTIVITY from SERVICE_INFO where SERVICE_NAME=?]]></query>
         <query id="meta.tx.select" desc="" resultType="" isNamed="false"><![CDATA[select TX_NAME, TX_VAL from SERVICE_TX_MAPPING where SERVICE_NAME=?]]></query>
         <query id="meta.activity.select" desc="" resultType="" isNamed="false"><![CDATA[select ACTIVITY_NAME, ACTIVITY_CLASS from SERVICE_ACTIVITY_INFO where SERVICE_NAME=?]]></query>
         <query id="meta.transition.select" desc="" resultType="" isNamed="false"><![CDATA[select TRANSITION_NAME, TRANSITION_VAL from SERVICE_ACTIVITY_FLOW where SERVICE_NAME=? and ACTIVITY_NAME=?]]></query>
         <query id="meta.property.select" desc="" resultType="" isNamed="false"><![CDATA[select PROPERTY_NAME, PROPERTY_VAL from SERVICE_ACTIVITY_PROPERTY where SERVICE_NAME=? and ACTIVITY_NAME=?]]></query>
     </queryMap>
 


Constructor Summary
GlueServiceDBLoader()
          »ý¼ºÀÚ(constructor).
 
Method Summary
 void afterPropertiesSet()
           
 Object loadCacheObject(Object cacheKey, String regionName)
          ÁÖ¾îÁø ij½¬ ¿µ¿ª¸í¿¡ ÇØ´çÇϴ ij½¬¿µ¿ª¿¡¼­ ij½¬ Å°¸¦ »ç¿ëÇÏ¿© ¿ÀºêÁ§Æ®¸¦ ·ÎµùÇÔ
 void setDataSource(DataSource dataSource)
          setter method for DI.
 void setQueryInfoMap(Map<String,String> queryInfoMap)
          setter method for DI.
 void setQueryManager(GlueQueryManager queryManager)
          setter method for DI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlueServiceDBLoader

public GlueServiceDBLoader()
»ý¼ºÀÚ(constructor).

Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
setter method for DI.

Parameters:
dataSource -

setQueryManager

public void setQueryManager(GlueQueryManager queryManager)
setter method for DI.

Parameters:
queryManager -

setQueryInfoMap

public void setQueryInfoMap(Map<String,String> queryInfoMap)
setter method for DI.

Parameters:
queryInfoMap -

loadCacheObject

public Object loadCacheObject(Object cacheKey,
                              String regionName)
                       throws GlueException
Description copied from interface: GlueCacheLoader
ÁÖ¾îÁø ij½¬ ¿µ¿ª¸í¿¡ ÇØ´çÇϴ ij½¬¿µ¿ª¿¡¼­ ij½¬ Å°¸¦ »ç¿ëÇÏ¿© ¿ÀºêÁ§Æ®¸¦ ·ÎµùÇÔ

Specified by:
loadCacheObject in interface GlueCacheLoader
Parameters:
cacheKey - ij½¬ Å°
regionName - ij½¬ ¿µ¿ª¸í
Returns:
ij½¬µÈ ¿ÀºêÁ§Æ®
Throws:
GlueException - - ij½¬°ü·Ã ¿¡·¯¹ß»ý ½Ã

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception


Copyright © 2013–2017 POSCO ICT. All rights reserved.