aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/plugins
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-03-28 11:43:24 +0000
committerOlivier Lamy <olamy@apache.org>2014-03-28 11:43:24 +0000
commitbef128817d76a8aac1fa575df8197f8af5a62921 (patch)
tree8eef57af1b1bc9ac655d485aa267b88787f93c28 /archiva-modules/plugins
parentd4aee19ee6b233bff720ac573106565a2d0976b7 (diff)
downloadarchiva-bef128817d76a8aac1fa575df8197f8af5a62921.tar.gz
archiva-bef128817d76a8aac1fa575df8197f8af5a62921.zip
move the factory bean to the api
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1582713 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins')
-rw-r--r--archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java27
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java9
2 files changed, 17 insertions, 19 deletions
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java
index 26ffb080a..0c6a967eb 100644
--- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java
+++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java
@@ -31,6 +31,8 @@ import me.prettyprint.hector.api.ddl.ColumnFamilyDefinition;
import me.prettyprint.hector.api.ddl.ColumnIndexType;
import me.prettyprint.hector.api.ddl.ComparatorType;
import me.prettyprint.hector.api.factory.HFactory;
+import org.apache.archiva.metadata.repository.RepositorySessionFactoryBean;
+import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@@ -89,35 +91,40 @@ public class DefaultCassandraArchivaManager
private String dependencyFamilyName = "dependency";
@Value("${cassandra.host}")
- private String cassandraHost;// = System.getProperty( "cassandra.host", "localhost" );
+ private String cassandraHost;
@Value("${cassandra.port}")
- private String cassandraPort;// = System.getProperty( "cassandra.port", "9160" );
+ private String cassandraPort;
@Value("${cassandra.maxActive}")
- private int maxActive;// = Integer.getInteger( "cassandra.maxActive", 20 );
+ private int maxActive;
@Value("${cassandra.readConsistencyLevel}")
- private String readConsistencyLevel;// =
- //System.getProperty( "cassandra.readConsistencyLevel", HConsistencyLevel.QUORUM.name() );
+ private String readConsistencyLevel;
@Value("${cassandra.writeConsistencyLevel}")
private String writeConsistencyLevel;
- //= System.getProperty( "cassandra.writeConsistencyLevel", HConsistencyLevel.QUORUM.name() );
@Value("${cassandra.replicationFactor}")
- private int replicationFactor;// = Integer.getInteger( "cassandra.replicationFactor", 1 );
+ private int replicationFactor;
@Value("${cassandra.keyspace.name}")
- private String keyspaceName;// = System.getProperty( "cassandra.keyspace.name", KEYSPACE_NAME );
+ private String keyspaceName;
@Value("${cassandra.cluster.name}")
- private String clusterName;// = System.getProperty( "cassandra.cluster.name", CLUSTER_NAME );
+ private String clusterName;
+
+ @Inject
+ private RepositorySessionFactoryBean repositorySessionFactoryBean;
@PostConstruct
public void initialize()
{
-
+ // skip initialisation if not cassandra
+ if ( !StringUtils.equals( repositorySessionFactoryBean.getId(), "cassandra" ) )
+ {
+ return;
+ }
final CassandraHostConfigurator configurator =
new CassandraHostConfigurator( cassandraHost + ":" + cassandraPort );
configurator.setMaxActive( maxActive );
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 2f41d4d6f..4ae693ccf 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
@@ -51,20 +51,11 @@ public class JcrRepositorySessionFactory
@Inject
private ApplicationContext applicationContext;
- /**
- *
- */
private Map<String, MetadataFacetFactory> metadataFacetFactories;
- /**
- *
- */
@Inject
private Repository repository;
- /**
- *
- */
@Inject
private MetadataResolver metadataResolver;