Tuscany Core

org.apache.tuscany.core.loader.impl
Class JNDIPropertyFactory

java.lang.Object
  extended by org.apache.tuscany.core.loader.impl.JNDIPropertyFactory
All Implemented Interfaces:
StAXPropertyFactory

public class JNDIPropertyFactory
extends java.lang.Object
implements StAXPropertyFactory

A StAXPropertyFactory that creates property values by looking them up in the default JNDI InitialContext. This can be used to locate resources in a J2EE environment and inject them as configuration properties. For example, to access a database a component could write: &at;Property DataSource myDB; and configure with <properties> <v:myDb>java:comp/env/jdbc/MyDatabase</v:myDB> </properties>

Version:
$Rev$ $Date$

Constructor Summary
JNDIPropertyFactory()
           
 
Method Summary
 ObjectFactory<?> createObjectFactory(javax.xml.stream.XMLStreamReader reader, org.apache.tuscany.model.assembly.Property property)
          Return an ObjectFactory for instances of a property defined in an XML stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNDIPropertyFactory

public JNDIPropertyFactory()
Method Detail

createObjectFactory

public ObjectFactory<?> createObjectFactory(javax.xml.stream.XMLStreamReader reader,
                                            org.apache.tuscany.model.assembly.Property property)
                                     throws javax.xml.stream.XMLStreamException,
                                            ConfigurationLoadException
Description copied from interface: StAXPropertyFactory
Return an ObjectFactory for instances of a property defined in an XML stream.

Specified by:
createObjectFactory in interface StAXPropertyFactory
Parameters:
reader - the reader to use to access the XML stream
property - the Property definition that the resulting ObjectFactory must be able to assign to
Returns:
an ObjectFactory that can produce instances that can be assigned to the supplied Property
Throws:
javax.xml.stream.XMLStreamException - if there is a problem reading the stream
ConfigurationLoadException - if there is a problem creating the ObjectFactory

Tuscany Core

-