/**
* Injects the {@code EntityManager} instance required to invoke our
* transactional DAOs. The EntityManager instance can only be injected into
* the Spring Beans, we cannot create a Spring Bean for the Exchange EJB
* otherwise.
*
* @param entityManager Spring controlled EntityManager instance
*/
@PersistenceContext
public void init(final EntityManager entityManager) {
// Create the Notification Spy, and inject it
final Notifications notitications = NotificationSpy.getInstance();
final NotificationManagerScheduler notificationBean = new NotificationManagerScheduler();
notificationBean.setNotifications(notitications);
// Create a new SessionRequestBean instance with our entityManager
final SessionRequestBean sessionRequestBean = new SessionRequestBean();
sessionRequestBean.setEntityManager(entityManager);
sessionRequestBean.setSettings(Beans.settings());
sessionRequestBean.postConstruct();
// Create an Exchange EJB, and inject the EntityManager & Notification Spy
final ExchangeBean exchangeBean = new ExchangeBean();
exchangeBean.setEntityManager(entityManager);
exchangeBean.setNotificationManager(notificationBean);
exchangeBean.setSessionRequestBean(sessionRequestBean);
exchangeBean.setSettings(Beans.settings());
exchangeBean.postConstruct();
// Set our Exchange implementation to the Exchange EJB, running within
// a "Spring Container".
client = exchangeBean;
}
ExchangeSpringClient.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:iws
作者:
评论列表
文章目录