org.apache.jackrabbit.jcr2spi
Class Jcr2spiRepositoryFactory

java.lang.Object
  extended by org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory
All Implemented Interfaces:
RepositoryFactory

public class Jcr2spiRepositoryFactory
extends Object
implements RepositoryFactory

This implementation of RepositoryFactory is capable of returning the various SPI implementations of the Apache Jackrabbit project:


Nested Class Summary
static class Jcr2spiRepositoryFactory.RepositoryConfigImpl
           
 
Field Summary
static CacheBehaviour DEFAULT_CACHE_BEHAVIOR
          Default value for PARAM_CACHE_BEHAVIOR
static int DEFAULT_ITEM_CACHE_SIZE
          Default value for PARAM_ITEM_CACHE_SIZE
static int DEFAULT_POLL_TIME_OUT
          Default value for PARAM_POLL_TIME_OUT
static String PARAM_CACHE_BEHAVIOR
          Optional configuration parameter for RepositoryConfig.getCacheBehaviour().
static String PARAM_ITEM_CACHE_SIZE
          Optional configuration parameter for the RepositoryConfig.getItemCacheSize().
static String PARAM_LOG_WRITER_PROVIDER
          LogWriterProvider configuration parameter: If the parameter is present the RepositoryService defined by the specified RepositoryConfig will be wrapped by calling SpiLoggerFactory.create(org.apache.jackrabbit.spi.RepositoryService, org.apache.jackrabbit.spi.commons.logging.LogWriterProvider) if the parameter value is an instance of LogWriterProvider or SpiLoggerFactory.create(org.apache.jackrabbit.spi.RepositoryService) otherwise.
static String PARAM_POLL_TIME_OUT
          Optional configuration parameter for the RepositoryConfig.getPollTimeout().
static String PARAM_REPOSITORY_CONFIG
          This parameter contains the RepositoryConfig instance.
static String PARAM_REPOSITORY_SERVICE_FACTORY
          This parameter determines the RepositoryServiceFactory to create the RepositoryService.
 
Constructor Summary
Jcr2spiRepositoryFactory()
           
 
Method Summary
 Repository getRepository(Map parameters)
          Creates a SPI based Repository instance based on the parameters passed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_REPOSITORY_SERVICE_FACTORY

public static final String PARAM_REPOSITORY_SERVICE_FACTORY
This parameter determines the RepositoryServiceFactory to create the RepositoryService. This is either an instance of RepositoryServiceFactory or a fully quallyfied class name of a RepositoryServiceFactory having a no argument constructor.

See Also:
Constant Field Values

PARAM_REPOSITORY_CONFIG

public static final String PARAM_REPOSITORY_CONFIG
This parameter contains the RepositoryConfig instance.

See Also:
Constant Field Values

PARAM_CACHE_BEHAVIOR

public static final String PARAM_CACHE_BEHAVIOR
Optional configuration parameter for RepositoryConfig.getCacheBehaviour(). This must be either CacheBehaviour.INVALIDATE or CacheBehaviour.OBSERVATION or one of the strings "invalidate" or "observation".

See Also:
Constant Field Values

DEFAULT_CACHE_BEHAVIOR

public static final CacheBehaviour DEFAULT_CACHE_BEHAVIOR
Default value for PARAM_CACHE_BEHAVIOR


PARAM_ITEM_CACHE_SIZE

public static final String PARAM_ITEM_CACHE_SIZE
Optional configuration parameter for the RepositoryConfig.getItemCacheSize(). This must be either an Integer or a String which parses into an integer.

See Also:
Constant Field Values

DEFAULT_ITEM_CACHE_SIZE

public static final int DEFAULT_ITEM_CACHE_SIZE
Default value for PARAM_ITEM_CACHE_SIZE

See Also:
Constant Field Values

PARAM_POLL_TIME_OUT

public static final String PARAM_POLL_TIME_OUT
Optional configuration parameter for the RepositoryConfig.getPollTimeout(). This must be either an Integer or a String which parses into an integer.

See Also:
Constant Field Values

DEFAULT_POLL_TIME_OUT

public static final int DEFAULT_POLL_TIME_OUT
Default value for PARAM_POLL_TIME_OUT

See Also:
Constant Field Values

PARAM_LOG_WRITER_PROVIDER

public static final String PARAM_LOG_WRITER_PROVIDER
LogWriterProvider configuration parameter: If the parameter is present the RepositoryService defined by the specified RepositoryConfig will be wrapped by calling SpiLoggerFactory.create(org.apache.jackrabbit.spi.RepositoryService, org.apache.jackrabbit.spi.commons.logging.LogWriterProvider) if the parameter value is an instance of LogWriterProvider or SpiLoggerFactory.create(org.apache.jackrabbit.spi.RepositoryService) otherwise.

See Also:
SpiLoggerFactory.create(org.apache.jackrabbit.spi.RepositoryService), SpiLoggerFactory.create(org.apache.jackrabbit.spi.RepositoryService, org.apache.jackrabbit.spi.commons.logging.LogWriterProvider), Constant Field Values
Constructor Detail

Jcr2spiRepositoryFactory

public Jcr2spiRepositoryFactory()
Method Detail

getRepository

public Repository getRepository(Map parameters)
                         throws RepositoryException

Creates a SPI based Repository instance based on the parameters passed.

If the PARAM_REPOSITORY_SERVICE_FACTORY parameter is set, the specified RepositoryServiceFactory is used to create the RepositoryService instance. All parameters are passed to RepositoryServiceFactory.createRepositoryService(Map).

If the PARAM_REPOSITORY_CONFIG parameter is set, the specified RepositoryConfig instance is used to create the repository.

If both parameters are set, the latter takes precedence and the former is ignores.

The known SPI implementations and its RepositoryServiceFactorys are:

NOTE: If the parameters map contains an PARAM_LOG_WRITER_PROVIDER entry the RepositoryService obtained from the configuration is wrapped by a SPI logger. See the SpiLoggerFactory for details.

Specified by:
getRepository in interface RepositoryFactory
Throws:
RepositoryException
See Also:
RepositoryFactory.getRepository(java.util.Map)


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