com.ibm.ws.container.service.naming
Interface JavaColonNamingHelper
public interface JavaColonNamingHelper
This interface is intended for implementation by any container wishing to
register on the JNDI NamingHelper whiteboard for the java: namespace.
All services registered on the whiteboard are consulted during object lookup
in the appropriate namespace. This replaces the traditional JNDI bind for
populating the namespace.
In order to support very lazy object creation the java: lookup
consults the whiteboard services looking for a non-null Object to
be returned when a registered helper knows about the object.
getObjectInstance
java.lang.Object getObjectInstance(NamingConstants.JavaColonNamespace namespace,
java.lang.String name)
throws javax.naming.NamingException
- This method is called by JNDI during lookups. If an implementer of this
service does not know about the JNDI resource in question it should
return null.
If the implementer knows about the JNDI resource requested it should
return the object instance to be returned on the lookup.
- Parameters:
namespace
- enum representing the particular java: namespace being
queried, see NamingConstants.JavaColonNamespace
name
- String form of the jndi name, excluding the namespace prefix
e.g. for the resource "java:comp/env/jdbc/test" this name
would be "jdbc/test"
- Returns:
- the object instance to be returned on the lookup.
- Throws:
javax.naming.NamingException
- is thrown when an implementation knows about the the JNDI
resource, but encounters a problem obtaining an instance
to return.
hasObjectWithPrefix
boolean hasObjectWithPrefix(NamingConstants.JavaColonNamespace namespace,
java.lang.String name)
throws javax.naming.NamingException
- Parameters:
namespace
- enum representing the particular java: namespace being
queried, see NamingConstants.JavaColonNamespace
name
- String form of the jndi name prefix, excluding the namespace prefix
e.g. for the resource prefix "java:comp/env/jdbc" this name
would be "jdbc"
- Returns:
- true if the implementer of this service knows that there is JNDI resource
whose name is started with the jndi name prefix specified
- Throws:
javax.naming.NamingException
listInstances
java.util.Collection<? extends javax.naming.NameClassPair> listInstances(NamingConstants.JavaColonNamespace namespace,
java.lang.String nameInContext)
throws javax.naming.NamingException
- Parameters:
namespace
- enum representing the particular java: namespace being
queried, see NamingConstants.JavaColonNamespace
nameInContext
- String form of the jndi name, excluding the namespace prefix
e.g. for the resource "java:comp/env/jdbc/test" this name
would be "jdbc/test". "" corresponds to the namespace root,
and null is not valid.
- Returns:
- a Collection of NameClassPair objects
- Throws:
javax.naming.NamingException