Exposes a "jndiName" property. This may or may not
include the "java:comp/env/" prefix expected by Jakarta EE applications when
accessing a locally mapped (Environmental Naming Context) resource. If it
doesn't, the "java:comp/env/" prefix will be prepended if the "resourceRef"
property is true (the default is false) and no other scheme
(e.g. "java:") is given.
Subclasses may invoke the lookup() method whenever it is appropriate.
Some classes might do this on initialization, while others might do it
on demand. The latter strategy is more flexible in that it allows for
initialization of the locator before the JNDI object is available.
setJndiName, setJndiTemplate, setJndiEnvironment, setResourceRef, lookup()
| Modifier and Type | Field and Description |
|---|---|
| private Class | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterPropertiesSet()
Implements org. BeanFactory after it has set all bean properties
and satisfied BeanFactoryAware, ApplicationContextAware etc.
This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set. |
| public Class | getExpectedType()
Return the type that the located JNDI object is supposed to be assignable to, if any. |
| public String | |
| protected Object | Returns: the located target objectPerform the actual JNDI lookup for this locator's target resource. |
| public void | setExpectedType(Class<?> expectedType)
Specify the type that the located JNDI object is supposed to be assignable to, if any. |
| public void |
| expectedType | back to summary |
|---|---|
| private Class<?> expectedType
| |
| jndiName | back to summary |
|---|---|
| private String jndiName
| |
| JndiObjectLocator | back to summary |
|---|---|
| public JndiObjectLocator() | |
| afterPropertiesSet | back to summary |
|---|---|
| public void afterPropertiesSet() throws IllegalArgumentException, NamingException Implements org. Doc from org. Invoked by the containing This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
| |
| getExpectedType | back to summary |
|---|---|
| public Class Return the type that the located JNDI object is supposed to be assignable to, if any.
| |
| getJndiName | back to summary |
|---|---|
| public String getJndiName() Return the JNDI name to look up.
| |
| lookup | back to summary |
|---|---|
| protected Object lookup() throws NamingException Perform the actual JNDI lookup for this locator's target resource.
| |
| setExpectedType | back to summary |
|---|---|
| public void setExpectedType(Class<?> expectedType) Specify the type that the located JNDI object is supposed to be assignable to, if any. | |
| setJndiName | back to summary |
|---|---|
| public void setJndiName(String jndiName) Specify the JNDI name to look up. If it doesn't begin with "java:comp/env/" this prefix is added automatically if "resourceRef" is set to "true".
| |