Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.media.naming
Class MemoryContextFactory  view MemoryContextFactory download MemoryContextFactory.java

java.lang.Object
  extended byorg.media.naming.MemoryContextFactory
All Implemented Interfaces:
javax.naming.spi.InitialContextFactory

public final class MemoryContextFactory
extends java.lang.Object
implements javax.naming.spi.InitialContextFactory

Implements a context factory for MemoryContext. When set properly javax.naming.InitialContext will return a MemoryContext referencing the named path in the shared memory space.

To use this context factory the JNDI properties file must include the following properties:

 java.naming.factory.initial=org.media.naming.MemoryContextFactory
 java.naming.provider.url=
 
Any non-empty URL will return a context to that path in the object tree, relative to the same shared root. The returned context is read/write.

This class was inspired by the tyrex.naming package from the Tyrex project. All credits for the good stuff should go to Assaf Arkin and the Exolab group, all the bad stuff blame it on me :).

Version:
$Revision: 1.3 $ $Date: 2002/07/11 21:48:16 $

Field Summary
private static MemoryBinding _root
          The shared root of the binding tree.
 
Constructor Summary
MemoryContextFactory()
           
 
Method Summary
(package private) static MemoryBinding getBindings(java.lang.String path)
          Returns a binding in the specified path.
 javax.naming.Context getInitialContext(java.util.Hashtable env)
          Returns an initial context based on the Context.PROVIDER_URL>Context.PROVIDER_URL 55 environment attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_root

private static final MemoryBinding _root
The shared root of the binding tree.

Constructor Detail

MemoryContextFactory

public MemoryContextFactory()
Method Detail

getBindings

static MemoryBinding getBindings(java.lang.String path)
                          throws javax.naming.NamingException
Returns a binding in the specified path. If the binding does not exist, the full path is created and a new binding is returned. The binding is always obtained from the shared root.


getInitialContext

public javax.naming.Context getInitialContext(java.util.Hashtable env)
                                       throws javax.naming.NamingException
Returns an initial context based on the Context.PROVIDER_URL>Context.PROVIDER_URL 55 environment attribute. If this attribute is missing or an empty string, a new memory context be returned. Otherwise, the specified context will be returned.

Specified by:
getInitialContext in interface javax.naming.spi.InitialContextFactory