spring-framework / org.springframework.mock.jndi / SimpleNamingContext

SimpleNamingContext

open class SimpleNamingContext : Context

Simple implementation of a JNDI naming context. Only supports binding plain Objects to String names. Mainly for test environments, but also usable for standalone applications.

This class is not intended for direct usage by applications, although it can be used for example to override JndiTemplate's createInitialContext method in unit tests. Typically, SimpleNamingContextBuilder will be used to set up a JVM-level JNDI environment.

Author
Rod Johnson

Author
Juergen Hoeller

See Also
SimpleNamingContextBuilderorg.springframework.jndi.JndiTemplate#createInitialContext

Constructors

<init>

SimpleNamingContext()

Create a new naming context.

SimpleNamingContext(root: String)

Create a new naming context with the given naming root.

SimpleNamingContext(root: String, boundObjects: Hashtable<String, Any>, env: Hashtable<String, Any>)

Create a new naming context with the given naming root, the given name/object map, and the JNDI environment entries.

Functions

addToEnvironment

open fun addToEnvironment(propName: String, propVal: Any): Any

bind

open fun bind(name: String, obj: Any): Unit

Bind the given object to the given name. Note: Not intended for direct use by applications if setting up a JVM-level JNDI environment. Use SimpleNamingContextBuilder to set up JNDI bindings then.

open fun bind(name: Name, obj: Any): Unit

close

open fun close(): Unit

composeName

open fun composeName(name: String, prefix: String): String
open fun composeName(name: Name, prefix: Name): Name

createSubcontext

open fun createSubcontext(name: String): Context
open fun createSubcontext(name: Name): Context

destroySubcontext

open fun destroySubcontext(name: String): Unit
open fun destroySubcontext(name: Name): Unit

getEnvironment

open fun getEnvironment(): Hashtable<String, Any>

getNameInNamespace

open fun getNameInNamespace(): String

getNameParser

open fun getNameParser(name: Name): NameParser
open fun getNameParser(name: String): NameParser

list

open fun list(root: String): NamingEnumeration<NameClassPair>
open fun list(name: Name): NamingEnumeration<NameClassPair>

listBindings

open fun listBindings(root: String): NamingEnumeration<Binding>
open fun listBindings(name: Name): NamingEnumeration<Binding>

lookup

open fun lookup(lookupName: String): Any

Look up the object with the given name.

Note: Not intended for direct use by applications. Will be used by any standard InitialContext JNDI lookups.

open fun lookup(name: Name): Any

lookupLink

open fun lookupLink(name: String): Any
open fun lookupLink(name: Name): Any

rebind

open fun rebind(name: String, obj: Any): Unit
open fun rebind(name: Name, obj: Any): Unit

removeFromEnvironment

open fun removeFromEnvironment(propName: String): Any

rename

open fun rename(oldName: String, newName: String): Unit
open fun rename(oldName: Name, newName: Name): Unit

unbind

open fun unbind(name: String): Unit
open fun unbind(name: Name): Unit