org.apache.jackrabbit.servlet
Class FilterRepositoryFactory

java.lang.Object
  extended by org.apache.jackrabbit.servlet.FilterRepositoryFactory
All Implemented Interfaces:
RepositoryFactory

public class FilterRepositoryFactory
extends Object
implements RepositoryFactory

Factory that looks up a repository from the context of a given filter.

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:

 <filter>
   <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>
 </filter>
 

Since:
Apache Jackrabbit 1.6

Constructor Summary
FilterRepositoryFactory(javax.servlet.FilterConfig config)
          Creates a factory for looking up a repository from the context associated with the given filter configuration.
 
Method Summary
 Repository getRepository()
          Looks up and returns a repository bound in the servlet context of the given filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterRepositoryFactory

public FilterRepositoryFactory(javax.servlet.FilterConfig config)
Creates a factory for looking up a repository from the context associated with the given filter configuration.

Parameters:
config - filter configuration
Method Detail

getRepository

public Repository getRepository()
                         throws RepositoryException
Looks up and returns a repository bound in the servlet context of the given filter.

Specified by:
getRepository in interface RepositoryFactory
Returns:
repository from servlet context
Throws:
RepositoryException - if the repository is not available


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.