org.systinet.jndi
Interface Instantiator


public interface Instantiator

The WSO2 SOA Enablement Server's javax.naming.InitialContext implementation initializes from the WSO2 SOA Enablement Server configuration file. It reads a list of classes which implement Instantiator interface, creates instances and bounds them in the context. If it obtains a request to find an object in the context, it calls Intantiator.canResolve(...) method, this method should check jndiName and if it succeeds ( true is returned ) Instantiator.newInstance(...) method is called and the returned object is passed as a result of the lookup method. The instantiator must have a default non-argument constructor

Component:
J2EE-JNDI-Connector

Method Summary
 boolean canResolve(java.lang.String jndiName)
          The method checks JNDI name.
 java.lang.Object newInstance(java.lang.String jndiName, java.lang.String connectorURI)
          The method creates a new instance of the object with passed jndiName
 

Method Detail

newInstance

public java.lang.Object newInstance(java.lang.String jndiName,
                                    java.lang.String connectorURI)
                             throws java.lang.InstantiationException
The method creates a new instance of the object with passed jndiName

Parameters:
jndiName - - JNDI name of the object previously successfully resolved by canResolve method.
connectorURI - - URI where WSO2 SOA Enablement Server should be found. Used in case that lookup is made by a JNDI client and the object looked up wants to connect to the server. If the method is called on the server side null is passed.
Returns:
- the created object
Throws:
java.lang.InstantiationException

canResolve

public boolean canResolve(java.lang.String jndiName)
The method checks JNDI name. If the Instantiator interface implementation is responsible of creating objects with this JNDI name it should return true, otherwise false.

Parameters:
jndiName - - JNDI name of the object previously successfully resolved by canResolve method.
Returns:
- true is the class is able to create objects according to jndiName passed otherwise false.