com.interface21.jndi.mock
Class MockContext

java.lang.Object
  |
  +--com.interface21.jndi.mock.MockContext
All Implemented Interfaces:
javax.naming.Context

public class MockContext
extends java.lang.Object
implements javax.naming.Context

Mock JNDI naming context. Mainly targetted at test environments, but also usable for standalone applications.

Author:
Rod Johnson, Juergen Hoeller
See Also:
MockInitialContextFactoryBuilder

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
MockContext()
           
MockContext(java.util.Hashtable ht)
           
 
Method Summary
 java.lang.Object addToEnvironment(java.lang.String arg0, java.lang.Object arg1)
           
 void bind(javax.naming.Name arg0, java.lang.Object arg1)
           
 void bind(java.lang.String name, java.lang.Object obj)
           
 void close()
           
 javax.naming.Name composeName(javax.naming.Name arg0, javax.naming.Name arg1)
           
 java.lang.String composeName(java.lang.String arg0, java.lang.String arg1)
           
 javax.naming.Context createSubcontext(javax.naming.Name arg0)
           
 javax.naming.Context createSubcontext(java.lang.String arg0)
           
 void destroySubcontext(javax.naming.Name arg0)
           
 void destroySubcontext(java.lang.String arg0)
           
 java.util.Hashtable getEnvironment()
           
 java.lang.String getNameInNamespace()
           
 javax.naming.NameParser getNameParser(javax.naming.Name arg0)
           
 javax.naming.NameParser getNameParser(java.lang.String arg0)
           
 javax.naming.NamingEnumeration list(javax.naming.Name arg0)
           
 javax.naming.NamingEnumeration list(java.lang.String arg0)
           
 javax.naming.NamingEnumeration listBindings(javax.naming.Name arg0)
           
 javax.naming.NamingEnumeration listBindings(java.lang.String root)
           
 java.lang.Object lookup(javax.naming.Name arg0)
           
 java.lang.Object lookup(java.lang.String name)
           
 java.lang.Object lookupLink(javax.naming.Name arg0)
           
 java.lang.Object lookupLink(java.lang.String arg0)
           
 void rebind(javax.naming.Name arg0, java.lang.Object arg1)
           
 void rebind(java.lang.String arg0, java.lang.Object arg1)
           
 java.lang.Object removeFromEnvironment(java.lang.String arg0)
           
 void rename(javax.naming.Name arg0, javax.naming.Name arg1)
           
 void rename(java.lang.String arg0, java.lang.String arg1)
           
 void unbind(javax.naming.Name arg0)
           
 void unbind(java.lang.String arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockContext

public MockContext()

MockContext

public MockContext(java.util.Hashtable ht)
Method Detail

lookup

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

lookup

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

bind

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

bind

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

rebind

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

rebind

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

unbind

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

unbind

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

rename

public void rename(javax.naming.Name arg0,
                   javax.naming.Name arg1)
            throws javax.naming.NamingException
Specified by:
rename in interface javax.naming.Context

rename

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

list

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

list

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

listBindings

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

listBindings

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

destroySubcontext

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

destroySubcontext

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

createSubcontext

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

createSubcontext

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

lookupLink

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

lookupLink

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

getNameParser

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

getNameParser

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

composeName

public javax.naming.Name composeName(javax.naming.Name arg0,
                                     javax.naming.Name arg1)
                              throws javax.naming.NamingException
Specified by:
composeName in interface javax.naming.Context

composeName

public java.lang.String composeName(java.lang.String arg0,
                                    java.lang.String arg1)
                             throws javax.naming.NamingException
Specified by:
composeName in interface javax.naming.Context

addToEnvironment

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

removeFromEnvironment

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

getEnvironment

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

close

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

getNameInNamespace

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


Rod Johnson and Spring contributors 2001-2003.