|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.TransientRepository
public class TransientRepository
A repository proxy that automatically initializes and shuts down the underlying repository instance when the first session is opened or the last one closed. As long as all sessions are properly closed when no longer used, this class can be used to avoid having to explicitly shut down the repository.
| Nested Class Summary | |
|---|---|
static interface |
TransientRepository.RepositoryFactory
Factory interface for creating RepositoryImpl instances. |
| Field Summary |
|---|
| Fields inherited from interface javax.jcr.Repository |
|---|
LEVEL_1_SUPPORTED, LEVEL_2_SUPPORTED, OPTION_LOCKING_SUPPORTED, OPTION_OBSERVATION_SUPPORTED, OPTION_QUERY_SQL_SUPPORTED, OPTION_TRANSACTIONS_SUPPORTED, OPTION_VERSIONING_SUPPORTED, QUERY_XPATH_DOC_ORDER, QUERY_XPATH_POS_INDEX, REP_NAME_DESC, REP_VENDOR_DESC, REP_VENDOR_URL_DESC, REP_VERSION_DESC, SPEC_NAME_DESC, SPEC_VERSION_DESC |
| Constructor Summary | |
|---|---|
TransientRepository()
Creates a transient repository proxy that will use the repository configuration file and home directory specified in system properties org.apache.jackrabbit.repository.conf and
org.apache.jackrabbit.repository.home. |
|
TransientRepository(RepositoryConfig config)
Creates a transient repository proxy that will use the given repository configuration to initialize the underlying repository instance. |
|
TransientRepository(java.lang.String config,
java.lang.String home)
Creates a transient repository proxy that will use the given repository configuration file and home directory paths to initialize the underlying repository instances. |
|
TransientRepository(TransientRepository.RepositoryFactory factory)
Creates a transient repository proxy that will use the given repository factory to initialize the underlying repository instances. |
|
| Method Summary | |
|---|---|
java.lang.String |
getDescriptor(java.lang.String key)
Returns the identified repository descriptor. |
java.lang.String[] |
getDescriptorKeys()
Returns the available descriptor keys. |
void |
loggedOut(SessionImpl session)
Removes the given session from the set of open sessions. |
void |
loggingOut(SessionImpl session)
Ignored. |
javax.jcr.Session |
login()
Calls login(Credentials, String) with null login
credentials and a null workspace name. |
javax.jcr.Session |
login(javax.jcr.Credentials credentials)
Calls login(Credentials, String) with a null
workspace name. |
javax.jcr.Session |
login(javax.jcr.Credentials credentials,
java.lang.String workspaceName)
Logs in to the content repository. |
javax.jcr.Session |
login(java.lang.String workspaceName)
Calls login(Credentials, String) with null login
credentials. |
void |
shutdown()
Forces all active sessions to logout. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransientRepository(TransientRepository.RepositoryFactory factory)
throws java.io.IOException
factory - repository factory
java.io.IOException - if the static repository descriptors cannot be loaded
public TransientRepository()
throws java.io.IOException
org.apache.jackrabbit.repository.conf and
org.apache.jackrabbit.repository.home. If these properties
are not found, then the default values "repository.xml"
and "repository" are used.
java.io.IOException - if the static repository descriptors cannot be loaded
public TransientRepository(RepositoryConfig config)
throws java.io.IOException
config - repository configuration
java.io.IOException - if the static repository descriptors cannot be loaded
public TransientRepository(java.lang.String config,
java.lang.String home)
throws java.io.IOException
If the given repository configuration file does not exist, then a default configuration file is copied to the given location when the first session starts. Similarly, if the given repository home directory does not exist, it is automatically created when the first session starts. This is a convenience feature designed to reduce the need for manual configuration.
config - repository configuration filehome - repository home directory
java.io.IOException - if the static repository descriptors cannot be loaded| Method Detail |
|---|
public java.lang.String[] getDescriptorKeys()
getDescriptorKeys in interface javax.jcr.RepositoryRepository#getDescriptorKeys()public java.lang.String getDescriptor(java.lang.String key)
getDescriptor in interface javax.jcr.Repositorykey - descriptor key
Repository#getDescriptor(String)
public javax.jcr.Session login(javax.jcr.Credentials credentials,
java.lang.String workspaceName)
throws javax.jcr.RepositoryException
login in interface javax.jcr.Repositorycredentials - login credentialsworkspaceName - workspace name
javax.jcr.RepositoryException - if the session could not be createdRepository#login(Credentials,String)
public javax.jcr.Session login(javax.jcr.Credentials credentials)
throws javax.jcr.RepositoryException
login(Credentials, String) with a null
workspace name.
login in interface javax.jcr.Repositorycredentials - login credentials
javax.jcr.RepositoryException - if the session could not be createdRepository#login(Credentials)
public javax.jcr.Session login(java.lang.String workspaceName)
throws javax.jcr.RepositoryException
login(Credentials, String) with null login
credentials.
login in interface javax.jcr.RepositoryworkspaceName - workspace name
javax.jcr.RepositoryException - if the session could not be createdRepository#login(String)
public javax.jcr.Session login()
throws javax.jcr.RepositoryException
login(Credentials, String) with null login
credentials and a null workspace name.
login in interface javax.jcr.Repositoryjavax.jcr.RepositoryException - if the session could not be createdRepository#login(Credentials)public void shutdown()
shutdown in interface JackrabbitRepositorySession.logout()public void loggedOut(SessionImpl session)
loggedOut in interface SessionListenersession - closed sessionSessionListener.loggedOut(SessionImpl)public void loggingOut(SessionImpl session)
Session is about to be 'closed' by
calling Session.logout()
- Specified by:
loggingOut in interface SessionListener
- Parameters:
session - the Session that is about to be 'closed'
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||