summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-03-28 12:12:41 +0000
committerOlivier Lamy <olamy@apache.org>2014-03-28 12:12:41 +0000
commite376eca36276087a59f9d1f7bc43ceec2055293f (patch)
tree83c27d9c75c6c61daf7132f10bdb1afcb647e352
parent946557f1648025a37476dddf7691bd829114c599 (diff)
downloadarchiva-e376eca36276087a59f9d1f7bc43ceec2055293f.tar.gz
archiva-e376eca36276087a59f9d1f7bc43ceec2055293f.zip
initialize not needed if we do not use this impl
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1582720 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java
index 4ae693ccf..954743c9d 100644
--- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java
+++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java
@@ -24,6 +24,7 @@ import org.apache.archiva.metadata.repository.MetadataRepository;
import org.apache.archiva.metadata.repository.MetadataResolver;
import org.apache.archiva.metadata.repository.RepositorySession;
import org.apache.archiva.metadata.repository.RepositorySessionFactory;
+import org.apache.archiva.metadata.repository.RepositorySessionFactoryBean;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.StopWatch;
import org.slf4j.Logger;
@@ -59,6 +60,9 @@ public class JcrRepositorySessionFactory
@Inject
private MetadataResolver metadataResolver;
+ @Inject
+ private RepositorySessionFactoryBean repositorySessionFactoryBean;
+
public RepositorySession createSession()
{
try
@@ -83,6 +87,13 @@ public class JcrRepositorySessionFactory
public void initialize()
throws Exception
{
+
+ // skip initialisation if not cassandra
+ if ( !StringUtils.equals( repositorySessionFactoryBean.getId(), "jcr" ) )
+ {
+ return;
+ }
+
StopWatch stopWatch = new StopWatch();
stopWatch.start();