If I find out something useful, I'll share here with you all.
I don't know about jndi.properties, but remote access should work by creating a Webservice.
you an make a simple component which gets the object and provides it to the rest of the application. The Spring helper class is the same simple wrapper. Most Spring components can be used without a problem with Seam.
One of the big issues here is that you need to restart (or even re-compile) when you change the configuarion. Consider using JMX for configuration or make a
if I understood well, you're suggesting to use org.springframework.jndi.JndiObjectFactoryBean, right?
I was willing to find a pure seam solution, but I don't know if it exists.
It would be great if you could simply pass the jnp provider in componentes.xml.
Shervin, I think plain remote ejbs (rcp/rmi) would be really best than webservices in my case.
the components.xml file can be used to create instances of any POJO, so Spring classes are no exception. The only problem is that Spring beans sometimes depend on its own functioanlity, so you must kickstart that. Dan Allen has written the excellent (free) SeamInAction chapter on this issue.
If you're just using the Spring bean, you can sublass it and add the hooks (basically the create and unwrap annotations, which in turn call the Spring methods).
Adding the Jndi.properties to the instance is just the way of injecting parameters. a component descriptor with only the bean-name and the attributes you want. Just as simple as it sounds.
P.S. As mentioned before have a look at JMX (Spring has great support for that) and use it to configure your properties. Things in components.xml do NOT need a re-compile, but it does need an rebuild and deploy!! With JMX you can do without these steps, so you basically get a
Hot-configurablesystem (well, sort of)
thanks, leo! very good and insigthful post.
I already knew the spring way of doing this. I will now try using JMX.
Is there some good article or book that covers this example with JMX?
Manning has some great Java books. There is also a JMX in Action book which provides you with all the information. Be aware that since Java 6 the creation of JMX-beans got a lot simpler for the regular beans (just annotations) so peek also in the JRE's provided functionality.