You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jeremy Boynes <jb...@apache.org> on 2006/04/08 20:09:42 UTC

Support for JNDI properties

I added a property factory that allows property values to be fetched
from JNDI. Although general purpose in nature, the most obvious
application is to allow components to access J2EE resources.

For example, a component could write
public class MyComponent {
   @Property
   public DataSource myDB;
}

and then be injected with a DataSource with the SCDL:
  <component ...>
    <properties>
      <v:myDB
factory="org.apache.tuscany.core.loader.impl.JNDIPropertyFactory">java:comp/env/jdbc/MyDatabase</v:myDB>

The same setup can be used to access environment entries or the user
transaction.

I thought this might be useful in the samples that access a backend db.

Cheers
--
Jeremy