|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkr.co.hit.live.jms.BaseMessageProducer
public class BaseMessageProducer
JMS에서 Queue와 Topic 방식으로 전달되는 메세지의 헤더 정보를 관리하기 위한 클래스.
| Field Summary | |
|---|---|
protected javax.jms.Connection |
connection
|
protected javax.jms.ConnectionFactory |
connectionFactory
|
protected String |
DEFAULT_MESSAGE_KEY
|
protected String |
DEFAULT_MESSAGE_KEY_VALUE
|
protected javax.jms.Destination |
destination
|
protected String |
DESTINATION_TYPE_QUEUE
|
protected String |
DESTINATION_TYPE_TOPIC
|
protected javax.jms.MapMessage |
message
|
protected javax.jms.MessageProducer |
producer
|
protected javax.jms.Session |
session
|
| Constructor Summary | |
|---|---|
BaseMessageProducer()
|
|
| Method Summary | |
|---|---|
void |
commitSession()
현재 세션을 커밋한다. |
protected void |
createMessageHeader(String msgType)
Live JMS Client와의 규약대로 메시지의 헤더 정보를 설정한다. |
protected javax.jms.Destination |
getDestination()
현재 Message Producer에 대한 데스티네이션을 얻는다. |
protected String |
getDestinationType()
데스티네이션 타입을 얻는다. |
protected String |
getJmsEngine()
JMS 엔진 이름을 얻는다. |
void |
releaseResource()
메세지 전송 후 리소스를 해지한다. |
void |
rollbackSession()
현재 세션을 롤백한다. |
protected void |
setDestination(javax.jms.Destination dest)
데스티네이션을 설정한다. |
protected void |
setDestinationType(String destType)
데스티네이션 타입을 정의한다. |
protected void |
setJmsEngine(String jmsEngine)
JMS 엔진 이름을 설정한다. |
void |
setMessage(String msgKey,
String msg)
텍스트 메세지를 전송한다. |
void |
setMessageType(String msgType)
메세지의 타입 및 모든 메시지에 공통적으로 정의되어야 하는 정보들을 지정한다. |
void |
startConnection()
initResource()에서 초기화된 정보들을 기반으로 커넥션을 수행한다. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.jms.ConnectionFactory connectionFactory
protected javax.jms.Connection connection
protected javax.jms.Session session
protected javax.jms.MessageProducer producer
protected javax.jms.Destination destination
protected javax.jms.MapMessage message
protected final String DESTINATION_TYPE_QUEUE
protected final String DESTINATION_TYPE_TOPIC
protected final String DEFAULT_MESSAGE_KEY_VALUE
protected final String DEFAULT_MESSAGE_KEY
| Constructor Detail |
|---|
public BaseMessageProducer()
| Method Detail |
|---|
public void startConnection()
throws LiveException
initResource()에서 초기화된 정보들을 기반으로 커넥션을 수행한다.
LiveException
public void releaseResource()
throws LiveException
메세지 전송 후 리소스를 해지한다.
LiveException
public void setMessageType(String msgType)
throws LiveException
메세지의 타입 및 모든 메시지에 공통적으로 정의되어야 하는 정보들을 지정한다.
msgType - 문자열 형태의 메시지 타입(Print or alert)
LiveException - 메시지 생성에 오류가 발생하는 경우
public void setMessage(String msgKey,
String msg)
throws LiveException
텍스트 메세지를 전송한다.
msg - 전송될 메세지
LiveException
protected void createMessageHeader(String msgType)
throws LiveException
Live JMS Client와의 규약대로 메시지의 헤더 정보를 설정한다.
msgType - 메시지의 타입(PRINT or ALERT)
LiveException - 메시지의 헤더정보 설정시 에러가 발생하는 경우
public void commitSession()
throws LiveException
현재 세션을 커밋한다. J2EE환경에서 컨테이너가 관리하는 트랜잭션이 아닌 일반 트랜잭션에서 동작하는 경우에는 반드시 커밋을 해주어야 한다. 커밋하는 시점에 모든 메시지가 전송된다.
LiveException - 세션 커밋시에 에러가 발생하는 경우
public void rollbackSession()
throws LiveException
현재 세션을 롤백한다.
LiveException - 세션 롤백시 에러가 발생한 경우.protected void setDestination(javax.jms.Destination dest)
데스티네이션을 설정한다. 데스티네이션의 종류에는 Queue와 Topic 두가지가 있다.
dest - 데스티네이션명protected javax.jms.Destination getDestination()
현재 Message Producer에 대한 데스티네이션을 얻는다.
protected void setDestinationType(String destType)
데스티네이션 타입을 정의한다.
destType - 데스티네이션 타입protected String getDestinationType()
데스티네이션 타입을 얻는다.
protected void setJmsEngine(String jmsEngine)
JMS 엔진 이름을 설정한다.
jmsEngine - JMS 엔진이름으로 live-config.properties 파일로부터 얻어서 설정한다.protected String getJmsEngine()
JMS 엔진 이름을 얻는다.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||