목차 >> Core 
+- Glue Service  
+- GlueContext  
+- GlueActivity  
+- GlueStaticContext

5장 Core

GlueStaticContext

GlueContext는 임시 데이타 저장소로써 Glue Service 단위로 Control layer에서 생성되어 사용된다면, GlueStaticContext는 Application 전 영역에서 사용하는 객체(또는 데이타)에 접근할 수 있습니다 (GlueAPI 참고).

그림 : GlueStaticContext
GlueStaticContext

GlueStaticContext를 다음과 관련된 api를 제공하고 있습니다.

  1. getBeanFactory()

    applicationContext.xml 에 정의되어 있는 bean 오브젝트에 접근할 수 있습니다.

    • applicationConext.xml 예제
      <beans ...>
          <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=.../>
          <bean id="serviceLoader" class="com.poscoict.glueframework.biz.control.GlueServiceLoader"/>
      </beans>
      
    • java code 예제
      ...
      GlueCacheManager cacheManager
       = GlueStaticContext.getBeanFactory().getBeanObject("cacheManager", GlueCacheManager.class);
      ...
      
  2. getSystemProperty()
    getGlueProperty()
    getCustomProperty()

    Java Option, Glue Property, Custom Property에 접근할 수 있습니다.

    • java code 예제
      public class MainClass{
          public static void main(String[] arg){
              String key = "CONFIG_PATH";
              String value = GlueStaticContext.getSystemProperty(key);
              System.out.println("System Property : "+key+"="+value);
      
              key = "company";
              value = GlueStaticContext.getSystemProperty(key);
              System.out.println("System Property : "+key+"="+value);
      
              key = "msg.parsing.type";
              value = GlueStaticContext.getGlueProperty(key);
              System.out.println("Glue Property : "+key+"="+value);
      
              key = "biz.server.type";
              value = GlueStaticContext.getGlueProperty(key);
              System.out.println("Glue Property : "+key+"="+value);
      
              key = "biz.server.type";
              value = GlueStaticContext.getCustomProperty(key);
              System.out.println("Custom Property : "+key+"="+value);
      
              key = "biz.sso";
              value = GlueStaticContext.getCustomProperty(key);
              System.out.println("Custom Property : "+key+"="+value);
          }
      }
      
    • glue.properties 예제 : Java Option으로 CONFIG_PATH를 통해 파일 경로를 설정함.
      msg.parsing.type=byte
      biz.server.type=development
      glue.custom.property=C:\tmp\biz.properties
      
    • biz.properties 예제 : glue.properties의 glue.comstom.property 값에 파일명 및 경로가 설정됨.
      biz.server.type=test
      biz.sso=true
      
    • java 명령어 예제 : -D 옵션을 지정함.
      java -DCONFIG_PATH=C:\tmp -Dcompany=poscoict ...중략... MainClass
      
  3. checkLicense()
    getLicenseMode()

    라이선스의 유효여부와 라이선스모드를 얻어올수 있습니다.

^L

Prev Home Next