xmlBlaster 2.2.0 API

org.xmlBlaster.test.j2ee
Class MemContext

java.lang.Object
  extended by org.xmlBlaster.test.j2ee.MemContext
All Implemented Interfaces:
javax.naming.Context, javax.naming.spi.InitialContextFactory

public class MemContext
extends java.lang.Object
implements javax.naming.Context, javax.naming.spi.InitialContextFactory

A partial impl of JNDI context to test J2ee services.

Version:
$Revision: 1.1 $
Author:
Peter Antman

Nested Class Summary
(package private)  class MemContext.NamingParser
           
 
Field Summary
(package private)  java.util.Hashtable bindings
           
(package private)  java.util.Hashtable env
           
private static java.lang.Object lock
           
(package private)  javax.naming.NameParser parser
           
(package private)  java.lang.String prefix
           
(package private) static java.util.Properties prop
           
private static MemContext root
           
 
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
 
Constructor Summary
MemContext()
           
MemContext(java.util.Hashtable env, java.lang.String name)
           
MemContext(java.util.Hashtable env, java.lang.String name, java.util.Hashtable bindings)
           
 
Method Summary
 java.lang.Object addToEnvironment(java.lang.String propName, java.lang.Object propVal)
           
 void bind(javax.naming.Name name, java.lang.Object obj)
           
 void bind(java.lang.String name, java.lang.Object obj)
           
 void close()
           
 javax.naming.Name composeName(javax.naming.Name name, javax.naming.Name prefix)
           
 java.lang.String composeName(java.lang.String name, java.lang.String prefix)
           
 javax.naming.Context createSubcontext(javax.naming.Name name)
           
 javax.naming.Context createSubcontext(java.lang.String name)
           
 void destroySubcontext(javax.naming.Name name)
           
 void destroySubcontext(java.lang.String name)
           
 java.util.Hashtable getEnvironment()
           
 javax.naming.Context getInitialContext(java.util.Hashtable env)
          A simpel factory, that saves the first created root context in a static.
 java.lang.String getNameInNamespace()
           
 javax.naming.NameParser getNameParser(javax.naming.Name name)
           
 javax.naming.NameParser getNameParser(java.lang.String name)
           
private  javax.naming.Context getNextContext(java.lang.Object candidate, java.lang.String name)
           
 javax.naming.NamingEnumeration list(javax.naming.Name name)
           
 javax.naming.NamingEnumeration list(java.lang.String name)
           
 javax.naming.NamingEnumeration listBindings(javax.naming.Name name)
           
 javax.naming.NamingEnumeration listBindings(java.lang.String name)
           
 java.lang.Object lookup(javax.naming.Name name)
           
 java.lang.Object lookup(java.lang.String name)
           
 java.lang.Object lookupLink(javax.naming.Name name)
           
 java.lang.Object lookupLink(java.lang.String name)
           
static void main(java.lang.String[] args)
           
 void rebind(javax.naming.Name name, java.lang.Object obj)
           
 void rebind(java.lang.String name, java.lang.Object obj)
           
 java.lang.Object removeFromEnvironment(java.lang.String propName)
           
 void rename(javax.naming.Name oldName, javax.naming.Name newName)
           
 void rename(java.lang.String oldName, java.lang.String newName)
           
 void unbind(javax.naming.Name name)
           
 void unbind(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

javax.naming.NameParser parser

prop

static final java.util.Properties prop

prefix

java.lang.String prefix

env

java.util.Hashtable env

bindings

java.util.Hashtable bindings

root

private static MemContext root

lock

private static java.lang.Object lock
Constructor Detail

MemContext

public MemContext()

MemContext

public MemContext(java.util.Hashtable env,
                  java.lang.String name)
           throws javax.naming.NamingException
Throws:
javax.naming.NamingException

MemContext

public MemContext(java.util.Hashtable env,
                  java.lang.String name,
                  java.util.Hashtable bindings)
           throws javax.naming.NamingException
Throws:
javax.naming.NamingException
Method Detail

getInitialContext

public javax.naming.Context getInitialContext(java.util.Hashtable env)
                                       throws javax.naming.NamingException
A simpel factory, that saves the first created root context in a static.

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

getNextContext

private javax.naming.Context getNextContext(java.lang.Object candidate,
                                            java.lang.String name)
                                     throws javax.naming.NamingException
Throws:
javax.naming.NamingException

addToEnvironment

public java.lang.Object addToEnvironment(java.lang.String propName,
                                         java.lang.Object propVal)
                                  throws javax.naming.NamingException
Specified by:
addToEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException

lookup

public java.lang.Object lookup(javax.naming.Name name)
                        throws javax.naming.NamingException
Specified by:
lookup in interface javax.naming.Context
Throws:
javax.naming.NamingException

lookup

public java.lang.Object lookup(java.lang.String name)
                        throws javax.naming.NamingException
Specified by:
lookup in interface javax.naming.Context
Throws:
javax.naming.NamingException

bind

public void bind(javax.naming.Name name,
                 java.lang.Object obj)
          throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.Context
Throws:
javax.naming.NamingException

bind

public void bind(java.lang.String name,
                 java.lang.Object obj)
          throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.Context
Throws:
javax.naming.NamingException

rebind

public void rebind(javax.naming.Name name,
                   java.lang.Object obj)
            throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.Context
Throws:
javax.naming.NamingException

rebind

public void rebind(java.lang.String name,
                   java.lang.Object obj)
            throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.Context
Throws:
javax.naming.NamingException

unbind

public void unbind(javax.naming.Name name)
            throws javax.naming.NamingException
Specified by:
unbind in interface javax.naming.Context
Throws:
javax.naming.NamingException

unbind

public void unbind(java.lang.String name)
            throws javax.naming.NamingException
Specified by:
unbind in interface javax.naming.Context
Throws:
javax.naming.NamingException

createSubcontext

public javax.naming.Context createSubcontext(javax.naming.Name name)
                                      throws javax.naming.NamingException
Specified by:
createSubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException

createSubcontext

public javax.naming.Context createSubcontext(java.lang.String name)
                                      throws javax.naming.NamingException
Specified by:
createSubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException

close

public void close()
           throws javax.naming.NamingException
Specified by:
close in interface javax.naming.Context
Throws:
javax.naming.NamingException

getNameInNamespace

public java.lang.String getNameInNamespace()
                                    throws javax.naming.NamingException
Specified by:
getNameInNamespace in interface javax.naming.Context
Throws:
javax.naming.NamingException

rename

public void rename(javax.naming.Name oldName,
                   javax.naming.Name newName)
            throws javax.naming.NamingException
Specified by:
rename in interface javax.naming.Context
Throws:
javax.naming.NamingException

rename

public void rename(java.lang.String oldName,
                   java.lang.String newName)
            throws javax.naming.NamingException
Specified by:
rename in interface javax.naming.Context
Throws:
javax.naming.NamingException

list

public javax.naming.NamingEnumeration list(javax.naming.Name name)
                                    throws javax.naming.NamingException
Specified by:
list in interface javax.naming.Context
Throws:
javax.naming.NamingException

list

public javax.naming.NamingEnumeration list(java.lang.String name)
                                    throws javax.naming.NamingException
Specified by:
list in interface javax.naming.Context
Throws:
javax.naming.NamingException

listBindings

public javax.naming.NamingEnumeration listBindings(javax.naming.Name name)
                                            throws javax.naming.NamingException
Specified by:
listBindings in interface javax.naming.Context
Throws:
javax.naming.NamingException

listBindings

public javax.naming.NamingEnumeration listBindings(java.lang.String name)
                                            throws javax.naming.NamingException
Specified by:
listBindings in interface javax.naming.Context
Throws:
javax.naming.NamingException

destroySubcontext

public void destroySubcontext(javax.naming.Name name)
                       throws javax.naming.NamingException
Specified by:
destroySubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException

destroySubcontext

public void destroySubcontext(java.lang.String name)
                       throws javax.naming.NamingException
Specified by:
destroySubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException

lookupLink

public java.lang.Object lookupLink(javax.naming.Name name)
                            throws javax.naming.NamingException
Specified by:
lookupLink in interface javax.naming.Context
Throws:
javax.naming.NamingException

lookupLink

public java.lang.Object lookupLink(java.lang.String name)
                            throws javax.naming.NamingException
Specified by:
lookupLink in interface javax.naming.Context
Throws:
javax.naming.NamingException

getNameParser

public javax.naming.NameParser getNameParser(javax.naming.Name name)
                                      throws javax.naming.NamingException
Specified by:
getNameParser in interface javax.naming.Context
Throws:
javax.naming.NamingException

getNameParser

public javax.naming.NameParser getNameParser(java.lang.String name)
                                      throws javax.naming.NamingException
Specified by:
getNameParser in interface javax.naming.Context
Throws:
javax.naming.NamingException

composeName

public java.lang.String composeName(java.lang.String name,
                                    java.lang.String prefix)
                             throws javax.naming.NamingException
Specified by:
composeName in interface javax.naming.Context
Throws:
javax.naming.NamingException

composeName

public javax.naming.Name composeName(javax.naming.Name name,
                                     javax.naming.Name prefix)
                              throws javax.naming.NamingException
Specified by:
composeName in interface javax.naming.Context
Throws:
javax.naming.NamingException

removeFromEnvironment

public java.lang.Object removeFromEnvironment(java.lang.String propName)
                                       throws javax.naming.NamingException
Specified by:
removeFromEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException

getEnvironment

public java.util.Hashtable getEnvironment()
                                   throws javax.naming.NamingException
Specified by:
getEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException

main

public static void main(java.lang.String[] args)

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.