public class RepositoryAccessor extends Object
Modifier and Type | Field and Description |
---|---|
static String |
JNDI_PREFIX
Prefix for JNDI Repository URLs
|
static String |
REPOSITORY_URL_OVERRIDE_PROPERTY
Name 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_PREFIX
Prefix for RMI Repository URLs
|
Constructor and Description |
---|
RepositoryAccessor() |
Modifier and Type | Method and Description |
---|---|
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.
|
Repository |
getRepositoryFromURL(String url)
Acquire a Repository from the given URL
|
public static final String RMI_PREFIX
public static final String JNDI_PREFIX
public static final String REPOSITORY_URL_OVERRIDE_PROPERTY
public 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 triedpublic 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
.Copyright © 2010 - 2020 Adobe. All Rights Reserved