Author: matthieu
Date: Thu Oct 29 14:13:27 2015
New Revision: 1711267

URL: http://svn.apache.org/viewvc?rev=1711267&view=rev
Log:
JAMES-1588 Provide Session factory bridge for Spring

Added:
    
james/project/trunk/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/SpringStaticSessionFactory.java

Added: 
james/project/trunk/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/SpringStaticSessionFactory.java
URL: 
http://svn.apache.org/viewvc/james/project/trunk/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/SpringStaticSessionFactory.java?rev=1711267&view=auto
==============================================================================
--- 
james/project/trunk/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/SpringStaticSessionFactory.java
 (added)
+++ 
james/project/trunk/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/SpringStaticSessionFactory.java
 Thu Oct 29 14:13:27 2015
@@ -0,0 +1,38 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.backends.cassandra.init;
+
+import java.util.List;
+
+import com.datastax.driver.core.Cluster;
+import com.datastax.driver.core.Session;
+import org.apache.james.backends.cassandra.components.CassandraModule;
+
+public class SpringStaticSessionFactory {
+
+    public static Session createSession(Cluster cluster, String keyspace, 
List<CassandraModule> modules) {
+        return new 
SessionWithInitializedTablesFactory(modules).createSession(cluster, keyspace);
+    }
+
+    public static Session createSession(Cluster cluster, List<CassandraModule> 
modules) {
+        return new 
SessionWithInitializedTablesFactory(modules).createSession(cluster);
+    }
+
+}
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to