简体   繁体   中英

Spring JNDI lookup EJB Timer Service

Is there a way in a Spring bean configuration to lookup the EJB timer service thro JNDI?

Actually, is there a way to use spring bean config to inject the EJB container's timer service into my objects?

I would like my spring config to document as much as possible all the beans/objects being used in my app.

Also, getting the session context directly (for the ejb timer) violates security protocol.

Appendix:

Please don't tell me how to do jndi lookup. I am asking if I did a jndi lookup, since my config is already doing jndi lookup for other stuffs, is there a jndi that spring web has already preconfig'd for the timer?

I want to know perhaps, if spring web has a way to interact with ejb, whereby I could either get the timer thro jndi inquiry or thro any spring factory beans.

It does not have to be a jndi lookup.

Yes, it is possible. If you know JNDI name of that object you can use:

<jee:jndi-lookup id="timer" jndi-name="TIMER_JNDI_NAME"/>

See more info in the Spring Reference Manual

The result of such component will be a Spring Bean, which you can simply inject to any other your beans.

Regarding docs: you can use <description> sub-element for <bean> s

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM