I posted this in the JBoss & cache forum, but I don't think its the correct place as it's an architecture questions more.
I'm using Spring to wire an application together, but intead of linking Hibernate and TreeCache thru JMX, I'd prefer to pass the cache provider to Hibernate using JNDI. The reason is that I'd prefer to wire everything using Spring rather than depending on JMX to provide a similar function.
In my Spring config, I'd like to be able to swap between datasources and cache providers depending on the platform. Is there any else in the same boat as myself?
I was thinking of writing an implementation that would perform the JNDI resolution and then delegates the methods from the interface. Then I could still use the current implementation (setting the cache.provider_class property to xxx.MyCacheProviderDelegate), but the calls would be delegated to the correct implementation.
Any ideas folks?
|