com.poscoict.glueframework.biz.control
Class GlueBizControllerImpl

java.lang.Object
  extended by com.poscoict.glueframework.biz.control.GlueBizControllerImpl
All Implemented Interfaces:
GlueBizController

public final class GlueBizControllerImpl
extends Object
implements GlueBizController

BizController ±¸Çöü.
GlueBizController´Â Web,Non Web App °øÅëÀ¸·Î »ç¿ëµÇ¸ç Transactionó¸® ¹× LoggingÀ» ó¸® ÇÏ°í ¼öÇà °á°ú´Â GlueContext ¿¡ ¹Ý¿µÇÑ´Ù.

 ¿¹Á¦
 »ç¿ë ¿¹# 1
 
     GlueContext ctx = new GlueDefaultContext();
     ctx.put("ServiceName", "sample-service");
     GlueBizProvider.getController().doAction(ctx);
 
 
 
 Âü°í : applicationContext.xml
 
     <bean id="serviceManager" class="com.poscoict.glueframework.biz.control.GlueServiceManagerImpl">
         <property name="cacheManager" ref="cacheManager" />
         <property name="serviceLoader" ref="serviceLoader" />
     </bean>
     <bean id="serviceLoader" class="com.poscoict.glueframework.biz.control.GlueServiceLoader"/>
     <bean id="cacheManager" class="..."/>
 


Method Summary
 GlueContext doAction(GlueContext ctx)
          TransactionÀ» ó¸®¿Í LoggingÀ» ó¸® ÇÏ°í Service¸¦ ½ÇÇà ÇÑ´Ù.
 GlueContext doSubController(GlueContext ctx, boolean newTx)
          doAction()°ú µ¿ÀÏÇÏÁö¸¸ Transaction 󸮴 Á¤ÀÇ¿¡ µû¶ó ´Þ¶óÁø´Ù.
static GlueBizController getController()
          GlueBizController Instance¸¦ »ý¼º ÇÏ°í Return ÇÔ.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getController

public static GlueBizController getController()
GlueBizController Instance¸¦ »ý¼º ÇÏ°í Return ÇÔ.
Controller Instance´Â Singletone PatternÀ¸·Î ÃÖÃÊ Çѹø¸¸ »ý¼ºµÊ.

Returns:
GlueBizController

doAction

public GlueContext doAction(GlueContext ctx)
Description copied from interface: GlueBizController
TransactionÀ» ó¸®¿Í LoggingÀ» ó¸® ÇÏ°í Service¸¦ ½ÇÇà ÇÑ´Ù.
TransactionÀº {xxx}-service.xml ¿¡ ´ÙÀ½°ú °°ÀÌ Á¤ÀÇ µÈ´Ù.
 <transaction-manager id="tx1" commit="true"/>
 <transaction-manager id="tx2" commit="false"/>
 
 À§ÀÇ Transaction List ¸¸Å­ Commit ¹× RollbackÀ» ¼öÇàÇÏ°í
 ¸¸ÀÏ commit="false"À̸é CommitÀ» ¼öÇàÇÏÁö ¾Ê´Â´Ù.
 commit="false" ¸¦ »ç¿ëÇÏ´Â °æ¿ì¿¡´Â Read Only °æ¿ì¿¡ »ç¿ëµÈ´Ù.
 ½ÇÁ¦ TransactionÀÇ Á¤ÀÇ´Â applicationContext.xml¿¡ ´ÙÀ½°ú °°ÀÌ Á¤ÀÇ µÈ´Ù.
 
 <bean id="tx1" class="com.poscoict.glueframework.transaction.GlueDataSourceTransactionManager">
     <property name="dataSource" ref="ds-1"/> 
 </bean>
 <bean id="tx2" class="com.poscoict.glueframework.transaction.GlueDataSourceTransactionManager">
     <property name="dataSource" ref="ds-2"/>
 </bean>
 

Specified by:
doAction in interface GlueBizController
Parameters:
ctx - GlueContext
Returns:
GlueContext °á°ú °ª Return

doSubController

public GlueContext doSubController(GlueContext ctx,
                                   boolean newTx)
Description copied from interface: GlueBizController
doAction()°ú µ¿ÀÏÇÏÁö¸¸ Transaction 󸮴 Á¤ÀÇ¿¡ µû¶ó ´Þ¶óÁø´Ù.
 <activity name="CallSubController" class="com.poscoict.glueframework.biz.activity.GlueSubService">
     <transition name="success" value="HandleError"/>
     <property name="service-name" value="Sub-service"/>
     <property name="new-transacion" value="true"/>
 </activity>
 
 Sub-service ¸¦ È£Ãâ ÇÏ´Â À§ ¿¹Á¦¿¡¼­ "<property name="new-transacion" value="true"/>" ÀÎ °æ¿ì
 Main-service ÀÇ Transaction°ú º°°³·Î SubService¿¡ Á¤ÀǵǾî ÀÖ´Â TransactionÀ» ó¸®ÇÏ°Ô µÈ´Ù.
 "fale"À̸é Transaction 󸮸¦ ÇÏÁö ¾Ê´Â´Ù. Áï MainServiceÀÇ TransactionÀ» ÀÌ¿ëÇÏ°Ô µÈ´Ù.
 
 

Specified by:
doSubController in interface GlueBizController
Parameters:
ctx - GlueContext
Returns:
GlueContext °á°ú °ª Return


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