Package org.apache.jackrabbit.core.jndi
Class RegistryHelper
- java.lang.Object
-
- org.apache.jackrabbit.core.jndi.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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
registerRepository(Context ctx, String name, String configFilePath, String repHomeDir, boolean overwrite)
Binds a configured repository to the given JNDI context.static void
unregisterRepository(Context ctx, String name)
This method shutdowns aBindableRepository
instance using the given configuration information, and unbinds it from the given 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 aBindableRepository
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 withconfigFilePath
- path to the configuration file of the repositoryrepHomeDir
- repository home directoryoverwrite
- iftrue
, any existing binding with the given name will be overwritten; otherwise aNamingException
will be thrown if the name is already bound- Throws:
RepositoryException
- if the repository cannot be createdNamingException
- if the repository cannot be registered in JNDI
-
unregisterRepository
public static void unregisterRepository(Context ctx, String name) throws NamingException
This method shutdowns aBindableRepository
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
-
-