Interface NamingContextFactory

  • All Known Implementing Classes:
    RemoteNamingContextFactory

    public interface NamingContextFactory
    A context factory which maps naming providers and name schemes to actual naming contexts.
    Author:
    David M. Lloyd
    • Method Detail

      • supportsUriScheme

        boolean supportsUriScheme​(NamingProvider namingProvider,
                                  String nameScheme)
        Determine if this factory supports the given provider and name scheme. This method is called when a JNDI operation is executed on an initial context to determine which provider should handle the operation.

        A context factory should evaluate the provider's type to determine if the provider is compatible with the naming scheme, and should not support producing contexts for unknown providers.

        Parameters:
        namingProvider - the naming provider which is handling this request, or null if it is local
        nameScheme - the JNDI name scheme, or null if no name scheme was given
        Returns:
        true if this factory supports the given scheme, false otherwise
      • createRootContext

        Context createRootContext​(NamingProvider namingProvider,
                                  String nameScheme,
                                  FastHashtable<String,​Object> env,
                                  ProviderEnvironment providerEnvironment)
                           throws NamingException
        Create the root context for this naming scheme. The context should capture any locally relevant information, such as the relevant local security or authentication context.
        Parameters:
        namingProvider - the naming provider which is handling this request, or null if it is local
        nameScheme - the scheme in the name, or null if there is no name URL scheme
        env - a copy of the environment which may be consumed directly by the provider (not null)
        providerEnvironment - the provider environment (not null)
        Returns:
        the root context (must not be null)
        Throws:
        NamingException - if the root context creation failed for some reason