|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkr.co.hit.live.context.ContextAwareService
public class ContextAwareService
현재 Application이 실행환경이 WAS나 stand-alone Java application인지 상관없이 동일하게 Transaction 관련 기능을 사용할 수 있도록 관련 기능들을 제공한다. 또한 추가적인 사용자 정의 컨텍스트(ServiceContext)를 접근할 수 있는 기능을 제공한다.
| Constructor Summary | |
|---|---|
ContextAwareService()
|
|
| Method Summary | |
|---|---|
protected ApplicationContext |
getApplicationContext()
현재 쓰레드에 연결된 어플리케이션 컨텍스트 객체를 반환한다. |
protected Map<String,Object> |
getDiagnosticContext()
현재 쓰레드에 연결된 Diagnostic 컨텍스트 객체를 반환한다. |
protected ServiceContext |
getServiceContext()
현재 쓰레드에 연결된 서비스 컨텍스트 객체를 반환한다. |
protected UserTransaction |
getUserTransaction()
현재 쓰레드와 연결된 UserTransaction 객체를 생성한다. |
protected void |
setMessage(String msgKey)
현재 쓰레드에 연결된 서비스 컨텍스트의 서버 메시지를 설정한다. |
protected void |
setMessage(String msgKey,
Object param1)
현재 쓰레드에 연결된 서비스 컨텍스트의 서버 메시지를 설정한다. |
protected void |
setMessage(String msgKey,
Object[] params)
현재 쓰레드에 연결된 서비스 컨텍스트의 서버 메시지를 설정한다. |
protected void |
setMessage(String msgKey,
Object param1,
Object param2)
현재 쓰레드에 연결된 서비스 컨텍스트의 서버 메시지를 설정한다. |
protected void |
setMessage(String msgKey,
Object param1,
Object param2,
Object param3)
현재 쓰레드에 연결된 서비스 컨텍스트의 서버 메시지를 설정한다. |
protected void |
setRollbackOnly()
현재 쓰레드에 연결된 트랜젝션을 롤백상태로 마크한다. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContextAwareService()
| Method Detail |
|---|
protected void setRollbackOnly()
throws IllegalStateException
현재 쓰레드에 연결된 트랜젝션을 롤백상태로 마크한다.
ContextManager로부터 현재 쓰레드의 EJBContext와 UserTransaction 객체를 얻어온 후,
UserTransaction이 설정되어 있다면 UserTransaction의 setRollbackOnly()를 호출하고,
UserTransaction이 설정되어 있지 않다면 EJBContext의 setRollbackOnly()를 호출한다.
또한 어플리케이션에서 setRollbackOnly() 가 호출되어 트랜젝션이 rollback으로 마킹이 되었는지 아니면 트랜젝션 타임아웃등 시스템 적으로 rollback이 마킹되었는지 구분하기 위하여 ContextManager.setRollbackOnly()를 호출한다.
IllegalStateException
protected UserTransaction getUserTransaction()
throws IllegalStateException
IllegalStateExceptionprotected ServiceContext getServiceContext()
protected Map<String,Object> getDiagnosticContext()
protected void setMessage(String msgKey)
msgKey - 메시지 번호
protected void setMessage(String msgKey,
Object param1)
msgKey - 메시지 번호param1 - 메시지 파라메터
protected void setMessage(String msgKey,
Object param1,
Object param2)
msgKey - 메시지 번호param1 - 메시지 파라메터 1param2 - 메시지 파라메터 2
protected void setMessage(String msgKey,
Object param1,
Object param2,
Object param3)
msgKey - 메시지 번호param1 - 메시지 파라메터 1param2 - 메시지 파라메터 2param3 - 메시지 파라메터 3
protected void setMessage(String msgKey,
Object[] params)
msgKey - 메시지 번호params - 메시지 파라메터 배열protected ApplicationContext getApplicationContext()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||