org.apache.jackrabbit.core.jndi
Class RegistryHelper

java.lang.Object
  extended byorg.apache.jackrabbit.core.jndi.RegistryHelper

public class RegistryHelper
extends Object

JNDI helper functionality. This class contains static utility methods for binding and unbinding Jackarbbit repositories to and from a JNDI context.


Method Summary
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 a BindableRepository instance using the given configuration information, and unbinds it from the given JNDI context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.