Bean方法
|
允許的操作
|
建構子 | 無 |
Dependency injection methods (setter methods). | SessionContext: getEJBHome, getEJBLocalHome, lookup. JNDI Access: Available |
PostConstruct, PreDestroy methods (lifecycle callback methods). | SessionContext: getBusinessObject, getEJBHome, getEJBLocalHome, getEJBObject, getEJBLocalObject, lookup, getContextData, getTimerService, getUserTransaction (BMT only) JNDI Access: Available EntityManagerFactory: Accessible |
Business method from any view or business method interceptor method | SessionContext: getBusinessObject, getEJBHome, getEJBLocalHome, getCallerPrincipal, isCallerInRole, getEJBObject, getEJBLocalObject, lookup, getContextData, getInvokedBusinessInterface, wasCancelCalled, getTimerService, getUserTransaction (BMT only) getRollbackOnly (CMT only) setRollbackOnly (CMT only) JNDI Access: Available Resource managers: Accessible Other EJBs: Accessible EntityManagerFactory: Accessible EntityManager: Accessible Timer and TimeService methods: Accessbile UserTransaction methods: Accessible (BMT only) |
Business methods from web service endpoint. | SessionContext: getBusinessObject, getEJBHome, getEJBLocalHome, getCallerPrincipal, isCallerInRole, getEJBObject, getEJBLocalObject, lookup, getContextData, getTimerService, getMessageContext, getUserTransaction (BMT only), getRollbackOnly (CMT only), setRollbackOnly (CMT only). MessageContext methods: Available JNDI Access: Available Resource managers: Accessible. Other EJBs: Accessible. EntityManagerFactory: Accessible. EntityManager: Accessible. Timer and TimerService methods: Accessible. UserTransaction methods: Accessible (BMT only). |
Timeout callback method. | SessionContext: getBusinessObject, getEJBHome, getEJBLocalHome, getCallerPrincipal, isCallerInRole, getEJBObject, getEJBLocalObject, lookup, getContextData, getTimerService, getUserTransaction (BMT only), getRollbackOnly (CMT only), setRollbackOnly (CMT only). JNDI Access: Available Resource managers: Accessible. Other EJBs: Accessible. EntityManagerFactory: Accessible. EntityManager: Accessible. Timer and TimerService methods: Accessible. UserTransaction methods: Accessible (BMT only). |
ps.
- BMT表Bean Managed Transaction
- CMT表Container Managed Transaction
若在@PostConstruct和@PreDestroy中進行下列操作,則IllegalStateException會被丟出
呼叫對象
|
方法名稱
|
SesssionContext methods | Security related: getCallerPrincipal, isCallerInRole. Transaction related: getRollbackOnly, setRollbackOnly |
Asynchronous related methods | wasCancelCalled |
Client related SessionConext methods | getInvokedBusinessInterface |
TimerService and Timer | All methods |
節錄自:http://www.slideshare.net/krizsan/ocp-jbcd-6-study-notes,p.47
沒有留言:
張貼留言