Interface RemoteJavaColonNamingHelper


  • public interface RemoteJavaColonNamingHelper
    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 Detail

      • getRemoteObjectInstance

        RemoteObjectInstance getRemoteObjectInstance​(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.
      • hasRemoteObjectWithPrefix

        boolean hasRemoteObjectWithPrefix​(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
      • listRemoteInstances

        java.util.Collection<? extends javax.naming.NameClassPair> listRemoteInstances​(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