Package org.apache.jackrabbit.servlet
Class ServletRepositoryFactory
- java.lang.Object
-
- org.apache.jackrabbit.servlet.ServletRepositoryFactory
-
- All Implemented Interfaces:
RepositoryFactory
public class ServletRepositoryFactory extends Object implements RepositoryFactory
Factory that looks up a repository from the context of a given servlet.The default name of the repository attribute is "
javax.jcr.Repository
", but it can be changed by specifying an init parameter with the same name:<servlet> <init-param> <param-name>javax.jcr.Repository</param-name> <param-value>my.repository.attribute</param-value> <description> This init parameter causes the repository to be looked up from the "my.repository.attribute" attribute instead of the default "javax.jcr.Repository". </description> </init-param> </servlet>
- Since:
- 1.4
-
-
Constructor Summary
Constructors Constructor Description ServletRepositoryFactory(javax.servlet.GenericServlet servlet)
Creates a factory for looking up a repository from the context of the given servlet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Repository
getRepository()
Looks up and returns a repository bound in the configured servlet context attribute.
-
-
-
Method Detail
-
getRepository
public Repository getRepository() throws RepositoryException
Looks up and returns a repository bound in the configured servlet context attribute.- Specified by:
getRepository
in interfaceRepositoryFactory
- Returns:
- repository from servlet context
- Throws:
RepositoryException
- if the repository is not available
-
-