com.poscoict.glueframework.biz.activity
Class GlueSubService

java.lang.Object
  extended by com.poscoict.glueframework.biz.activity.GlueActivity<GlueContext>
      extended by com.poscoict.glueframework.biz.activity.GlueSubService

public class GlueSubService
extends GlueActivity<GlueContext>

SubService Acitivity. GlueSubService Class는 Sub Service를 호출하여 실행 한다.

 Activity Property
 
 - service-name : (필수) 실행하고자 하는 GlueService.
 
 - new-transaction : (선택) true, false.
                   실행하고자 하는 GlueService에서의 transaction-manager 사용 여부.
                   true 일 경우 해당 activity는 success와 failure transition을 둘다 필요로 함.
                   true 일 경우 실행하고자 하는 GlueService의 transaction-manager(GlueTransactionManager) 의 changeTransaction() 이 실행됨. 
                   default 는 false임.
 
 - new-thread-join : (선택) true, false.
                   실행하고자 하는 GlueService를 별도의 User Thread로 분리해서, User Thread가 종료될때까지 기다릴지 여부.
                   new-transaction property와 같이 사용할 수 없음.
                   실행하고자 하는 GlueService의 실행 결과와 무관하게 다음 transition은 success임.
 
 
 예제
 사용 예# 1
 
     <activity name="CallSubController" class="com.poscoict.glueframework.biz.activity.GlueSubService">
         <property name="service-name" value="sub-service"/>
         <transition name="success" value="BizLogic"/>
     </activity>
 
 
 사용 예# 2
 
     <activity name="CallSubController" class="com.poscoict.glueframework.biz.activity.GlueSubService">
         <property name="service-name" value="sub-service"/>
         <property name="new-transaction" value="true"/>
         <transition name="success" value="BizLogicSuccess"/>
         <transition name="failure" value="BizLogicFailure"/>
     </activity>
 
 
 사용 예# 3
 
     <activity name="CallSubController" class="com.poscoict.glueframework.biz.activity.GlueSubService">
         <property name="service-name" value="sub-service"/>
         <property name="new-thread-join" value="true"/>
         <transition name="success" value="BizLogicSuccess"/>
         <transition name="failure" value="BizLogicFailure"/>
     </activity>
 
 
 
 
 참고 : applicationContext.xml 일부
 
     <beans ...>
         <bean id="dao-1" class="com.poscoict.glueframework.dao.jdbc.GlueJdbcDao">
             <property name="dataSource" ref="ds-1"/>
             ...
         </bean>
         <bean id="tx-1" class="com.poscoict.glueframework.transaction.GlueDataSourceTransactionManager">
             <property name="dataSource" ref="ds-1"/>
         </bean>
         <bean id="ds-1" .../>
         <bean id="dao-2" class="com.poscoict.glueframework.dao.jdbc.GlueJdbcDao">
             <property name="dataSource" ref="ds-2"/>
             ...
         </bean>
         <bean id="tx-2" class="com.poscoict.glueframework.transaction.GlueDataSourceTransactionManager">
             <property name="dataSource" ref="ds-2"/>
         </bean>
         <bean id="ds-2" .../>
         ...
     </beans>
 
 
 참고 : main-service.xml 일부
 
     <service ...>
         <transaction-manager id="tx-1" commit="true"/>
         ...
     </service>
 
 
 참고 : sub-service.xml 일부
 
     <service ...>
         <transaction-manager id="tx-2" commit="true"/>
         ...
     </service>
 
 


Nested Class Summary
protected  class GlueSubService.GlueUserThread
           
 
Field Summary
 
Fields inherited from class com.poscoict.glueframework.biz.activity.GlueActivity
dynamicProperties, logger
 
Constructor Summary
GlueSubService()
           
 
Method Summary
 String runActivity(GlueContext ctx)
          GlueService를 실행한다.
 
Methods inherited from class com.poscoict.glueframework.biz.activity.GlueActivity
commitTransaction, commitTransaction, getDao, getEventList, getName, getProperty, getPropertyNames, getTransition, rollbackTransaction, rollbackTransaction, setEventList, setName, setProperty, setTransition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlueSubService

public GlueSubService()
Method Detail

runActivity

public String runActivity(GlueContext ctx)
GlueService를 실행한다.
새로운 Thread에서 GlueService를 실행할 수도 있으며, 현재 Thread에서 GlueService를 실행할 수도 있다.
현재 Thread에서 GlueService를 실행할 경우, GlueBizController 의 doSubController() 가 사용되며, GlueContext가 공유된다.
새로운 Thread에서 GlueServic를 실행할 경우, GlueBizController 의 doAction() 이 사용되며, GlueContext를 새로 생성(복제)한다.

Specified by:
runActivity in class GlueActivity<GlueContext>
Parameters:
ctx - GlueContext
Returns:
String Transition Name


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