| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.sling.jcr.base.util.RepositoryAccessor
public class RepositoryAccessor
Access a Repository via JNDI or RMI.
| Field Summary | |
|---|---|
| static String | JNDI_PREFIXPrefix for JNDI Repository URLs | 
| static String | REPOSITORY_URL_OVERRIDE_PROPERTYName of the property that the jcr client and server bundles to override their default configuration settings and connect to the specified repository instead (SLING-254 and SLING-260) | 
| static String | RMI_PREFIXPrefix for RMI Repository URLs | 
| Constructor Summary | |
|---|---|
| RepositoryAccessor() | |
| Method Summary | |
|---|---|
| protected  org.apache.jackrabbit.rmi.client.ClientRepositoryFactory | getClientRepositoryFactory()Returns the ClientRepositoryFactoryto access the remote
 JCR repository over RMI. | 
| protected  org.apache.jackrabbit.rmi.client.LocalAdapterFactory | getLocalAdapterFactory()Returns the LocalAdapterFactoryused to convert Jackrabbit
 JCR RMI remote objects to local JCR API objects. | 
|  javax.jcr.Repository | getRepository(String repositoryName,
              Hashtable<String,Object> jndiContext)First try to access the Repository via JNDI (unless jndiContext is null), and if not successful try RMI. | 
|  javax.jcr.Repository | getRepositoryFromURL(String url)Acquire a Repository from the given URL | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String RMI_PREFIX
public static final String JNDI_PREFIX
public static final String REPOSITORY_URL_OVERRIDE_PROPERTY
| Constructor Detail | 
|---|
public RepositoryAccessor()
| Method Detail | 
|---|
public javax.jcr.Repository getRepository(String repositoryName,
                                          Hashtable<String,Object> jndiContext)
repositoryName - JNDI name or RMI URL (must start with "rmi://") of
            the RepositoryjndiContext - if null, JNDI is not tried
public javax.jcr.Repository getRepositoryFromURL(String url)
url - for RMI, an RMI URL. For JNDI, "jndi://", followed by the JNDI
            repository name, followed by a colon and a comma-separated
            list of JNDI context values, for example:
 
      jndi://jackrabbit:java.naming.factory.initial=org.SomeClass,java.naming.provider.url=http://foo.com
 
NullPointerException - If url is null.protected org.apache.jackrabbit.rmi.client.LocalAdapterFactory getLocalAdapterFactory()
LocalAdapterFactory used to convert Jackrabbit
 JCR RMI remote objects to local JCR API objects.
 
 This method returns an instance of the
 JackrabbitClientAdapterFactory which allows accessing
 Jackrabbit (or Jackrabbit-based) repositories over RMI. Extensions of
 this class may overwrite this method to use a different implementation.
protected org.apache.jackrabbit.rmi.client.ClientRepositoryFactory getClientRepositoryFactory()
ClientRepositoryFactory to access the remote
 JCR repository over RMI.
 
 This method creates an instance of the
 ClientRepositoryFactory class initialized with the
 LocalAdapterFactory returned from the
 getLocalAdapterFactory() method. Extensions may overwrite this
 method to return an extension of the Jackrabbit JCR RMI
 ClientRepositoryFactory class.
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||