hi,
how do i access BeanFactory in MDB? could someone suggest me 'best practice'?
thanks
-ks-
hi,
how do i access BeanFactory in MDB? could someone suggest me 'best practice'?
thanks
-ks-
You can just extend org.springframework.ejb.support.AbstractJmsMessage DrivenBean.
See here for an example (it's about session beans, but should be easily adapted).
Regards,
Andreas
is beanfactory automagically registered in JNDI? if not, how to do it?
sorry for inconvenience, i can't find it in doc...
-ks-
No. What exactly are you planning to do?Originally Posted by Calvera
Regards,
Andreas
i need to access my (Hibernate or JDBC) DAO classes in MDB. i'm looking for the best solution.
i have my application in WAR file. perhaps i need to deploy it in EAR (because of MDBs and common libs). so i want to know if i can use one BeanFactory for whole app or one BF for webapp and one for EJBs...
thanks a lot...
-ks-
I think you should do somthing like this:
This code uses a singleton application context. For more info please consult chapter 16.2 of the Spring refeence docs.Code:public MyMdb extends AbstractJmsMessageDrivenBean { public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) { super.setMessageDrivenContext(messageDrivenContext); setBeanFactoryLocator(ContextSingletonBeanFactoryLocator.getInstance()); setBeanFactoryLocatorKey("myPrmaryContext"); } ....... }
i found it here http://www.javaworld.com/javaworld/j...springejb.html