com.poscoict.glueframework.dao.manager
Class GlueQueryLoader

java.lang.Object
  extended by com.poscoict.glueframework.dao.manager.GlueQueryLoader
All Implemented Interfaces:
GlueCacheLoader, org.springframework.beans.factory.InitializingBean

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

Äõ¸®Á¤º¸(GlueQueryDefinition)¸¦ ·ÎµùÇÏ¿© ¼­ºñ½ºÇϴ Ŭ·¡½º.
config path¿¡ Á¸ÀçÇÏ´Â ¸ðµç xxx-query.glue_sql( or xxx-query.xml ) ÆÄÀÏ Á¤º¸¸¦ ·ÎµùÇÏ¿© GlueQueryDefinition À» »ý¼ºÇÑ ÈÄ java.util.HashMapÀ» ±¸¼ºÇÑ´Ù.
config path¿¡ Á¸ÀçÇÏ´Â query fileÀÇ naming ¹× È®ÀåÀÚ¿¡ À¯ÀÇÇÑ´Ù. Application do not use this class.

 bean property ¼³Á¤
 - rootPath : (¼±ÅÃ) default´Â 'query'
 
 - extraQueryFiles : (¼±ÅÃ)
 
 
 
 [sample]
 
 »ç¿ë¿¹ 1 : applicationÀÇ classpath¿¡¼­ query Æú´õ¿¡ ÀÖ´Â Äõ¸®ÆÄÀÏÀ» ·ÎµùÇÔ.
 <bean id="queryLoader" class="com.poscoict.glueframework.dao.manager.GlueQueryLoader"/>
 
 »ç¿ë¿¹ 2 : applicationÀÇ classpath¿¡¼­ rootPath ·Î ÁöÁ¤µÈ Æú´õ¿¡ ÀÖ´Â Äõ¸®ÆÄÀÏÀ» ·ÎµùÇÔ.
 <bean id="queryLoader" class="com.poscoict.glueframework.dao.manager.GlueQueryLoader">
   <property name="rootPath" value = "ext/query"/>
 </bean>
 
 »ç¿ë¿¹ 3 : applicationÀÇ classpath¿¡¼­ rootPath ·Î ÁöÁ¤µÈ property¿¡ ÇØ´çÇÏ´Â Æú´õ¿¡ ÀÖ´Â Äõ¸®ÆÄÀÏÀ» ·ÎµùÇÔ.
 <bean id="queryLoader" class="com.poscoict.glueframework.dao.manager.GlueQueryLoader">
   <property name="rootPath" value = "queryLoader.rootPath"/>
 </bean>
 queryLoader.rootPath=ext/query ¶ó°í glue.properties¿¡ Á¤ÀǵǾî ÀÖ¾î¾ß ÇÔ.
 
 »ç¿ë¿¹ 4 : applicationÀÇ classpathÀÇ rootPath¿ÜÀÇ query ÆÄÀÏÀ» ·ÎµùÇÔ.
 <bean id="queryLoader" class="com.poscoict.glueframework.dao.manager.GlueQueryLoader">
   <property name="extraQueryFiles">
     <list>
       <value>master-query/easyaccess-query.glue_sql</value>
     </list>
   </property>
 </bean>
 glue-master.jar¿¡ master-query/easyaccess-query.glue_sql ÀÌ ÀÖ°í, ÇØ´ç jarÆÄÀÏÀº classpath¿¡ ÀâÇô ÀÖÀ½.
 
 


Field Summary
protected static String QUERYMAP
          xxx-query.glue_sql
 
Constructor Summary
GlueQueryLoader()
           
 
Method Summary
 void afterPropertiesSet()
           
 String getRootPath()
          getter method.
 Object loadCacheObject(Object cacheKey, String regionName)
          ÁÖ¾îÁø ij½¬ ¿µ¿ª¸í¿¡ ÇØ´çÇϴ ij½¬¿µ¿ª¿¡¼­ ij½¬ Å°¸¦ »ç¿ëÇÏ¿© ¿ÀºêÁ§Æ®¸¦ ·ÎµùÇÔ
 void setExtraQueryFiles(List<String> extraQueryFiles)
          setter method for DI.
 void setPathEncoding(String pathEncoding)
          setter method for DI.
 void setRootPath(String queryRoot)
          setter method for DI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUERYMAP

protected static final String QUERYMAP
xxx-query.glue_sql

See Also:
Constant Field Values
Constructor Detail

GlueQueryLoader

public GlueQueryLoader()
Method Detail

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½¬°ü·Ã ¿¡·¯¹ß»ý ½Ã

setRootPath

public void setRootPath(String queryRoot)
setter method for DI.
 <bean id="queryLoader" class="com.poscoict.glueframework.dao.manager.GlueQueryLoader">
     <property name="rootPath" value="ext/query"/>
 </bean>
 

Parameters:
queryRoot - 2°¡Áö typeÀÌ °¡´É. directoryÀÇ ±¸ºÐÀÚ´Â ½½·¡½Ã(/)ÀÎÁö ¿ª½½·¡½Ã(\)ÀÎÁö È®ÀÎÇÊ¿äÇÔ.
 1. Class Loader¸¦ ÀÌ¿ëÇÑ »ó´ë°æ·Î ÁöÁ¤
 <property name="rootPath" value="ext/query"/> ÀÏ °æ¿ì 
     ==> Thread.currentThread().getContextClassLoader().getResource( "ext/query" ) °¡ »ç¿ëµÊ. 
 2. glue.properties ÀÌ¿ëÇÑ Àý´ë °æ·Î ÁöÁ¤
 
     ext/query=C://apache-tomcat-7.0.47
     ==> Thread.currentThread().getContextClassLoader().getResource( "C://apache-tomcat-7.0.47" ) °¡ »ç¿ëµÊ.
 

setExtraQueryFiles

public void setExtraQueryFiles(List<String> extraQueryFiles)
setter method for DI.

Parameters:
extraQueryFiles -

setPathEncoding

public void setPathEncoding(String pathEncoding)
setter method for DI.

Parameters:
pathEncoding -

getRootPath

public String getRootPath()
getter method.

Returns:
rootPath

afterPropertiesSet

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


Copyright © 2013–2014 POSCO ICT SWÁ¦Ç°±â¼úÆÀ. All rights reserved.