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, GlueHibernateDelete, GlueHibernateEntityCreator, GlueHibernateEntityModifier, GlueHibernateEntityRemover, GlueHibernateSearch, GlueHibernateUpdate, GlueJdbcDelete, GlueJdbcInsert, GlueJdbcModify, GlueJdbcNativeRun, GlueJdbcSearch, GlueJobCall, 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 정의 이다.
  <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(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(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(String transactionMgrKey)
트랜잭션을 커밋한다.

Parameters:
transactionMgrKey - ApplicationContext에 정의된 트랜잭션 매니저 빈의 키 값

rollbackTransaction

public void rollbackTransaction(String transactionMgrKey)
트랜잭션을 롤백한다.

Parameters:
transactionMgrKey - ApplicationContext에 정의된 트랜잭션 매니저 빈의 키 값

getProperty

public String getProperty(String key)
getter mehod. Property 값을 Return.

Parameters:
key - String Property Key값
Returns:
String Proverty Value

getPropertyNames

public Set<String> getPropertyNames()
정적 property의 key set. 동적 property는 dynamicProperties 를 사용할 것.
 [sample java code]
 public class CustomActivity extends GlueActivity{
<P>
<DD><DL>

<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>

<A NAME="setProperty(java.util.Map)"><!-- --></A><H3>
setProperty</H3>
<PRE>
public void <B>setProperty</B>(<A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&lt;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt;&nbsp;properties)</PRE>
<DL>
<DD>setter method. internal use. 새로운 <property>를 설정 한다. 주의 할 점은 XML의 다음과 같은 propety는 모두 제거 되고 새로운 Property가 적용 되어 진다. 또한 setProperty()
 호출후 다음 Request부터 같은 Service를 사용하는 Request에 적용되어지기 때문에 주의 하여야 함.
 
 <pre>
 <xmp><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–2014 POSCO ICT SW제품기술팀. All rights reserved.