org.springframework.jndi.JndiObjectFactoryBean
. Sample configuration :
<bean id="repository" class="BetterRepositoryFactoryBean">
<!-- normal factory beans params -->
<property name="configuration" value="classpath:repository.xml" />
<property name="homeDir" value="file:///c:/tmp/jackrabbit" />
<property name="configurationProperties">
<list>
<value>classpath:/first.properties</value>
<value>classpath:/second.properties</value>
</list>
</property>
</bean>
- Author:
- Emmanuel Hugonnet
- See Also:
org.springframework.jndi.JndiObjectFactoryBean
Fields inherited from class org.springmodules.jcr.RepositoryFactoryBean |
configuration, log, repository |
Methods inherited from class org.springmodules.jcr.RepositoryFactoryBean |
afterPropertiesSet, getConfiguration, getObject, getObjectType, isSingleton, setConfiguration |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BetterRepositoryFactoryBean
public BetterRepositoryFactoryBean()
createRepository
protected javax.jcr.Repository createRepository()
throws Exception
- Specified by:
createRepository
in class org.springmodules.jcr.RepositoryFactoryBean
- Throws:
Exception
- See Also:
RepositoryFactoryBean.createRepository()
createJndiRepository
protected javax.jcr.Repository createJndiRepository(String jndiName)
prepareContext
protected static void prepareContext(InitialContext ic,
String jndiName)
throws NamingException
- Throws:
NamingException
resolveConfigurationResource
protected void resolveConfigurationResource()
throws Exception
- Specified by:
resolveConfigurationResource
in class org.springmodules.jcr.RepositoryFactoryBean
- Throws:
Exception
- See Also:
RepositoryFactoryBean.resolveConfigurationResource()
replaceVariables
public static String replaceVariables(Properties variables,
String value,
boolean ignoreMissing)
throws IllegalArgumentException
- Performs variable replacement on the given string value. Each
${...}
sequence within the given value is replaced with the value of the named
parser variable. If a variable is not found in the properties an IllegalArgumentException is
thrown unless
ignoreMissing
is
true
. In the later case, the missing variable is not replaced.
- Parameters:
variables
- value
- the original valueignoreMissing
- if true
, missing variables are not replaced.
- Returns:
- value after variable replacements
- Throws:
IllegalArgumentException
- if the replacement of a referenced variable is not found
destroy
@PreDestroy
public void destroy()
throws Exception
- Shutdown method.
- Specified by:
destroy
in interface org.springframework.beans.factory.DisposableBean
- Overrides:
destroy
in class org.springmodules.jcr.RepositoryFactoryBean
- Throws:
Exception
testCleanUp
public void testCleanUp()
throws IOException
- Throws:
IOException
getHomeDir
public org.springframework.core.io.Resource getHomeDir()
- Returns:
- Returns the defaultRepDir.
setHomeDir
public void setHomeDir(org.springframework.core.io.Resource defaultRepDir)
- Parameters:
defaultRepDir
- The defaultRepDir to set.
getRepositoryConfig
public org.apache.jackrabbit.core.config.RepositoryConfig getRepositoryConfig()
- Returns:
- Returns the repositoryConfig.
setRepositoryConfig
public void setRepositoryConfig(org.apache.jackrabbit.core.config.RepositoryConfig repositoryConfig)
- Parameters:
repositoryConfig
- The repositoryConfig to set.
getConfigurationProperties
public List<String> getConfigurationProperties()
- Returns:
- Returns the configuration properties.
setConfigurationProperties
public void setConfigurationProperties(List<String> resources)
- Parameters:
resources
- The configuration resources to set for the repository.
getJndiName
public String getJndiName()
setJndiName
public void setJndiName(String jndiName)
isUseSystemProperties
public boolean isUseSystemProperties()
setUseSystemProperties
public void setUseSystemProperties(boolean useSystemProperties)
loadConfigurationKeys
protected Properties loadConfigurationKeys()
- Load all the configuration properties
- Returns:
getConfiguration
protected String getConfiguration(org.springframework.core.io.Resource config)
throws IOException
- Load a Resource as a String.
- Parameters:
config
- the resource
- Returns:
- the String filled with the content of the Resource
- Throws:
IOException
Copyright © 2016 Silverpeas. All Rights Reserved.