Class RegistryHelper


  • public class RegistryHelper
    extends Object
    JNDI helper functionality. This class contains static utility methods for binding and unbinding Jackrabbit repositories to and from a JNDI context.
    • Method Detail

      • registerRepository

        public static void registerRepository​(Context ctx,
                                              String name,
                                              String configFilePath,
                                              String repHomeDir,
                                              boolean overwrite)
                                       throws NamingException,
                                              RepositoryException
        Binds a configured repository to the given JNDI context. This method creates a BindableRepository instance using the given configuration information, and binds it to the given JNDI context.
        Parameters:
        ctx - context where the repository should be registered (i.e. bound)
        name - the name to register the repository with
        configFilePath - path to the configuration file of the repository
        repHomeDir - repository home directory
        overwrite - if true, any existing binding with the given name will be overwritten; otherwise a NamingException will be thrown if the name is already bound
        Throws:
        RepositoryException - if the repository cannot be created
        NamingException - if the repository cannot be registered in JNDI
      • unregisterRepository

        public static void unregisterRepository​(Context ctx,
                                                String name)
                                         throws NamingException
        This method shutdowns a BindableRepository instance using the given configuration information, and unbinds it from the given JNDI context.
        Parameters:
        ctx - context where the repository should be unregistered (i.e. unbound)
        name - the name of the repository to unregister
        Throws:
        NamingException - on JNDI errors