Dan,

I'm not entirely sure what you're trying to achieve here, but for many
purposes, ithe OSGi Service Registry can be used for setting up shared
objects.  For example, you can use a blueprint or spring xml file to
create and register a DataSource instance.  Something like...

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";>

    <bean id="datasource"
class="org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"/>

    <service ref="datasource">
        <interfaces>
            <value>javax.sql.DataSource</value>
            <value>javax.sql.ConnectionPoolDataSource</value>
        </interfaces>
    </service>

</blueprint>

In your own application bundle, you can use Blueprint or Spring DM
again to access the DataSource that is living in the OSGi Service
Registry, but if your application wants, it can also access the same
object instance using JNDI as explained in
http://servicemix.apache.org/SMX4NMR/7-jndi-integration.html.  Not
entirely sure if I'm actually answering your question here, so feel
free to let me know if this was not the information you were looking
for...


Regards,

Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



On Fri, Feb 4, 2011 at 10:43 PM, Dan Powell <[email protected]> wrote:
> What is the procedure for configuring a JDBC DataSource registered in JNDI?  
> Do I need to require any particular bundles?  Where do I configure the Spring 
> bean?  The org.springframework.jdbc bundle doesn't appear to be included by 
> default, but even after installing that bundle I still can't get my JNDI 
> beans to deploy.
>
> Thanks!
>
> Dan

Reply via email to