Access the SessionContext
The SessionContext may be used to perform lookups, manage Transactions, access the Timer Service, ...@Resource
private SessionContext sessionContext;public String greetMe(String me) { System.out.println("Message received: " + me + "n"); if (sessionContext != null) { System.out.println("SessionContext was injected by EasyBeans."); } return "Hello " + me; }
PostConstruct called by EasyBeans Method 'greetMe' invoked 1 times. Entering method : greetMe Message received: GuillaumeEJBContext was injected by Easybeans. <---------- Here Leaving method : greetMe PreDestroy called by EasyBeans.
Access the WebServiceContext
The WebServiceContext is a Resource that can be accessed/injected like all other Resources : through an annotated field or setter :@Resource
private WebServiceContext wsContext;PostConstruct called by EasyBeans Method 'greetMe' invoked 1 times. Entering method : greetMe Message received: GuillaumeSessionContext was injected by Easybeans. WebServiceContext was injected by Celtix. <------------- Here Leaving method : greetMe PreDestroy called by EasyBeans.
|
Celtix is responsible for WebServiceContext injection. EasyBeans ignores that @Resource when encountered ! |



Project