|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.naming.genericURLInitialContextFactory
public class genericURLInitialContextFactory
This class is part of a framework that enables applications to easily create local name spaces associated with a given URL scheme. A local name space created with this framework is shared across a process. That is, all threads running in a JVM instance will use the same name space instance.
This class is used to create a local name space for a given URL scheme. To create a local name space, set the following two properties, and instantiate an InitialContext, specifying this class as the initial context factory:
The code example below shows how to use this class to create a local name space for the URL scheme, myscheme:
... import java.util.Hashtable; import javax.naming.Context; import javax.naming.InitialContext; import com.ibm.websphere.naming.PROPS; ... Hashtable env = new Hashtable(); env.put(PROPS.GENERIC_URL_SCHEMEID, "myscheme"); env.put(PROPS.GENERIC_URL_PACKAGE, "com.mycompany"); env.put(Context.INITIAL_CONTEXT_FACTORY, PROPS.GENERIC_URL_INITIAL_CONTEXT_FACTORY); // The initial context will be the root context of the local name space Context ic = new InitialContext(env);
Before JNDI operations with name URLs of the specified scheme will work, you need
to define an object factory for the URL scheme by creating a subclass of
genericURLContextFactory
.
Refer to the documententation for genericURLContextFactory for usage details.
genericURLContextFactory
,
PROPS.GENERIC_URL_INITIAL_CONTEXT_FACTORY
,
PROPS.GENERIC_URL_SCHEMEID
,
PROPS.GENERIC_URL_PACKAGE
Constructor Summary | |
---|---|
genericURLInitialContextFactory()
This constructor creates an instance of genericURLInitialContextFactory. |
Method Summary | |
---|---|
javax.naming.Context |
getInitialContext(java.util.Hashtable env)
This method appends the object factory package name for the specified URL scheme to the property, java.naming.factory.url.pkgs property value in the system properties. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public genericURLInitialContextFactory()
Method Detail |
---|
public javax.naming.Context getInitialContext(java.util.Hashtable env) throws javax.naming.NamingException
getInitialContext
in interface javax.naming.spi.InitialContextFactory
env
- The set of properties collected by the InitialContext constructor from
various locations.
javax.naming.NamingException
public java.lang.String toString()
toString
in class java.lang.Object
|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |