com.poscoict.glueframework.biz.activity
Class GlueActivity<C extends GlueContext>

java.lang.Object
  extended by com.poscoict.glueframework.biz.activity.GlueActivity<C>
Direct Known Subclasses:
GlueContextClear, GlueDefaultRouter, GlueExcelInfo, GlueFileDelete, GlueFileDown, GlueFileList, GlueFileSave, GlueHbaseDelete, GlueHbaseFind, GlueHbaseSave, GlueHibernateDelete, GlueHibernateEntityCreator, GlueHibernateEntityModifier, GlueHibernateEntityRemover, GlueHibernateSearch, GlueHibernateUpdate, GlueJdbcDelete, GlueJdbcInsert, GlueJdbcModify, GlueJdbcNativeRun, GlueJdbcSearch, GlueJobCall, GlueJobLaunch, GlueMessageCreate, GlueMessageParse, GlueMessageSender, GlueMessageSender, GlueMongoDelete, GlueMongoFind, GlueMongoSave, GlueMybatisDelete, GlueMybatisInsert, GlueMybatisModify, GlueMybatisSearch, GlueRedisDelete, GlueRedisGet, GlueRedisSet, GlueResultKeyList, GlueSubService, GlueTextMessageSend, GlueWebPageTag, GlueXPlatDelete, GlueXPlatInsert, GlueXPlatModify, GlueXPlatSave, GlueXPlatSearch

public abstract class GlueActivity<C extends GlueContext>
extends Object

GlueActivity Class´Â ¸ðµç Chain¿¡¼­ »ó¼Ó¹Þ¾Æ¾ß ÇÏ´Â Super ClassÀÌ´Ù. Activity Class´Â ServiceÀÇ Member·Î Service´ÜÀ§·Î »ý¼ºÀÌ µÇ±â ¶§¹®¿¡ ÇØ´ç ClassÀÇ Member º¯¼ö¸¦ »ý¼ºÇÏ¿© »ç¿ëÇÒ °æ¿ì¿¡´Â Thread¸¶´Ù °íÀ¯ÇÑ °ªÀ» °¡Áú ¼ö ¾ø°í Àç»ç¿ë µÈ´Ù. ¾Æ·¡´Â {xxx}-service.xml ÆÄÀÏÀÇ Activity Á¤ÀÇ ÀÌ´Ù.

 ¿¹Á¦
 »ç¿ë ¿¹# 1
 
 <activity name="InitProcess" class="com.biz.BizLogicActivity">
     <transition name="success" value="EventRouter"/>
     <property name="condition" value="attr1"/>
     <property name="deptno" value="10"/>
 </activity>
 
 {xxx}-service.xml ÀÇ ÀϺΠ¿¹Á¦¿¡¼­ 'property' ¼Ó¼ºÀ» Member º¯¼ö·Î °¡Áö°í ÀÖ°í ÀÌ °ªÀº Activity Class(BizLogicActivity)¿¡¼­ È£Ãâ ÇÏ¿© »ç¿ëÇÒ ¼ö ÀÖ´Ù.
 


Field Summary
protected  Map<String,String> dynamicProperties
          µ¿ÀûÀ¸·Î °ü¸®µÇ´Â property
protected  org.slf4j.Logger logger
          logger
 
Constructor Summary
GlueActivity()
           
 
Method Summary
 void commitTransaction(C ctx, String transactionMgrKey)
          Æ®·£Àè¼ÇÀ» Ä¿¹ÔÇÑ´Ù.
 void commitTransaction(String transactionMgrKey)
          Æ®·£Àè¼ÇÀ» Ä¿¹ÔÇÑ´Ù.
 GlueGenericDao getDao(String daoKey)
          applicationContext.xml¿¡ Á¤ÀÇµÈ dao°¡Á®¿À±â.
 List<String> getEventList()
          getter method.
 String getName()
          getter method.
 String getProperty(String key)
          getter mehod.
 Set<String> getPropertyNames()
          Á¤Àû propertyÀÇ key set.
 Map<String,String> getTransition()
          getter method.
 void rollbackTransaction(C ctx, String transactionMgrKey)
          Æ®·£Àè¼ÇÀ» ·Ñ¹éÇÑ´Ù.
 void rollbackTransaction(String transactionMgrKey)
          Æ®·£Àè¼ÇÀ» ·Ñ¹éÇÑ´Ù.
abstract  String runActivity(C ctx)
          Sub Class¿¡¼­ ¹Ýµå½Ã ±¸ÇöÇÏ¿©¾ß ÇÏ´Â Abstract Method À̸ç ÀÌ Method´Â F/W¿¡¼­ È£ÃâÇÑ´Ù.
 void setEventList(List<String> eventList)
          setter method. internal use.
 void setName(String name)
          setter method.
 void setProperty(Map<String,String> properties)
          setter method. internal use.
 void setTransition(Map<String,String> transition)
          setter method. internal use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.slf4j.Logger logger
logger


dynamicProperties

protected Map<String,String> dynamicProperties
µ¿ÀûÀ¸·Î °ü¸®µÇ´Â property

Constructor Detail

GlueActivity

public GlueActivity()
Method Detail

runActivity

public abstract String runActivity(C ctx)
Sub Class¿¡¼­ ¹Ýµå½Ã ±¸ÇöÇÏ¿©¾ß ÇÏ´Â Abstract Method À̸ç ÀÌ Method´Â F/W¿¡¼­ È£ÃâÇÑ´Ù. °á°ú °ªÀº GlueContext¿¡ ´ã¾Æ¼­ ´ÙÀ½ Activity ¶Ç´Â F/W¿¡ Àü´ÞÇÏ°Ô µÈ´Ù. ÇÊ¿äÇÑ ¸ðµç Data´Â GlueContext¿¡¼­ È£ÃâÇÏ¿© »ç¿ëÇÏ°Ô µÈ´Ù.

Parameters:
ctx - GlueContext
Returns:
String Á¤»óÀûÀ̸é "success"¸¦ Return ÇÏ°í ºñÁ¤»ó 󸮸¦ ¿øÇϸé "failure"¸¦ Return ÇÑ´Ù.
 ¿¹) 
 <transition name="success" value="BizLogic"/>
 <transition name="failure" value="ErrorHandle"/>
 ==> return "success"À̸é BizLogic Activity ¸¦ ½ÇÇàÇÔ.
 

getDao

public GlueGenericDao getDao(String daoKey)
applicationContext.xml¿¡ Á¤ÀÇµÈ dao°¡Á®¿À±â.

Parameters:
daoKey - applicationContext.xmlÀÇ bean ID
Returns:
GlueGenericDao DAO Class

commitTransaction

public void commitTransaction(C ctx,
                              String transactionMgrKey)
Æ®·£Àè¼ÇÀ» Ä¿¹ÔÇÑ´Ù.

Parameters:
transactionMgrKey - ApplicationContext¿¡ Á¤ÀÇµÈ Æ®·£Àè¼Ç ¸Å´ÏÀú ºóÀÇ Å° °ª

commitTransaction

public void commitTransaction(String transactionMgrKey)
Æ®·£Àè¼ÇÀ» Ä¿¹ÔÇÑ´Ù.

Parameters:
transactionMgrKey - ApplicationContext¿¡ Á¤ÀÇµÈ Æ®·£Àè¼Ç ¸Å´ÏÀú ºóÀÇ Å° °ª

rollbackTransaction

public void rollbackTransaction(C ctx,
                                String transactionMgrKey)
Æ®·£Àè¼ÇÀ» ·Ñ¹éÇÑ´Ù.

Parameters:
transactionMgrKey - ApplicationContext¿¡ Á¤ÀÇµÈ Æ®·£Àè¼Ç ¸Å´ÏÀú ºóÀÇ Å° °ª

rollbackTransaction

public void rollbackTransaction(String transactionMgrKey)
Æ®·£Àè¼ÇÀ» ·Ñ¹éÇÑ´Ù.

Parameters:
transactionMgrKey - ApplicationContext¿¡ Á¤ÀÇµÈ Æ®·£Àè¼Ç ¸Å´ÏÀú ºóÀÇ Å° °ª

getProperty

public String getProperty(String key)
getter mehod. Activity Property °ªÀ» Return.

Parameters:
key - : Activity Property ÀÇ key
Returns:
key¿¡ ÇØ´çÇÏ´Â °ª

getPropertyNames

public Set<String> getPropertyNames()
Á¤Àû propertyÀÇ key set. µ¿Àû property´Â dynamicProperties ¸¦ »ç¿ëÇÒ °Í.
 [sample java code]
 public class CustomActivity extends GlueActivity{
     public String runActivity( GlueContext ctx )
     {
         Set<String> propertyNames = this.getPropertyNames();
         for ( String name : propertyNames ){
             String value = this.getProperty( name ); // service.xml¿¡ Á¤ÀÇµÈ Á¤Àû property¸¦ °¡Á®¿Ã¼ö ÀÖÀ½..
         }
         // µ¿Àû property
         dynamicProperties.put(name, value); // µ¿Àû propety¸¦ Ãß°¡ÇÒ ¼ö ÀÖÀ½.
         Set<String> dynamicPropertyNames = this.dynamicProperties.keySet();
         for ( String name : dynamicPropertyNames ){
             String value = dynamicProperties.get( name ); // service.xml¿¡ ¾ø´Â µ¿Àû property¸¦ °¡Á®¿Ã¼ö ÀÖÀ½..
         }
         return GlueBizControlConstants.SUCCESS;
     }
 }
 
 
 [sample service.xml]
 <service ...>
     <activity name="HelloActivity" class="sample.activity.HelloActivity">
         <transition name="success" value="end"/>
         <property name="p1" value="id"/>
         <property name="p2" value="Test!!!"/>
     </activity>
 </service>
 

Returns:

setProperty

public void setProperty(Map<String,String> properties)
setter method. internal use. »õ·Î¿î property ¸¦ ¼³Á¤ ÇÑ´Ù. ÁÖÀÇ ÇÒ Á¡Àº XMLÀÇ ´ÙÀ½°ú °°Àº propety´Â ¸ðµÎ Á¦°Å µÇ°í »õ·Î¿î Property°¡ Àû¿ë µÇ¾î Áø´Ù. ¶ÇÇÑ setProperty() È£ÃâÈÄ ´ÙÀ½ RequestºÎÅÍ °°Àº Service¸¦ »ç¿ëÇÏ´Â Request¿¡ Àû¿ëµÇ¾îÁö±â ¶§¹®¿¡ ÁÖÀÇ ÇÏ¿©¾ß ÇÔ.
 <property name="condition" value="attr1"/>
 <property name="deptno" value="10"/>
 

Parameters:
properties - Map the new Property

getName

public String getName()
getter method.

Returns:
activity's name

setName

public void setName(String name)
setter method.

Parameters:
name - activity's name

getTransition

public Map<String,String> getTransition()
getter method.

Returns:
transition

setTransition

public void setTransition(Map<String,String> transition)
setter method. internal use.

Parameters:
transition -

getEventList

public List<String> getEventList()
getter method.

Returns:
event list

setEventList

public void setEventList(List<String> eventList)
setter method. internal use.

Parameters:
eventList -


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