org.modeshape.web.jcr.spi
Class FactoryRepositoryProvider

java.lang.Object
  extended by org.modeshape.web.jcr.spi.FactoryRepositoryProvider
All Implemented Interfaces:
RepositoryProvider

public class FactoryRepositoryProvider
extends Object
implements RepositoryProvider

Repository provider backed by the ModeShape RepositoryFactory implementation.

The provider instantiates a {code JcrEngine} that is configured from the file in the location specified by the servlet context parameter org.modeshape.web.jcr.rest.CONFIG_FILE. This location must be accessible by the classloader for this class.

*

This class is thread-safe.

See Also:
RepositoryProvider, Class.getResourceAsStream(String)

Field Summary
static String JCR_URL
           
 
Constructor Summary
FactoryRepositoryProvider()
           
 
Method Summary
 Set<String> getJcrRepositoryNames()
          Returns the available repository names JCR implementations that do not support multiple repositories on the same server should provide a singleton set containing some default repository name.
 Session getSession(HttpServletRequest request, String repositoryName, String workspaceName)
          Returns an active session for the given workspace name in the named repository.
 void shutdown()
          Signals the repository provider that it should complete any pending transactions, shutdown, and release any external resource held.
 void startup(ServletContext context)
          Signals the repository provider that it should initialize itself based on the provided servlet context and begin accepting connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JCR_URL

public static final String JCR_URL
See Also:
Constant Field Values
Constructor Detail

FactoryRepositoryProvider

public FactoryRepositoryProvider()
Method Detail

getJcrRepositoryNames

public Set<String> getJcrRepositoryNames()
Description copied from interface: RepositoryProvider
Returns the available repository names

JCR implementations that do not support multiple repositories on the same server should provide a singleton set containing some default repository name.

Specified by:
getJcrRepositoryNames in interface RepositoryProvider
Returns:
the available repository names; may not be null or empty

startup

public void startup(ServletContext context)
Description copied from interface: RepositoryProvider
Signals the repository provider that it should initialize itself based on the provided servlet context and begin accepting connections.

Specified by:
startup in interface RepositoryProvider
Parameters:
context - the servlet context for the REST servlet

shutdown

public void shutdown()
Description copied from interface: RepositoryProvider
Signals the repository provider that it should complete any pending transactions, shutdown, and release any external resource held.

Specified by:
shutdown in interface RepositoryProvider

getSession

public Session getSession(HttpServletRequest request,
                          String repositoryName,
                          String workspaceName)
                   throws RepositoryException
Returns an active session for the given workspace name in the named repository.

Specified by:
getSession in interface RepositoryProvider
Parameters:
request - the servlet request; may not be null or unauthenticated
repositoryName - the name of the repository in which the session is created
workspaceName - the name of the workspace to which the session should be connected
Returns:
an active session with the given workspace in the named repository
Throws:
RepositoryException - if any other error occurs


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.