[VFS] How to inject reference (DataSource) to Provider

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[VFS] How to inject reference (DataSource) to Provider

Bernd Eckenfels

here is my first draft of a VFS2 Provider which allows you to store files  
as Blobs in a Database. I have the problem here, that I need to set the  
actual database connection. I decided to only support the DataSource  

I tried to set it via the FS-Options, so you can have multiple filesystems  
attached to multiple databases. However this does only work with some  
specific simple types, but not generally with Objects. I guess this is a  
consequence of the configuration serialisation, but I wonder what can I do  

Currently I added the DataSource as a parameter to the constructor of the  
Provider class. This works somewhat, but forces me to have multiple scheme  
when I want to access multiple databases.

I plan to support a JNDI variant, where the DataSource is requested from  
(String) JNDI name via FS-Options, But this does not work in all  
Deployment scenarios, so I really search for the most prefered method to  
inject resources. Anybody has an Idea?




To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]