com.github.smokestack.jndi
Class MockContext

java.lang.Object
  extended by com.github.smokestack.jndi.MockContext
All Implemented Interfaces:
Context

public class MockContext
extends Object
implements Context

Author:
gliptak

Nested Class Summary
static class MockContext.ContextState
           
 
Field Summary
 Hashtable<String,Object> bindings
           
 Hashtable environment
           
protected  MockContext.ContextState mockState
           
 
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(Hashtable environment)
           
 
Method Summary
 Object _addToEnvironment(String propName, Object propVal)
           
 void _bind(Name name, Object obj)
           
 void _bind(String name, Object obj)
           
 void _close()
           
 Name _composeName(Name name, Name prefix)
           
 String _composeName(String name, String prefix)
           
 Context _createSubcontext(Name name)
           
 Context _createSubcontext(String name)
           
 void _destroySubcontext(Name name)
           
 void _destroySubcontext(String name)
           
 Hashtable<?,?> _getEnvironment()
           
 String _getNameInNamespace()
           
 NameParser _getNameParser(Name name)
           
 NameParser _getNameParser(String name)
           
 NamingEnumeration<NameClassPair> _list(Name name)
           
 NamingEnumeration<NameClassPair> _list(String name)
           
 NamingEnumeration<Binding> _listBindings(Name name)
           
 NamingEnumeration<Binding> _listBindings(String name)
           
 Object _lookup(Name name)
           
 Object _lookup(String name)
           
 Object _lookupLink(Name name)
           
 Object _lookupLink(String name)
           
 void _rebind(Name name, Object obj)
           
 void _rebind(String name, Object obj)
           
 Object _removeFromEnvironment(String propName)
           
 void _rename(Name oldName, Name newName)
           
 void _rename(String oldName, String newName)
           
 void _unbind(Name name)
           
 void _unbind(String name)
           
 Object addToEnvironment(String propName, Object propVal)
           
 void bind(Name name, Object obj)
           
 void bind(String name, Object obj)
           
 void close()
           
 Name composeName(Name name, Name prefix)
           
 String composeName(String name, String prefix)
           
 Context createSubcontext(Name name)
           
 Context createSubcontext(String name)
           
 void destroySubcontext(Name name)
           
 void destroySubcontext(String name)
           
 Hashtable<?,?> getEnvironment()
           
 String getNameInNamespace()
           
 NameParser getNameParser(Name name)
           
 NameParser getNameParser(String name)
           
 NamingEnumeration<NameClassPair> list(Name name)
           
 NamingEnumeration<NameClassPair> list(String name)
           
 NamingEnumeration<Binding> listBindings(Name name)
           
 NamingEnumeration<Binding> listBindings(String name)
           
 Object lookup(Name name)
           
 Object lookup(String name)
           
 Object lookupLink(Name name)
           
 Object lookupLink(String name)
           
 void rebind(Name name, Object obj)
           
 void rebind(String name, Object obj)
           
 Object removeFromEnvironment(String propName)
           
 void rename(Name oldName, Name newName)
           
 void rename(String oldName, String newName)
           
 String toString()
           
 void unbind(Name name)
           
 void unbind(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mockState

protected MockContext.ContextState mockState

environment

public Hashtable environment

bindings

public Hashtable<String,Object> bindings
Constructor Detail

MockContext

public MockContext(Hashtable environment)
Method Detail

addToEnvironment

public Object addToEnvironment(String propName,
                               Object propVal)
                        throws NamingException
Specified by:
addToEnvironment in interface Context
Throws:
NamingException

_addToEnvironment

public Object _addToEnvironment(String propName,
                                Object propVal)
                         throws NamingException
Throws:
NamingException

bind

public void bind(Name name,
                 Object obj)
          throws NamingException
Specified by:
bind in interface Context
Throws:
NamingException

_bind

public void _bind(Name name,
                  Object obj)
           throws NamingException
Throws:
NamingException

bind

public void bind(String name,
                 Object obj)
          throws NamingException
Specified by:
bind in interface Context
Throws:
NamingException

_bind

public void _bind(String name,
                  Object obj)
           throws NamingException
Throws:
NamingException

close

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

_close

public void _close()
            throws NamingException
Throws:
NamingException

composeName

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

_composeName

public Name _composeName(Name name,
                         Name prefix)
                  throws NamingException
Throws:
NamingException

composeName

public String composeName(String name,
                          String prefix)
                   throws NamingException
Specified by:
composeName in interface Context
Throws:
NamingException

_composeName

public String _composeName(String name,
                           String prefix)
                    throws NamingException
Throws:
NamingException

createSubcontext

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

_createSubcontext

public Context _createSubcontext(Name name)
                          throws NamingException
Throws:
NamingException

createSubcontext

public Context createSubcontext(String name)
                         throws NamingException
Specified by:
createSubcontext in interface Context
Throws:
NamingException

_createSubcontext

public Context _createSubcontext(String name)
                          throws NamingException
Throws:
NamingException

destroySubcontext

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

_destroySubcontext

public void _destroySubcontext(Name name)
                        throws NamingException
Throws:
NamingException

destroySubcontext

public void destroySubcontext(String name)
                       throws NamingException
Specified by:
destroySubcontext in interface Context
Throws:
NamingException

_destroySubcontext

public void _destroySubcontext(String name)
                        throws NamingException
Throws:
NamingException

getEnvironment

public Hashtable<?,?> getEnvironment()
                              throws NamingException
Specified by:
getEnvironment in interface Context
Throws:
NamingException

_getEnvironment

public Hashtable<?,?> _getEnvironment()
                               throws NamingException
Throws:
NamingException

getNameInNamespace

public String getNameInNamespace()
                          throws NamingException
Specified by:
getNameInNamespace in interface Context
Throws:
NamingException

_getNameInNamespace

public String _getNameInNamespace()
                           throws NamingException
Throws:
NamingException

getNameParser

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

_getNameParser

public NameParser _getNameParser(Name name)
                          throws NamingException
Throws:
NamingException

getNameParser

public NameParser getNameParser(String name)
                         throws NamingException
Specified by:
getNameParser in interface Context
Throws:
NamingException

_getNameParser

public NameParser _getNameParser(String name)
                          throws NamingException
Throws:
NamingException

list

public NamingEnumeration<NameClassPair> list(Name name)
                                      throws NamingException
Specified by:
list in interface Context
Throws:
NamingException

_list

public NamingEnumeration<NameClassPair> _list(Name name)
                                       throws NamingException
Throws:
NamingException

list

public NamingEnumeration<NameClassPair> list(String name)
                                      throws NamingException
Specified by:
list in interface Context
Throws:
NamingException

_list

public NamingEnumeration<NameClassPair> _list(String name)
                                       throws NamingException
Throws:
NamingException

listBindings

public NamingEnumeration<Binding> listBindings(Name name)
                                        throws NamingException
Specified by:
listBindings in interface Context
Throws:
NamingException

_listBindings

public NamingEnumeration<Binding> _listBindings(Name name)
                                         throws NamingException
Throws:
NamingException

listBindings

public NamingEnumeration<Binding> listBindings(String name)
                                        throws NamingException
Specified by:
listBindings in interface Context
Throws:
NamingException

_listBindings

public NamingEnumeration<Binding> _listBindings(String name)
                                         throws NamingException
Throws:
NamingException

lookup

public Object lookup(Name name)
              throws NamingException
Specified by:
lookup in interface Context
Throws:
NamingException

_lookup

public Object _lookup(Name name)
               throws NamingException
Throws:
NamingException

lookup

public Object lookup(String name)
              throws NamingException
Specified by:
lookup in interface Context
Throws:
NamingException

_lookup

public Object _lookup(String name)
               throws NamingException
Throws:
NamingException

lookupLink

public Object lookupLink(Name name)
                  throws NamingException
Specified by:
lookupLink in interface Context
Throws:
NamingException

_lookupLink

public Object _lookupLink(Name name)
                   throws NamingException
Throws:
NamingException

lookupLink

public Object lookupLink(String name)
                  throws NamingException
Specified by:
lookupLink in interface Context
Throws:
NamingException

_lookupLink

public Object _lookupLink(String name)
                   throws NamingException
Throws:
NamingException

rebind

public void rebind(Name name,
                   Object obj)
            throws NamingException
Specified by:
rebind in interface Context
Throws:
NamingException

_rebind

public void _rebind(Name name,
                    Object obj)
             throws NamingException
Throws:
NamingException

rebind

public void rebind(String name,
                   Object obj)
            throws NamingException
Specified by:
rebind in interface Context
Throws:
NamingException

_rebind

public void _rebind(String name,
                    Object obj)
             throws NamingException
Throws:
NamingException

removeFromEnvironment

public Object removeFromEnvironment(String propName)
                             throws NamingException
Specified by:
removeFromEnvironment in interface Context
Throws:
NamingException

_removeFromEnvironment

public Object _removeFromEnvironment(String propName)
                              throws NamingException
Throws:
NamingException

rename

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

_rename

public void _rename(Name oldName,
                    Name newName)
             throws NamingException
Throws:
NamingException

rename

public void rename(String oldName,
                   String newName)
            throws NamingException
Specified by:
rename in interface Context
Throws:
NamingException

_rename

public void _rename(String oldName,
                    String newName)
             throws NamingException
Throws:
NamingException

unbind

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

_unbind

public void _unbind(Name name)
             throws NamingException
Throws:
NamingException

unbind

public void unbind(String name)
            throws NamingException
Specified by:
unbind in interface Context
Throws:
NamingException

_unbind

public void _unbind(String name)
             throws NamingException
Throws:
NamingException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2010 Smokestack. All Rights Reserved.