Hi,
Could it be possible for the tomcat team to include a
javax.naming.spi.ObjectFactory which would use EL3.0 expressions?
It would be great if you want to have resource-ref which are not of the usual
types.
I always wanted to have an ObjectFactory for URLs but having one for each type
is too much work... so now, that we have a more powerful EL engine, maybe it
would a great opportunity to use it.
<Resource
name="/url/SomeService"
type="java.net.URL"
factory="org.apache.tomcat.jndi.ELObjectFactory"
importClass="java.net.URI"
expression="URI('http://some.service.url').toURL()"
/>
<Resource
name="/cache/CacheManager"
type="net.sf.ehcache.CacheManager"
factory="org.apache.tomcat.jndi.ELObjectFactory"
importClass="net.sf.ehcache.CacheManager,java.net.URI"
importStatic="net.sf.ehcache.CacheManager.newInstance"
expression="CacheManager.newInstance(URI('file:${catalina.base}/conf/ehcache.xml').toURL())"
closeMethod="shutdown"
singleton="true"
/>
What dou you think?
The only thing that bothers me is how EL works with overloaded
methods/constructors (it can be tricky sometimes).
Regards,
Xavier
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]