com.ibm.ws.container.service.naming

Interface JavaColonNamingHelper


  1. 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.

Method Summary

Modifier and Type Method and Description
  1. java.lang.Object
getObjectInstance(NamingConstants.JavaColonNamespace namespace,java.lang.String name)
This method is called by JNDI during lookups.
  1. boolean
hasObjectWithPrefix(NamingConstants.JavaColonNamespace namespace,java.lang.String name)
  1. java.util.Collection<? extends javax.naming.NameClassPair>
listInstances(NamingConstants.JavaColonNamespace namespace,java.lang.String nameInContext)

Method Detail

getObjectInstance

  1. java.lang.Object getObjectInstance( NamingConstants.JavaColonNamespace namespace,
  2. java.lang.String name)
  3. 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

  1. boolean hasObjectWithPrefix(NamingConstants.JavaColonNamespace namespace,
  2. java.lang.String name)
  3. 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

  1. java.util.Collection<? extends javax.naming.NameClassPair> listInstances( NamingConstants.JavaColonNamespace namespace,
  2. java.lang.String nameInContext)
  3. 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