org.apache.jackrabbit.servlet
Class ContextRepositoryFactory

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

public class ContextRepositoryFactory
extends Object
implements RepositoryFactory

Factory that returns a repository from a servlet context attribute.

Since:
1.4

Constructor Summary
ContextRepositoryFactory(javax.servlet.ServletContext context, String name)
          Creates a factory that looks up a repository form the configured servlet context attribute.
 
Method Summary
 Repository getRepository()
          Returns the repository from the configured servlet context attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextRepositoryFactory

public ContextRepositoryFactory(javax.servlet.ServletContext context,
                                String name)
Creates a factory that looks up a repository form the configured servlet context attribute.

Parameters:
context - servlet context
name - name of the servlet context attribute
Method Detail

getRepository

public Repository getRepository()
                         throws RepositoryException
Returns the repository from the configured servlet context attribute.

Specified by:
getRepository in interface RepositoryFactory
Returns:
repository instance
Throws:
RepositoryException - if the servlet context attribute does not exist, or if it does not contain a repository instance


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