|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.commons.AbstractRepository
org.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 |
---|
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(File dir)
Creates a transient repository proxy based on the given repository home directory and the repository configuration file "repository.xml" contained in that directory. |
|
TransientRepository(File xml,
File dir)
Creates a transient repository proxy that will use the given repository configuration file and home directory paths to initialize the underlying repository instances. |
|
TransientRepository(RepositoryConfig config)
Creates a transient repository proxy that will use the given repository configuration to initialize the underlying repository instance. |
|
TransientRepository(String config,
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,
String home)
Creates a transient repository proxy that will use the given repository factory to initialize the underlying repository instances. |
Method Summary | |
---|---|
String |
getDescriptor(String key)
Returns the identified repository descriptor. |
String[] |
getDescriptorKeys()
Returns the available descriptor keys. |
Value |
getDescriptorValue(String key)
|
Value[] |
getDescriptorValues(String key)
|
String |
getHomeDir()
|
boolean |
isSingleValueDescriptor(String key)
|
void |
loggedOut(SessionImpl session)
Removes the given session from the set of open sessions. |
void |
loggingOut(SessionImpl session)
Ignored. |
Session |
login(Credentials credentials,
String workspaceName)
Logs in to the content repository. |
void |
shutdown()
Forces all active sessions to logout. |
Methods inherited from class org.apache.jackrabbit.commons.AbstractRepository |
---|
isStandardDescriptor, login, login, login |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.jcr.Repository |
---|
isStandardDescriptor, login, login, login |
Constructor Detail |
---|
public TransientRepository(TransientRepository.RepositoryFactory factory, String home)
factory
- repository factoryhome
- the path to the repository home directory.public TransientRepository()
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.
public TransientRepository(RepositoryConfig config)
config
- repository configurationpublic TransientRepository(String config, String home)
config
- repository configuration filehome
- repository home directoryTransientRepository(File, File)
public TransientRepository(File dir)
dir
- repository home directorypublic TransientRepository(File xml, File dir)
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.
xml
- repository configuration filedir
- repository home directoryMethod Detail |
---|
public String getHomeDir()
public String[] getDescriptorKeys()
getDescriptorKeys
in interface Repository
public String getDescriptor(String key)
getDescriptor
in interface Repository
key
- descriptor key
Repository.getDescriptor(String)
public Value getDescriptorValue(String key)
getDescriptorValue
in interface Repository
public Value[] getDescriptorValues(String key)
getDescriptorValues
in interface Repository
public boolean isSingleValueDescriptor(String key)
isSingleValueDescriptor
in interface Repository
public Session login(Credentials credentials, String workspaceName) throws RepositoryException
login
in interface Repository
credentials
- login credentialsworkspaceName
- workspace name
RepositoryException
- if the session could not be createdRepository.login(Credentials,String)
public void shutdown()
shutdown
in interface JackrabbitRepository
Session.logout()
public void loggedOut(SessionImpl session)
loggedOut
in interface SessionListener
session
- 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 |