public class

JndiPropertySource

extends PropertySource<T>
java.lang.Object
   ↳ org.springframework.core.env.PropertySource<T>
     ↳ org.springframework.jndi.JndiPropertySource

Class Overview

PropertySource implementation that reads properties from a JNDI Context.

Summary

Constants
String JNDI_PROPERTY_SOURCE_ENABLED_FLAG Name of property used to determine if a JndiPropertySource should be registered by default: {@value }
String JNDI_PROPERTY_SOURCE_NAME JNDI context property source name: {@value }
[Expand]
Inherited Fields
From class org.springframework.core.env.PropertySource
Public Constructors
JndiPropertySource()
Create a new JndiPropertySource with the default name {@value #JNDI_PROPERTY_SOURCE_NAME} and create a new InitialContext as the source object.
JndiPropertySource(String name)
Create a new JndiPropertySource with the given name and create a new InitialContext as the source object.
JndiPropertySource(String name, Properties jndiEnvironment)
Create a new JndiPropertySource with the given name and use the given jndiEnvironment properties to create a new InitialContext as the source object.
JndiPropertySource(String name, Context source)
Create a new JndiPropertySource with the given name and JNDI Context.
Public Methods
Object getProperty(String name)
Look up and return the given name from the source JNDI Context.
[Expand]
Inherited Methods
From class org.springframework.core.env.PropertySource
From class java.lang.Object

Constants

public static final String JNDI_PROPERTY_SOURCE_ENABLED_FLAG

Name of property used to determine if a JndiPropertySource should be registered by default: {@value }

Constant Value: "jndiPropertySourceEnabled"

public static final String JNDI_PROPERTY_SOURCE_NAME

JNDI context property source name: {@value }

Constant Value: "jndiPropertySource"

Public Constructors

public JndiPropertySource ()

Create a new JndiPropertySource with the default name {@value #JNDI_PROPERTY_SOURCE_NAME} and create a new InitialContext as the source object.

Throws
JndiLookupFailureException if a new InitialContext cannot be created.

public JndiPropertySource (String name)

Create a new JndiPropertySource with the given name and create a new InitialContext as the source object.

Throws
JndiLookupFailureException if a new InitialContext cannot be created.

public JndiPropertySource (String name, Properties jndiEnvironment)

Create a new JndiPropertySource with the given name and use the given jndiEnvironment properties to create a new InitialContext as the source object.

Throws
JndiLookupFailureException if a new InitialContext cannot be created.

public JndiPropertySource (String name, Context source)

Create a new JndiPropertySource with the given name and JNDI Context.

Public Methods

public Object getProperty (String name)

Look up and return the given name from the source JNDI Context.

Parameters
name the property key to find