com.poscoict.glueframework.context
Class GlueStaticContext

java.lang.Object
  extended by com.poscoict.glueframework.context.GlueStaticContext

public final class GlueStaticContext
extends Object

°¢Á¾ °íÁ¤Á¤º¸¿¡ Á¢±ÙÇÏ´Â Class. ÀÌ Class´Â IoC¿ë XMLÀº applicationContext.xml ¿¡ ±Ù°Å¿¡ Bean ÀνºÅϽº°¡ »ý¼ºµÇ¸ç »ç¿ëµÈ´Ù. ÀÌ Class´Â ±×¿Ü Property Á¤º¸¿¡ ´ëÇÑ API¸¦ Á¦°øÇÑ´Ù. ±×¿Ü IoC¿ë XMLÀÇ Bean ÀνºÅϽº´Â GlueBeanFactory¸¦ ÀÌ¿ëÇÏ´Â º°°³ÀÇ ¸ðµâÀ» ÇÊ¿äÇÏ´Ù.


Field Summary
static String config
           
 
Constructor Summary
GlueStaticContext()
           
 
Method Summary
static boolean checkLicense()
          ¶óÀ̼±½º À¯È¿¿©ºÎ¸¦ È®ÀÎÇÑ´Ù.
static void destroyApplictionContext()
          applicationContext.xml¿¡ Á¤ÀÇ µÇ¾î ÀÖ´Â Bean Class¸¦ ¼Ò¸ê½ÃŲ´Ù.
static GlueBeanFactory getBeanFactory()
          applicationContext.xml¿¡ Á¤ÀÇ µÇ¾î ÀÖ´Â Bean Class¸¦ È£Ãâ Çϱâ À§ÇÑ GlueBeanFactory¸¦ Return ÇÑ´Ù.
static String getCustomProperty(String key)
          Custom Properties ÆÄÀÏ¿¡¼­ key¿¡ ÇØ´çÇÏ´Â ÇÁ·ÎÆÛƼ¸¦ ¾ò´Â´Ù.
static Locale getDefaultLocale(String localeInfo)
          ÀԷ°ª¿¡ ±Ù°ÅÇÑ Locale
static Locale getDefaultUILocale()
          glue.propertiesÀÇ property "default.ui.locale" ¿¡ ±Ù°ÅÇÑ Locale
static String getGlueProperty(String key)
          glue.properties¿¡¼­ Key¿¡ ÇØ´çÇÏ´Â Property °ªÀ» Return ÇÑ´Ù.
static com.poscoict.license.LicenseAPI.LicenseMode getLicenseMode()
          ¶óÀ̼±½º ¸ðµå¸¦ ¹ÝȯÇÑ´Ù.
static String getResourceMessage(String key)
          LocaleÁ¤º¸¿¡ ±Ù°ÅÇÑ ´Ù±¹¾î Áö¿ø Method.
static String getResourceMessage(String key, Locale locale)
          LocaleÁ¤º¸¿¡ ±Ù°ÅÇÑ ´Ù±¹¾î Áö¿ø Method.
static String getResourceMessage(String key, Object[] arguments)
          LocaleÁ¤º¸¿¡ ±Ù°ÅÇÑ ´Ù±¹¾î Áö¿ø Method.
static String getResourceMessage(String key, Object[] arguments, Locale locale)
          LocaleÁ¤º¸¿¡ ±Ù°ÅÇÑ ´Ù±¹¾î Áö¿ø Method.
static String getResourceMessage(String beanName, String key, Object[] arguments, Locale locale)
          LocaleÁ¤º¸¿¡ ±Ù°ÅÇÑ ´Ù±¹¾î Áö¿ø Method.
static String getSystemProperty(String key)
          SystemProperty´Â java¸¦ ½ÇÇà½Ã -D OptionÀ¸·Î Á¤ÀÇÇÑ Property¸¦ ÀÇ¹Ì ÇÑ´Ù.
static String getTimeZoneFormat(Date date, int offset)
          ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£ Ç¥Çö Method.
static String getTimeZoneFormat(Date date, int offset, String textformate)
          ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£ Ç¥Çö Method.
static String getTimeZoneFormat(Date date, String timezoneid)
          ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£ Ç¥Çö Method.
static String getTimeZoneFormat(Date date, String timezoneid, String textformate)
          ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£ Ç¥Çö Method.
static boolean isAudit()
          Audit ¼³Á¤ À¯¹« È®ÀÎ. glue.properties ÆÄÀÏ¿¡ "audit.insert.key" ¿Í "audit.update.key" ÀÇ Á¸Àç À¯¹«
static void reloadGlueProperties()
          glue.properties ¸¦ ´Ù½Ã loading ÇÏ´Â method.
static void reloadLicense()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

public static final String config
See Also:
Constant Field Values
Constructor Detail

GlueStaticContext

public GlueStaticContext()
Method Detail

reloadLicense

public static void reloadLicense()

reloadGlueProperties

public static void reloadGlueProperties()
glue.properties ¸¦ ´Ù½Ã loading ÇÏ´Â method.


getBeanFactory

public static GlueBeanFactory getBeanFactory()
applicationContext.xml¿¡ Á¤ÀÇ µÇ¾î ÀÖ´Â Bean Class¸¦ È£Ãâ Çϱâ À§ÇÑ GlueBeanFactory¸¦ Return ÇÑ´Ù.
»ç¿ë ¹æ¹ýÀº ´ÙÀ½°ú °°´Ù.
 GlueBeanFactory beanFactory = GlueStaticContext.getBeanFactory();
 GlueGenericDao dao = (GlueGenericDao)beanFactory.getBeanObject("bizdao");
 
 À§ ³»¿ëÀº applicatonContext.xml¿¡ ´ÙÀ½°ú °°ÀÌ Á¤ÀÇ µÇ¾î ÀÖ´Â °æ¿ì
 com.poscoict.glueframework.dao.jdbc.GlueJdbcDao¸¦ Return ÇÏ°Ô µÈ´Ù.
 
 <bean id="bizdao" class="com.poscoict.glueframework.dao.jdbc.GlueJdbcDao">
    <property name="dataSource" ref="dataSource"/>
    <property name="queryManager" ref="queryManager"/>
 </bean>
 
 

Returns:
GlueBeanFactory BeanFactory

destroyApplictionContext

public static void destroyApplictionContext()
applicationContext.xml¿¡ Á¤ÀÇ µÇ¾î ÀÖ´Â Bean Class¸¦ ¼Ò¸ê½ÃŲ´Ù.


getSystemProperty

public static String getSystemProperty(String key)
SystemProperty´Â java¸¦ ½ÇÇà½Ã -D OptionÀ¸·Î Á¤ÀÇÇÑ Property¸¦ ÀÇ¹Ì ÇÑ´Ù.
System.getProperty(key)¿Í µ¿ÀÏÇÑ Return °ªÀ» °¡Áø´Ù.

Parameters:
key - System Property key
Returns:
String System Property value

getGlueProperty

public static String getGlueProperty(String key)
glue.properties¿¡¼­ Key¿¡ ÇØ´çÇÏ´Â Property °ªÀ» Return ÇÑ´Ù.
glue.propertiesÀÇ ³»¿ëÀº key=value·Î µÇ¾î ÀÖ°í ÇØ´ç ÆÄÀÏÀº ¹Ýµå½Ã CONFIG_PATH¿¡ Á¸Àç ÇÏ¿©¾ß ÇÑ´Ù.

Parameters:
key - glue.propertiesÀÇ key °ª
Returns:
String User Property Value

getCustomProperty

public static String getCustomProperty(String key)
Custom Properties ÆÄÀÏ¿¡¼­ key¿¡ ÇØ´çÇÏ´Â ÇÁ·ÎÆÛƼ¸¦ ¾ò´Â´Ù.
Custom Properties ÆÄÀÏ ÁöÁ¤ ¹æ¹ý: glue.properties ÆÄÀÏ¿¡ glue.custom.property=d:\\config\\custom.properties ¶ó°í ÁöÁ¤ÇÑ´Ù. ÇÁ·ÎÆÛƼ ÆÄÀÏÀ§Ä¡ ¹× ÆÄÀϸíÀº User°¡ ÀÓÀÇ·Î ºÎ¿©ÇÒ ¼ö ÀÖ´Ù.

Parameters:
key - ÇÁ·ÎÆÛƼ Å°
Returns:
ÇÁ·ÎÆÛƼ °ª

getTimeZoneFormat

public static String getTimeZoneFormat(Date date,
                                       int offset)
ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£ Ç¥Çö Method. Text FormatÀº Default °ª(yyyy-MM-dd HH:mm:ss (z Z))

Parameters:
date - Text ÇüÅ·Πº¯È¯ ÇÒ Date
timezoneid - Text ÇüÅ·Πº¯È¯ ½Ã Àû¿ë ÇÒ TimeZone ½Ã°£´ë offset°ª
Returns:
ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£

getTimeZoneFormat

public static String getTimeZoneFormat(Date date,
                                       int offset,
                                       String textformate)
ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£ Ç¥Çö Method.
 1. »ç¿ë¹ý(Java Code)
 Date date = new Date();
 String textformat = "yyyy-MM-dd HH:mm:ss (z Z)";
 System.out.println("+05:00::::"+GlueStaticContext.getTimeZoneFormat(date, 5*60, textformat));
 System.out.println("-06:00::::"+GlueStaticContext.getTimeZoneFormat(date, -6*60, textformat));
 

Parameters:
date - Text ÇüÅ·Πº¯È¯ ÇÒ Date
offset - Text ÇüÅ·Πº¯È¯ ½Ã Àû¿ë ÇÒ TimeZone ½Ã°£´ë offset°ª
textformate - Text ÇüÅ·Πº¯È¯ ½Ã Àû¿ë µÉ Text Format (Default °ª : yyyy-MM-dd HH:mm:ss (z Z))
Returns:
ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£

getTimeZoneFormat

public static String getTimeZoneFormat(Date date,
                                       String timezoneid)
ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£ Ç¥Çö Method. Text FormatÀº Default °ª(yyyy-MM-dd HH:mm:ss (z Z))

Parameters:
date - Text ÇüÅ·Πº¯È¯ ÇÒ Date
timezoneid - Text ÇüÅ·Πº¯È¯ ½Ã Àû¿ë ÇÒ TimeZone ID
Returns:
ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£

getTimeZoneFormat

public static String getTimeZoneFormat(Date date,
                                       String timezoneid,
                                       String textformate)
ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£ Ç¥Çö Method.
 1. »ç¿ë¹ý(Java Code)
 Date date = new Date();
 String textformat = "yyyy-MM-dd HH:mm:ss (z Z)";
 System.out.println("Default::::" + GlueStaticContext.getTimeZoneFormat(date, TimeZone.getDefault().getID(), textformat));
 System.out.println("Asia/Seoul::::" + GlueStaticContext.getTimeZoneFormat(date, "Asia/Seoul", textformat));
 System.out.println("Canada/Eastern::::"+GlueStaticContext.getTimeZoneFormat(date, "Canada/Eastern", textformat));
 System.out.println("Asia/Shanghai::::" + GlueStaticContext.getTimeZoneFormat(date, "Asia/Shanghai", textformat));
 
 

Parameters:
date - Text ÇüÅ·Πº¯È¯ ÇÒ Date
timezoneid - Text ÇüÅ·Πº¯È¯ ½Ã Àû¿ë ÇÒ TimeZone ID
textformate - Text ÇüÅ·Πº¯È¯ ½Ã Àû¿ë µÉ Text Format (Default °ª : yyyy-MM-dd HH:mm:ss (z Z))
Returns:
ÇØ´ç TimeZone ±âÁØ ³¯Â¥.½Ã°£

getResourceMessage

public static String getResourceMessage(String key)
LocaleÁ¤º¸¿¡ ±Ù°ÅÇÑ ´Ù±¹¾î Áö¿ø Method.
 1. applicationContext.xml ÀÇ messageSource bean Á¤ÀÇ
 <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
     <property name="basenames">
         <list>
             <value>MyResource</value>
         </list>
     </property>
 </bean>
 
 
 2. MyResource_{locale}.properties ÆÄÀÏ »ý¼º
 - MyResource_ko_KR.properties ÀÇ ³»¿ë
 msg001=¾È³çÇϼ¼¿ä
 msg002={0}´Ô, ¾È³çÇϼ¼¿ä. {1}¹ø° Á¢¼ÓÀÔ´Ï´Ù.
 
 - MyResource_en_US.properties ÀÇ ³»¿ë
 msg001=Hello
 msg002=Hi, {0}!. {1} times.
 - ...
 
 3. »ç¿ë¹ý(Java Code)
 String str = GlueStaticContext.getResourceMessage("msg001");
 

Parameters:
key -
Returns:

getResourceMessage

public static String getResourceMessage(String key,
                                        Object[] arguments)
LocaleÁ¤º¸¿¡ ±Ù°ÅÇÑ ´Ù±¹¾î Áö¿ø Method.
 1. applicationContext.xml ÀÇ messageSource bean Á¤ÀÇ
 <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
     <property name="basenames">
         <list>
             <value>MyResource</value>
         </list>
     </property>
 </bean>
 
 
 2. MyResource_{locale}.properties ÆÄÀÏ »ý¼º
 - MyResource_ko_KR.properties ÀÇ ³»¿ë
 msg001=¾È³çÇϼ¼¿ä
 msg002={0}´Ô, ¾È³çÇϼ¼¿ä. {1}¹ø° Á¢¼ÓÀÔ´Ï´Ù.
 
 - MyResource_en_US.properties ÀÇ ³»¿ë
 msg001=Hello
 msg002=Hi, {0}!. {1} times.
 - ...
 
 3. »ç¿ë¹ý(Java Code)
 Object obj[] = new Object[]{new String("admin"),new Integer(3)};
 String str = GlueStaticContext.getResourceMessage("msg002", arg);
 

Parameters:
key -
arguments -
Returns:

getResourceMessage

public static String getResourceMessage(String key,
                                        Locale locale)
LocaleÁ¤º¸¿¡ ±Ù°ÅÇÑ ´Ù±¹¾î Áö¿ø Method.
 1. applicationContext.xml ÀÇ messageSource bean Á¤ÀÇ
 <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
     <property name="basenames">
         <list>
             <value>MyResource</value>
         </list>
     </property>
 </bean>
 
 
 2. MyResource_{locale}.properties ÆÄÀÏ »ý¼º
 - MyResource_ko_KR.properties ÀÇ ³»¿ë
 msg001=¾È³çÇϼ¼¿ä
 msg002={0}´Ô, ¾È³çÇϼ¼¿ä. {1}¹ø° Á¢¼ÓÀÔ´Ï´Ù.
 
 - MyResource_en_US.properties ÀÇ ³»¿ë
 msg001=Hello
 msg002=Hi, {0}!. {1} times.
 - ...
 
 3. »ç¿ë¹ý(Java Code)
 String str = GlueStaticContext.getResourceMessage("msg001", Locale.getDefault());
 

Parameters:
key -
locale -
Returns:

getResourceMessage

public static String getResourceMessage(String key,
                                        Object[] arguments,
                                        Locale locale)
LocaleÁ¤º¸¿¡ ±Ù°ÅÇÑ ´Ù±¹¾î Áö¿ø Method.
 1. applicationContext.xml ÀÇ messageSource bean Á¤ÀÇ
 <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
     <property name="basenames">
         <list>
             <value>MyResource</value>
         </list>
     </property>
 </bean>
 
 
 2. MyResource_{locale}.properties ÆÄÀÏ »ý¼º
 - MyResource_ko_KR.properties ÀÇ ³»¿ë
 msg001=¾È³çÇϼ¼¿ä
 msg002={0}´Ô, ¾È³çÇϼ¼¿ä. {1}¹ø° Á¢¼ÓÀÔ´Ï´Ù.
 
 - MyResource_en_US.properties ÀÇ ³»¿ë
 msg001=Hello
 msg002=Hi, {0}!. {1} times.
 - ...
 
 3. »ç¿ë¹ý(Java Code)
 Object obj[] = new Object[]{new String("admin"),new Integer(3)};
 String str = GlueStaticContext.getResourceMessage("msg002", arg, Locale.getDefault());
 

Parameters:
key -
arguments -
locale -
Returns:

getResourceMessage

public static String getResourceMessage(String beanName,
                                        String key,
                                        Object[] arguments,
                                        Locale locale)
LocaleÁ¤º¸¿¡ ±Ù°ÅÇÑ ´Ù±¹¾î Áö¿ø Method.
 1. applicationContext.xml ÀÇ messageSource bean Á¤ÀÇ
 <bean id="msgSrc" class="org.springframework.context.support.ResourceBundleMessageSource">
     <property name="basenames">
         <list>
             <value>MyResource</value>
         </list>
     </property>
 </bean>
 
 
 2. MyResource_{locale}.properties ÆÄÀÏ »ý¼º
 - MyResource_ko_KR.properties ÀÇ ³»¿ë
 msg001=¾È³çÇϼ¼¿ä
 msg002={0}´Ô, ¾È³çÇϼ¼¿ä. {1}¹ø° Á¢¼ÓÀÔ´Ï´Ù.
 
 - MyResource_en_US.properties ÀÇ ³»¿ë
 msg001=Hello
 msg002=Hi, {0}!. {1} times.
 - ...
 
 3. »ç¿ë¹ý(Java Code)
 Object obj[] = new Object[]{new String("admin"),new Integer(3)};
 String str = GlueStaticContext.getResourceMessage("msgSrc", "msg002", arg, Locale.getDefault());
 

Parameters:
beanName - - bean id°¡ "messageSource" ÀÌ ¾Æ´Ñ °æ¿ìÀÇ bean id.
key -
arguments -
locale -
Returns:

getDefaultUILocale

public static Locale getDefaultUILocale()
glue.propertiesÀÇ property "default.ui.locale" ¿¡ ±Ù°ÅÇÑ Locale

Returns:
default ui Locale

getDefaultLocale

public static Locale getDefaultLocale(String localeInfo)
ÀԷ°ª¿¡ ±Ù°ÅÇÑ Locale

Parameters:
localeInfo - "ko_KR" ÇüÅÂÀÇ ¹®ÀÚ¿­.
Returns:
localeInfo¸¦ "_"·Î ±¸ºÐÇؼ­ new Locale("ko", "KR")·Î ÇÔ.

isAudit

public static boolean isAudit()
Audit ¼³Á¤ À¯¹« È®ÀÎ. glue.properties ÆÄÀÏ¿¡ "audit.insert.key" ¿Í "audit.update.key" ÀÇ Á¸Àç À¯¹«

Returns:
trueÀ̸é Audit ¼³Á¤ °¡´É

getLicenseMode

public static com.poscoict.license.LicenseAPI.LicenseMode getLicenseMode()
¶óÀ̼±½º ¸ðµå¸¦ ¹ÝȯÇÑ´Ù.

Returns:
¶óÀ̼±½º ¸ðµå (EDUCATION, DEVELOPEMENT, PRODUCT)

checkLicense

public static boolean checkLicense()
¶óÀ̼±½º À¯È¿¿©ºÎ¸¦ È®ÀÎÇÑ´Ù.

Returns:
¶óÀ̼±½º À¯È¿¿©ºÎ


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