This content has been marked as final.
Show 3 replies
-
1. Re: dynamic jndiName in @Spring
alesj Aug 3, 2007 4:38 AM (in response to sysuser1)I guess it could be done - it depends on how much information is there in InvocationContext (via EJB3 interceptor) or Invocation (via JBossAOP).
And there is only one entry point where we do a jndi name lookup: SpringInjectionSupport.getObjectFromBeanFactory.
I'll have a look, and let you know. -
2. Re: dynamic jndiName in @Spring
wolfc Oct 1, 2007 10:48 AM (in response to sysuser1)An idea might be to implement Java EL in the annotation handling.
Then the code would look like:@Spring(jndiName="${jndi:lookup('java:comp/env/beanFactoryName')}",bean="manager") private Manager manager;
MC should keep a list of possible functions somewhere in xml. -
3. Re: dynamic jndiName in @Spring
alesj Oct 3, 2007 8:11 PM (in response to sysuser1)I've extracted the getJndiName method + made jndiName in @Spring optional - having default "".
So I guess, if you still haven't done it yourself :-), use this extension for all various ways (ThreadLocal, @Resource SessionContext in interceptor + getProperties, Carlo's EL, ...) of 'injecting' dynamic jndi name.