From e376eca36276087a59f9d1f7bc43ceec2055293f Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 28 Mar 2014 12:12:41 +0000 Subject: [PATCH] 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 --- .../repository/jcr/JcrRepositorySessionFactory.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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(); -- 2.39.5