You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by rw...@apache.org on 2014/05/16 13:23:14 UTC

svn commit: r1595158 [1/3] - in /stanbol/branches/release-0.12: commons/ commons/marmotta/ commons/marmotta/kiwi/ commons/marmotta/kiwi/src/ commons/marmotta/kiwi/src/main/ commons/marmotta/kiwi/src/main/java/ commons/marmotta/kiwi/src/main/java/org/ c...

Author: rwesten
Date: Fri May 16 11:23:13 2014
New Revision: 1595158

URL: http://svn.apache.org/r1595158
Log:
STANBOL-1245: commons.marmotta.kiwi is an OSGI Bundle for the Marmotta Kiwi Triplestore that also provides a OSGI Component to configure Kiwi TripleStore instances. The launchers.bundlelists.marmotta.kiwi module provides a bundlelist with all the dependencies required for the Kiwi Triplestore. Dependencies for some supported DBs and Caching options are commented

Added:
    stanbol/branches/release-0.12/commons/marmotta/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/pom.xml
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/apache/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/apache/stanbol/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/apache/stanbol/commons/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/apache/stanbol/commons/marmotta/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/apache/stanbol/commons/marmotta/kiwi/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/apache/stanbol/commons/marmotta/kiwi/KiWiRepositoryService.java
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/OSGI-INF/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/OSGI-INF/metatype/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/OSGI-INF/metatype/metatype.properties
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/infinispan-core-component-metadata.dat   (with props)
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-ec2.xml
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-tcp.xml
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-udp.xml
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/schema/
    stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/schema/infinispan-config-6.0.xsd
    stanbol/branches/release-0.12/launchers/bundlelists/marmotta/
    stanbol/branches/release-0.12/launchers/bundlelists/marmotta/kiwi/
    stanbol/branches/release-0.12/launchers/bundlelists/marmotta/kiwi/pom.xml
    stanbol/branches/release-0.12/launchers/bundlelists/marmotta/kiwi/src/
    stanbol/branches/release-0.12/launchers/bundlelists/marmotta/kiwi/src/main/
    stanbol/branches/release-0.12/launchers/bundlelists/marmotta/kiwi/src/main/bundles/
    stanbol/branches/release-0.12/launchers/bundlelists/marmotta/kiwi/src/main/bundles/list.xml
Modified:
    stanbol/branches/release-0.12/commons/pom.xml
    stanbol/branches/release-0.12/launchers/bundlelists/pom.xml
    stanbol/branches/release-0.12/launchers/full/pom.xml

Added: stanbol/branches/release-0.12/commons/marmotta/kiwi/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/branches/release-0.12/commons/marmotta/kiwi/pom.xml?rev=1595158&view=auto
==============================================================================
--- stanbol/branches/release-0.12/commons/marmotta/kiwi/pom.xml (added)
+++ stanbol/branches/release-0.12/commons/marmotta/kiwi/pom.xml Fri May 16 11:23:13 2014
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 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. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>stanbol-parent</artifactId>
+      <version>4.1-SNAPSHOT</version>
+      <relativePath>../../../parent</relativePath>
+    </parent>
+
+    <artifactId>org.apache.stanbol.commons.marmotta.kiwi</artifactId>
+      <version>0.12.1-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Marmotta Kiwi Repository Service</name>
+    <description>
+      Provides the Kiwi TripleStore as OSGI service
+    </description>
+
+    <inceptionYear>2014</inceptionYear>
+
+    <!-- properties> 
+     <sling.url>http://localhost:8180/system/console</sling.url>
+    </properties -->
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Export-Package>
+                        </Export-Package>
+                        <!-- Allow the use of Kiwi Triplestore spcific APIs -->
+                        <_exportcontents>
+                            org.apache.marmotta.kiwi.*;version=${marmotta-version}
+                        </_exportcontents>
+                        <Private-Package>
+                            org.apache.stanbol.commons.marmotta.kiwi;version=${project.version}
+                        </Private-Package>
+                        <Embed-Dependency>
+                            kiwi-triplestore, kiwi-sparql,
+                            marmotta-util-tripletable,
+                            kiwi-caching-infinispan, kiwi-caching-hazelcast,
+                            kiwi-caching-ehcache,
+                            tomcat-jdbc, tomcat-juli, postgresql
+                        </Embed-Dependency>
+                        <!-- DynamicImport-Package is needed for
+                           * Infinispan to load different cache implementations
+                           * Loading data base drivers with class for name
+                            -->
+                        <DynamicImport-Package>*</DynamicImport-Package>
+                        <!-- NOTE: all Cache implementations are optional -->
+                        <Import-Package>
+                            !javax.microedition,
+                            !org.apache.felix.scrplugin,
+                            !javax.swing,
+                            com.google.common.*;version="[14,18)",
+                            org.hibernate.*;resolution:=optional,
+                            com.thoughtworks.qdox;resolution:=optional,
+                            javax.inject;resolution:=optional,
+                            javax.transaction.*;resolution:=optional,
+                            net.sf.ehcache*;resolution:=optional,
+                            org.infinispan*;resolution:=optional,
+                            org.jboss.marshalling*;resolution:=optional,
+                            com.hazelcast.*;resolution:=optional,
+                            *
+                        </Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>kiwi-triplestore</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>marmotta-util-tripletable</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>kiwi-sparql</artifactId>
+        </dependency>
+        <!-- Caching dependencies -->
+        <!-- The marmotta caching implementations are requred and embedded
+             the Caching frameworks and their dependencies are marked as
+             optional. Users will need to make those available if they want 
+             to use the according caching dependency. (see also the 
+             marmotta kiwirepository bundlelist 
+         -->
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>kiwi-caching-infinispan</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>kiwi-caching-ehcache</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>kiwi-caching-hazelcast</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-repository-sail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-repository-contextaware</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <version>9.2-1003-jdbc4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tomcat</groupId>
+            <artifactId>tomcat-jdbc</artifactId>
+            <version>7.0.50</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tomcat</groupId>
+            <artifactId>tomcat-juli</artifactId>
+            <version>7.0.50</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+    </dependencies>
+
+</project>

Added: stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/apache/stanbol/commons/marmotta/kiwi/KiWiRepositoryService.java
URL: http://svn.apache.org/viewvc/stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/apache/stanbol/commons/marmotta/kiwi/KiWiRepositoryService.java?rev=1595158&view=auto
==============================================================================
--- stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/apache/stanbol/commons/marmotta/kiwi/KiWiRepositoryService.java (added)
+++ stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/java/org/apache/stanbol/commons/marmotta/kiwi/KiWiRepositoryService.java Fri May 16 11:23:13 2014
@@ -0,0 +1,485 @@
+package org.apache.stanbol.commons.marmotta.kiwi;
+
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.text.StrLookup;
+import org.apache.commons.lang3.text.StrSubstitutor;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.ConfigurationPolicy;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.PropertyOption;
+import org.apache.marmotta.kiwi.config.CacheMode;
+import org.apache.marmotta.kiwi.config.CachingBackends;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.persistence.KiWiDialect;
+import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
+import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSail;
+import org.openrdf.repository.Repository;
+import org.openrdf.repository.RepositoryException;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.Sail;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * OSGI Component that allows to setup a Sesame {@link Repository} for a
+ * KiWi TripleStore. The configured {@link Repository} is registered as
+ * OSGI service so that it can be used by other components. <p>
+ * All {@link ComponentContext#getProperties() configuration properties} parsed
+ * to this component are also added to the registered service. This menas that
+ * others can use them to listen for a specific {@link Repository} instance 
+ * (by using an {@link Filter}). Especially usefull for filtering is the
+ * {@link #KIWI_REP_ID}<p>
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ * @author Rupert Westenthaler - refactored to directly register the {@link Repository}
+ * as OSGI service.
+ */
+@Component(
+        configurationFactory=true, //allow multiple instances
+        policy= ConfigurationPolicy.REQUIRE, //the ID is required!
+        specVersion="1.1",
+        metatype = true,
+        immediate = true
+)
+public class KiWiRepositoryService {
+
+    private static Logger log = LoggerFactory.getLogger(KiWiRepositoryService.class);
+
+    /**
+     * The '</code>org.openrdf.repository.Repository.id</code>' intended to be 
+     * used to {@link Filter} for a specific {@link Repository} instance.
+     */
+    @Property(value="kiwi")
+    public static final String REPOSITORY_ID = "org.openrdf.repository.Repository.id";
+    /**
+     * The '</code>org.openrdf.sail.Sail.impl</code>' intended to be 
+     * used to {@link Filter} for a specific {@link Sail} implementations backing
+     * the registered {@link Repository} service. <p>
+     * The KiWiRepositoryService sets this property to the {@link Class#getName()} of
+     * the {@link KiWiStore} for every registered {@link Repository}.
+     */
+    public static final String SAIL_IMPL = "org.openrdf.sail.Sail.impl";
+    
+    /**
+     * The Database dialect
+     */
+    @Property(options = {
+            @PropertyOption(value = '%' + KiWiRepositoryService.DB_DIALECT + ".option." 
+                    + KiWiRepositoryService.DB_DIALECT_POSTGRES, name = KiWiRepositoryService.DB_DIALECT_POSTGRES),
+            @PropertyOption(value = '%' + KiWiRepositoryService.DB_DIALECT + ".option." 
+                    + KiWiRepositoryService.DB_DIALECT_MYSQL, name = KiWiRepositoryService.DB_DIALECT_MYSQL),
+            @PropertyOption(value = '%' + KiWiRepositoryService.DB_DIALECT + ".option." 
+                    + KiWiRepositoryService.DB_DIALECT_H2, name = KiWiRepositoryService.DB_DIALECT_H2)},
+    value = KiWiRepositoryService.DEFAULT_DB_DIALECT)
+    public static final String DB_DIALECT = "marmotta.kiwi.dialect";
+
+    /**
+     * Dialect for Postgres
+     */
+    public static final String DB_DIALECT_POSTGRES = "postgres";
+    /**
+     * Diablect for MySQL
+     */
+    public static final String DB_DIALECT_MYSQL = "mysql";
+    /**
+     * Dialect for H2
+     */
+    public static final String DB_DIALECT_H2 = "h2";
+    
+    /**
+     * The default database dialect is {@link #DB_DIALECT_POSTGRES}
+     */
+    public static final String DEFAULT_DB_DIALECT = DB_DIALECT_H2;
+
+    /**
+     * The database URL. THis property can be used instead of configuring
+     * the DB options in separate properties. If this property is present the
+     * other DB configurations will get ignored.
+     */
+    @Property
+    public static final String DB_URL = "marmotta.kiwi.dburl";
+
+    /**
+     * The database host
+     */
+    @Property(value = KiWiRepositoryService.DEFAULT_DB_HOST)
+    public static final String DB_HOST = "marmotta.kiwi.host";
+
+    /**
+     * The default database host (a file path in case of H2)
+     */
+    public static final String DEFAULT_DB_HOST = "${sling.home}/marmotta/kiwi";
+
+    /**
+     * The database port
+     */
+    @Property(intValue = KiWiRepositoryService.DEFAULT_DB_PORT)
+    public static final String DB_PORT = "marmotta.kiwi.port";
+
+    /**
+     * The default database part (<code>-1</code> to use the default)
+     */
+    public static final int DEFAULT_DB_PORT = -1;
+    
+    /**
+     * The database name
+     */
+    @Property(value = KiWiRepositoryService.DEFAULT_DB_NAME)
+    public static final String DB_NAME = "marmotta.kiwi.database";
+
+    /**
+     * The default database name
+     */
+    public static final String DEFAULT_DB_NAME = "kiwi";
+    
+    /**
+     * The database user name
+     */
+    @Property(value = KiWiRepositoryService.DEFAULT_DB_USER)
+    public static final String DB_USER = "marmotta.kiwi.user";
+
+    /**
+     * The default db user
+     */
+    public static final String DEFAULT_DB_USER = "kiwi";
+
+    /**
+     * The database user password
+     */
+    @Property(value = KiWiRepositoryService.DEFAULT_DB_PASS)
+    public static final String DB_PASS = "marmotta.kiwi.password";
+
+    /**
+     * The default password
+     */
+    public static final String DEFAULT_DB_PASS = "kiwi";
+
+    /**
+     * Additional DB options
+     */
+    @Property(value=";MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10")
+    public static final String DB_OPTS = "marmotta.kiwi.options";
+
+    /**
+     * The cluster name 
+     */
+    @Property(value=KiWiRepositoryService.DEFAULT_CLUSTER)
+    public static final String CLUSTER = "marmotta.kiwi.cluster";
+
+
+    public static final String DEFAULT_CLUSTER = "kiwi default";
+
+    /**
+     * The cluster address 
+     */
+    @Property
+    public static final String CLUSTER_ADDRESS = "marmotta.kiwi.cluster.address";
+
+    /**
+     * The cluster port 
+     */
+    @Property(intValue=-1)
+    public static final String CLUSTER_PORT = "marmotta.kiwi.cluster.port";
+
+    @Property(options={
+            @PropertyOption(value='%' + KiWiRepositoryService.CACHE_MODE + ".option.local",
+                    name=KiWiRepositoryService.CACHE_MODE_LOCAL),
+            @PropertyOption(value='%' + KiWiRepositoryService.CACHE_MODE + ".option.replicated",
+                    name=KiWiRepositoryService.CACHE_MODE_REPLICATED),
+            @PropertyOption(value='%' + KiWiRepositoryService.CACHE_MODE + ".option.distributed",
+                    name=KiWiRepositoryService.CACHE_MODE_DISTRIBUTED)}, 
+            value=KiWiRepositoryService.DEFAULT_CACHE_MODE)
+    public static final String CACHE_MODE = "marmotta.kiwi.cluster.cachemode";
+
+    public static final String CACHE_MODE_LOCAL = "LOCAL";
+    public static final String CACHE_MODE_REPLICATED = "REPLICATED";
+    public static final String CACHE_MODE_DISTRIBUTED = "DISTRIBUTED";
+    public static final String DEFAULT_CACHE_MODE = CACHE_MODE_LOCAL;
+
+    
+    @Property(options={
+            @PropertyOption(value='%' + KiWiRepositoryService.CACHING_BACKEND + ".option.ehcache",
+                    name=KiWiRepositoryService.CACHING_BACKEND_EHCACHE),
+            @PropertyOption(value='%' + KiWiRepositoryService.CACHING_BACKEND + ".option.guava",
+                    name=KiWiRepositoryService.CACHING_BACKEND_GUAVA),
+            @PropertyOption(value='%' + KiWiRepositoryService.CACHING_BACKEND + ".option.hazelcast",
+                    name=KiWiRepositoryService.CACHING_BACKEND_HAZELCAST), 
+            @PropertyOption(value='%' + KiWiRepositoryService.CACHING_BACKEND + ".option.infinispan-clustered",
+                    name=KiWiRepositoryService.CACHING_BACKEND_INFINISPAN_CLUSTERED), 
+            @PropertyOption(value='%' + KiWiRepositoryService.CACHING_BACKEND + ".option.infinispan-hotrod",
+                    name=KiWiRepositoryService.CACHING_BACKEND_INFINISPAN_HOTROD)}, 
+            value=KiWiRepositoryService.DEFAULT_CACHING_BACKEND)
+    public static final String CACHING_BACKEND = "marmotta.kiwi.cluster.cachingbackend";
+    
+    public static final String CACHING_BACKEND_EHCACHE = "EHCACHE";
+    public static final String CACHING_BACKEND_GUAVA = "GUAVA";
+    public static final String CACHING_BACKEND_HAZELCAST = "HAZELCAST";
+    public static final String CACHING_BACKEND_INFINISPAN_CLUSTERED = "INFINISPAN_CLUSTERED";
+    public static final String CACHING_BACKEND_INFINISPAN_HOTROD = "INFINISPAN_HOTROD";
+    public static final String DEFAULT_CACHING_BACKEND = CACHING_BACKEND_GUAVA;
+    
+//    @Property(intValue = KiWiRepositoryService.DEFAULT_DB_POOL)
+//    public static final String DB_POOL = "marmotta.kiwi.pool_size";
+//
+//    public static final int DEFAULT_DB_POOL = 20;
+
+    /**
+     * The Kiwi {@link Repository} as configured in the 
+     * {@link #activate(ComponentContext)} method
+     */
+    private Repository repository;
+
+    /**
+     * The registration for the {@link #repository}
+     */
+    private ServiceRegistration repoRegistration;
+    
+    /**
+     * The database url.
+     */
+    private String dbUrl;
+
+    @Activate
+    protected final void activate(ComponentContext context) throws ConfigurationException, RepositoryException {
+        log.info("activate KiWi repository ...");
+        if(context == null || context.getProperties() == null){
+            throw new IllegalStateException("No valid"+ComponentContext.class+" parsed in activate!");
+        }
+        //copy the read-only configuration as we might need to change it before
+        //adding it to the registered service
+        final Dictionary<String, Object> config = copyConfig(context);
+        final BundleContext bc = context.getBundleContext();
+        //we want to substitute variables used in the dbURL with configuration, 
+        //framework and system properties
+        StrSubstitutor strSubstitutor = new StrSubstitutor(new StrLookup<Object>() {
+
+            @Override
+            public String lookup(String key) {
+                Object val = config.get(key);
+                if(val == null){
+                    val = bc.getProperty(key);
+                }
+                return val.toString();
+            }
+            
+        });
+        String name = (String)config.get(REPOSITORY_ID);
+        if(StringUtils.isBlank(name)){
+            throw new ConfigurationException(REPOSITORY_ID, "The parsed Repository ID MUST NOT be NULL nor blank!");
+        } else {
+        	log.debug(" - name: {}", name);
+        }
+        KiWiDialect dialect;
+        String db_type;
+        if(StringUtils.equalsIgnoreCase("postgres",(String)config.get(DB_DIALECT))) {
+            dialect = new PostgreSQLDialect();
+            db_type = "postgresql";
+        } else if(StringUtils.equalsIgnoreCase("mysql",(String)config.get(DB_DIALECT))) {
+            dialect = new MySQLDialect();
+            db_type = "mysql";
+        } else if(StringUtils.equalsIgnoreCase("h2",(String)config.get(DB_DIALECT))) {
+            dialect = new H2Dialect();
+            db_type = "h2";
+        } else {
+            throw new ConfigurationException(DB_DIALECT,"No valid database dialect was given");
+        }
+        log.debug(" - dialect: {}", dialect);
+        String db_url = (String)config.get(DB_URL);
+        if(StringUtils.isBlank(db_url)){
+            //build the db url from parameters
+    
+            String db_host = (String)config.get(DB_HOST);
+            if(StringUtils.isBlank(db_host)){
+                db_host = DEFAULT_DB_HOST;
+            }
+            log.debug(" - db host: {}",db_host);
+            String db_name = (String)config.get(DB_NAME);
+            if(StringUtils.isBlank(db_name)){
+                db_name = DEFAULT_DB_NAME;
+            }
+            log.debug(" - db name:  {}",name);
+            int    db_port;
+            Object value = config.get(DB_PORT);
+            if(value instanceof Number){
+                db_port = ((Number)value).intValue();
+            } else if(value != null && !StringUtils.isBlank(value.toString())){
+                db_port = Integer.parseInt(value.toString());
+            } else {
+                db_port = DEFAULT_DB_PORT;
+            }
+            log.debug(" - db port: {}", db_port);
+            String db_opts = (String)config.get(DB_OPTS);
+            log.debug(" - db options: {}",db_opts);
+            StringBuilder dbUrlBuilder = new StringBuilder("jdbc:").append(db_type);
+            if(dialect instanceof H2Dialect){
+                //H2 uses a file path and not a host so we do not need the ://
+                dbUrlBuilder.append(':').append(db_host);
+            } else {
+                dbUrlBuilder.append("://").append(db_host);
+            }
+            if(db_port > 0){
+                dbUrlBuilder.append(':').append(db_port);
+            }
+            if(!StringUtils.isBlank(db_name)){
+                dbUrlBuilder.append('/').append(db_name);
+            }
+            if(!StringUtils.isBlank(db_opts)){
+                dbUrlBuilder.append(db_opts);
+            }
+            dbUrl = strSubstitutor.replace(dbUrlBuilder);
+        } else if(!db_url.startsWith("jdbc:")){
+            throw new ConfigurationException(DB_URL, "Database URLs are expected to start with " +
+                    "'jdbc:' (parsed: '"+db_url+"')!");
+        } else {
+            dbUrl = strSubstitutor.replace(db_url);
+        }
+        
+        String db_user = (String)config.get(DB_USER);
+        if(StringUtils.isBlank(db_user)){
+            db_user = DEFAULT_DB_USER;
+        } else {
+            db_user = strSubstitutor.replace(db_user);
+        }
+        log.debug(" - db user: {}", db_user);
+        String db_pass = (String)config.get(DB_PASS);
+        if(StringUtils.isBlank(db_pass)){
+            log.debug(" - db pwd is set to default");
+            db_pass = DEFAULT_DB_PASS;
+        } else {
+            log.debug(" - db pwd is set to parsed value");
+        }
+
+        KiWiConfiguration configuration = new KiWiConfiguration("Marmotta KiWi",dbUrl,db_user,db_pass,dialect);
+        
+        //parse cluster options
+        String cluster = (String)config.get(CLUSTER);
+        if(!StringUtils.isBlank(cluster)){
+            log.debug(" - cluster: {}", cluster);
+	        configuration.setClustered(true);
+	        configuration.setClusterName(cluster);
+	        String clusterAddress = (String)config.get(CLUSTER_ADDRESS);
+	        if(!StringUtils.isBlank(clusterAddress)){
+	        	configuration.setClusterAddress(
+	        	    strSubstitutor.replace(clusterAddress));
+	        }
+            log.debug(" - cluster address: {}", configuration.getClusterAddress());
+
+        	Object clusterPort = config.get(CLUSTER_PORT);
+        	if(clusterPort instanceof Number){
+        	    int port = ((Number)clusterPort).intValue();
+        	    if(port > 0){
+        	        configuration.setClusterPort(port);
+        	    } //else use default
+        	} else if(clusterPort != null){
+        	    try {
+        	        int port = Integer.parseInt(
+        	            strSubstitutor.replace(clusterPort));
+        	        if(port > 0) {
+        	            configuration.setClusterPort(port);
+        	        }
+        	    } catch (NumberFormatException e){
+        	        throw new ConfigurationException(CLUSTER_PORT, "Unable to parse "
+        	            + "Cluster Port from configured value '"+clusterPort+"'!",e);
+        	    }
+        	}
+	      	log.debug(" - cluster port ({})", configuration.getClusterPort());
+	        String cachingBackend = (String)config.get(CACHING_BACKEND);
+            if(StringUtils.isBlank(cachingBackend)){
+                configuration.setCachingBackend(
+                    CachingBackends.valueOf(DEFAULT_CACHING_BACKEND));
+            } else {
+                try {
+                    configuration.setCachingBackend(CachingBackends.valueOf(
+                        strSubstitutor.replace(cachingBackend)));
+                } catch (IllegalArgumentException e){
+                    throw new ConfigurationException(CACHING_BACKEND, 
+                        "Unsupported CachingBackend '" + cachingBackend 
+                        + "' (supported: "+Arrays.toString(CachingBackends.values())
+                        + ")!", e);
+                }
+            }
+            log.debug(" - caching Backend: {}",configuration.getCachingBackend());
+	        String cacheMode = (String)config.get(CACHE_MODE);
+	        if(StringUtils.isBlank(cacheMode)){
+	            cacheMode = DEFAULT_CACHE_MODE;
+	        }
+	        try {
+	            configuration.setCacheMode(CacheMode.valueOf(
+	                strSubstitutor.replace(cacheMode)));
+	        } catch (IllegalArgumentException e){
+	            throw new ConfigurationException(CACHE_MODE, "Unsupported CacheMode '"
+	                + cacheMode + "' (supported: "+Arrays.toString(CacheMode.values())
+	                + ")!");
+	        }
+	        log.debug(" - cache mode: {}",configuration.getCacheMode());
+        } else { // not clustered
+        	log.debug(" - no cluster configured");
+        	configuration.setClustered(false);
+        }
+        log.info(" ... initialise KiWi repository: {}", dbUrl);
+        KiWiStore store = new KiWiStore(configuration);
+        repository = new SailRepository(new KiWiSparqlSail(store));
+        repository.initialize();
+        //set the repository type property to KiWiStore
+        config.put(SAIL_IMPL, KiWiStore.class.getName());
+        repoRegistration = context.getBundleContext().registerService(
+        		Repository.class.getName(), repository, config);
+        log.info("  - successfully registered KiWi Repository {}", name);
+    }
+        
+    @Deactivate
+    protected final void deactivate(ComponentContext context) throws RepositoryException {
+    	log.info("> deactivate KiWi repository: database URL is {}", dbUrl);
+    	if(repoRegistration != null){
+    		log.info(" - unregister Service");
+    		repoRegistration.unregister();
+    		repoRegistration = null;
+            log.info("  ... unregistered");
+    	}
+    	if(repository != null){
+    		log.info(" - shutdown Repository");
+    		repository.shutDown();
+            log.info("  ... done");
+            repository = null;
+    	} else {
+    		log.info(" - repository was not active (ignore call)");
+    	}
+    }
+    
+	/**
+	 * Copies the read-only configuration parsed by 
+	 * {@link ComponentContext#getProperties()} to an other {@link Dictionary}
+	 * so that it can be modified.
+	 * @param context the context
+	 * @return the copied configuration
+	 */
+	private Dictionary<String, Object> copyConfig(ComponentContext context) {
+		Dictionary<String, Object> properties = new Hashtable<String, Object>();
+        @SuppressWarnings("unchecked")
+		Dictionary<String,Object> config = context.getProperties();
+        for(Enumeration<String> keys = config.keys(); keys.hasMoreElements(); ){
+        	String key = keys.nextElement();
+        	properties.put(key, config.get(key));
+        }
+		return properties;
+	}
+
+}

Added: stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/OSGI-INF/metatype/metatype.properties
URL: http://svn.apache.org/viewvc/stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=1595158&view=auto
==============================================================================
--- stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/OSGI-INF/metatype/metatype.properties (added)
+++ stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/OSGI-INF/metatype/metatype.properties Fri May 16 11:23:13 2014
@@ -0,0 +1,88 @@
+# 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.
+
+#===============================================================================
+#Properties and Options used to configure EnhancerWebFragment
+#===============================================================================
+
+org.apache.stanbol.commons.marmotta.kiwi.KiWiRepositoryService.name=Marmotta \
+Kiwi TrippleStore Service
+org.apache.stanbol.commons.marmotta.kiwi.KiWiRepositoryService.description=\
+Allows to configure a Apache Marmotta Kiwi TripleStore and register the Sesame \
+Repository as OSGI service
+
+org.openrdf.repository.Repository.id.name=Repository Name
+org.openrdf.repository.Repository.id.name.description=The Name for the Repository. \
+Typically used by Components to filter for a specific Repository in case multiple \
+are available.
+
+marmotta.kiwi.dialect.name=DB Dialect
+marmotta.kiwi.dialect.description=database dialect to use (default = postgres). \
+NOTE that database options do have additional requirements that need to be \
+available.
+marmotta.kiwi.dialect.option.postgres=PostgreSQL
+marmotta.kiwi.dialect.option.mysql=MySQL
+marmotta.kiwi.dialect.option.h2=H2
+
+marmotta.kiwi.dburl.name=DB URL
+marmotta.kiwi.dburl.description=The Database URL for the Kiwi Repository. If present\
+DB host, port, name and options parameters are ignored.
+
+marmotta.kiwi.host.name=DB Host
+marmotta.kiwi.host.description=database host name where the database is located
+
+marmotta.kiwi.port.name=DB Port
+marmotta.kiwi.port.description=database port number where the database is located
+
+marmotta.kiwi.database.name=DB Name
+marmotta.kiwi.database.description=database name to use for accessing the database
+
+marmotta.kiwi.user.name=DB User
+marmotta.kiwi.user.description=database user name to use for accessing the database
+
+marmotta.kiwi.password.name=DB Password
+marmotta.kiwi.password.description=database password to use for accessing the database
+
+marmotta.kiwi.options.name=DB Options
+marmotta.kiwi.options.description=database options to use for accessing the database
+
+marmotta.kiwi.pool_size.name=Pool Size
+marmotta.kiwi.pool_size.description=database connection pool size to use (default = 20)
+
+marmotta.kiwi.cluster.name=Cluster Name
+marmotta.kiwi.cluster.description=Name of the Marmotta cluster this repository participates in.\
+An empty String or missing configuration will deactivate clustering.
+
+marmotta.kiwi.cluster.address.name=Cluster Address
+marmotta.kiwi.cluster.address.description=The multicast IP Address used for the cluster
+
+marmotta.kiwi.cluster.port.name=Cluster Port
+marmotta.kiwi.cluster.port.description=The port used for the cluster
+
+marmotta.kiwi.cluster.cachemode.name=Cache Mode
+marmotta.kiwi.cluster.cachemode.description=The mode of the Cache (LOCAL, REPLICATED or DISTRIBUTED)
+marmotta.kiwi.cluster.cachemode.option.local=Local
+marmotta.kiwi.cluster.cachemode.option.replicated=Replicated
+marmotta.kiwi.cluster.cachemode.option.distributed=Distributed
+
+
+marmotta.kiwi.cluster.cachingbackend.name=Caching Backend
+marmotta.kiwi.cluster.cachingbackend.description=The Caching Backend used by the Kiwi TripleStore. \
+NOTE that Caching options require additional dependency users need to made available.
+marmotta.kiwi.cluster.cachingbackend.option.guava=Guava in-memory Cache
+marmotta.kiwi.cluster.cachingbackend.option.ehcache=EH Cache
+marmotta.kiwi.cluster.cachingbackend.option.infinispan-clustered=Infinispan Clustered
+marmotta.kiwi.cluster.cachingbackend.option.infinispan-hotrod= Infinispan Hotrod (client-server)
+marmotta.kiwi.cluster.cachingbackend.option.hazelcast=Hazelcast
\ No newline at end of file

Added: stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/infinispan-core-component-metadata.dat
URL: http://svn.apache.org/viewvc/stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/infinispan-core-component-metadata.dat?rev=1595158&view=auto
==============================================================================
Binary file - no diff available.

Propchange: stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/infinispan-core-component-metadata.dat
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-ec2.xml
URL: http://svn.apache.org/viewvc/stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-ec2.xml?rev=1595158&view=auto
==============================================================================
--- stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-ec2.xml (added)
+++ stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-ec2.xml Fri May 16 11:23:13 2014
@@ -0,0 +1,72 @@
+<config xmlns="urn:org:jgroups"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.4.xsd">
+   <TCP
+        bind_addr="${jgroups.tcp.address:127.0.0.1}"
+        bind_port="${jgroups.tcp.port:7800}"
+        loopback="true"
+        port_range="30"
+        recv_buf_size="20000000"
+        send_buf_size="640000"
+        max_bundle_size="31k"
+        use_send_queues="true"
+        sock_conn_timeout="300"
+        enable_diagnostics="false"
+        
+        bundler_type="old"
+
+        thread_pool.enabled="true"
+        thread_pool.min_threads="2"
+        thread_pool.max_threads="30"
+        thread_pool.keep_alive_time="60000"
+        thread_pool.queue_enabled="false"
+        thread_pool.queue_max_size="100"
+        thread_pool.rejection_policy="Discard"
+
+        oob_thread_pool.enabled="true"
+        oob_thread_pool.min_threads="2"
+        oob_thread_pool.max_threads="30"
+        oob_thread_pool.keep_alive_time="60000"
+        oob_thread_pool.queue_enabled="false"
+        oob_thread_pool.queue_max_size="100"
+        oob_thread_pool.rejection_policy="Discard"
+
+        internal_thread_pool.enabled="true"
+        internal_thread_pool.min_threads="1"
+        internal_thread_pool.max_threads="10"
+        internal_thread_pool.keep_alive_time="60000"
+        internal_thread_pool.queue_enabled="true"
+        internal_thread_pool.queue_max_size="100"
+        internal_thread_pool.rejection_policy="Discard"
+        />
+
+   <S3_PING secret_access_key="${jgroups.s3.secret_access_key}" access_key="${jgroups.s3.access_key}" location="${jgroups.s3.bucket:jgroups}" />
+
+   <MERGE2 max_interval="30000"
+           min_interval="10000"/>
+   <FD_SOCK/>
+   <FD timeout="3000" max_tries="5"/>
+   <VERIFY_SUSPECT timeout="1500"/>
+   <pbcast.NAKACK2
+   					use_mcast_xmit="false"
+                    xmit_interval="1000"
+                    xmit_table_num_rows="100"
+                    xmit_table_msgs_per_row="10000"
+                    xmit_table_max_compaction_time="10000"
+                    max_msg_batch_size="100"/>
+
+   <UNICAST3
+              xmit_table_num_rows="20"
+              xmit_table_msgs_per_row="10000"
+              xmit_table_max_compaction_time="10000"
+              max_msg_batch_size="100"
+              conn_expiry_timeout="0"/>
+   <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                  max_bytes="400000"/>
+   <pbcast.GMS print_local_addr="false" join_timeout="7000" view_bundling="true"/>
+   <tom.TOA/> <!-- the TOA is only needed for total order transactions-->
+   <UFC max_credits="2m" min_threshold="0.40"/>
+   <MFC max_credits="2m" min_threshold="0.40"/>
+   <FRAG2 frag_size="30k"  />
+   <RSVP timeout="60000" resend_interval="500" ack_on_delivery="false"/>
+</config>

Added: stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-tcp.xml
URL: http://svn.apache.org/viewvc/stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-tcp.xml?rev=1595158&view=auto
==============================================================================
--- stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-tcp.xml (added)
+++ stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-tcp.xml Fri May 16 11:23:13 2014
@@ -0,0 +1,85 @@
+<config xmlns="urn:org:jgroups"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.4.xsd">
+   <TCP
+        bind_addr="${jgroups.tcp.address:127.0.0.1}"
+        bind_port="${jgroups.tcp.port:7800}"
+        loopback="true"
+        port_range="30"
+        recv_buf_size="20m"
+        send_buf_size="640k"
+        max_bundle_size="31k"
+        use_send_queues="true"
+        enable_diagnostics="false"
+        bundler_type="old"
+
+        thread_naming_pattern="pl"
+
+        thread_pool.enabled="true"
+        thread_pool.min_threads="2"
+        thread_pool.max_threads="30"
+        thread_pool.keep_alive_time="60000"
+        thread_pool.queue_enabled="true"
+        thread_pool.queue_max_size="100"
+        thread_pool.rejection_policy="Discard"
+
+        oob_thread_pool.enabled="true"
+        oob_thread_pool.min_threads="2"
+        oob_thread_pool.max_threads="30"
+        oob_thread_pool.keep_alive_time="60000"
+        oob_thread_pool.queue_enabled="false"
+        oob_thread_pool.queue_max_size="100"
+        oob_thread_pool.rejection_policy="Discard"
+
+        internal_thread_pool.enabled="true"
+        internal_thread_pool.min_threads="1"
+        internal_thread_pool.max_threads="10"
+        internal_thread_pool.keep_alive_time="60000"
+        internal_thread_pool.queue_enabled="true"
+        internal_thread_pool.queue_max_size="100"
+        internal_thread_pool.rejection_policy="Discard"
+        />
+
+   <!-- Ergonomics, new in JGroups 2.11, are disabled by default in TCPPING until JGRP-1253 is resolved -->
+   <!--
+   <TCPPING timeout="3000"
+            initial_hosts="localhost[7800],localhost[7801]"
+            port_range="5"
+            num_initial_members="3"
+            ergonomics="false"
+        />
+   -->
+
+   <MPING bind_addr="${jgroups.bind_addr:127.0.0.1}" break_on_coord_rsp="true"
+      mcast_addr="${jgroups.mping.mcast_addr:228.2.4.6}"
+      mcast_port="${jgroups.mping.mcast_port:43366}"
+      ip_ttl="${jgroups.udp.ip_ttl:2}"
+      num_initial_members="3"/>
+   <MERGE2 max_interval="30000" min_interval="10000"/>
+
+   <FD_SOCK/>
+   <FD timeout="3000" max_tries="5"/>
+   <VERIFY_SUSPECT timeout="1500"/>
+
+   <pbcast.NAKACK2 use_mcast_xmit="false"
+                   xmit_interval="1000"
+                   xmit_table_num_rows="100"
+                   xmit_table_msgs_per_row="10000"
+                   xmit_table_max_compaction_time="10000"
+                   max_msg_batch_size="100"/>
+   <UNICAST3 xmit_interval="500"
+             xmit_table_num_rows="20"
+             xmit_table_msgs_per_row="10000"
+             xmit_table_max_compaction_time="10000"
+             max_msg_batch_size="100"
+             conn_expiry_timeout="0"/>
+
+   <pbcast.STABLE stability_delay="500" desired_avg_gossip="5000" max_bytes="1m"/>
+   <pbcast.GMS print_local_addr="false" join_timeout="3000" view_bundling="true"/>
+   <tom.TOA/> <!-- the TOA is only needed for total order transactions-->
+
+   <UFC max_credits="2m" min_threshold="0.40"/>
+   <MFC max_credits="2m" min_threshold="0.40"/>
+   <FRAG2 frag_size="30k"/>
+   <RSVP timeout="60000" resend_interval="500" ack_on_delivery="false" />
+</config>

Added: stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-udp.xml
URL: http://svn.apache.org/viewvc/stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-udp.xml?rev=1595158&view=auto
==============================================================================
--- stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-udp.xml (added)
+++ stanbol/branches/release-0.12/commons/marmotta/kiwi/src/main/resources/jgroups-udp.xml Fri May 16 11:23:13 2014
@@ -0,0 +1,74 @@
+<config xmlns="urn:org:jgroups"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.4.xsd">
+   <UDP
+         mcast_addr="${jgroups.udp.mcast_addr:228.6.7.8}"
+         mcast_port="${jgroups.udp.mcast_port:46655}"
+         tos="8"
+         ucast_recv_buf_size="20m"
+         ucast_send_buf_size="640k"
+         mcast_recv_buf_size="25m"
+         mcast_send_buf_size="640k"
+         loopback="true"
+         max_bundle_size="31k"
+         ip_ttl="${jgroups.udp.ip_ttl:2}"
+         enable_diagnostics="false"
+         bundler_type="old"
+
+         thread_naming_pattern="pl"
+
+         thread_pool.enabled="true"
+         thread_pool.min_threads="2"
+         thread_pool.max_threads="30"
+         thread_pool.keep_alive_time="60000"
+         thread_pool.queue_enabled="true"
+         thread_pool.queue_max_size="100"
+         thread_pool.rejection_policy="Discard"
+
+         oob_thread_pool.enabled="true"
+         oob_thread_pool.min_threads="2"
+         oob_thread_pool.max_threads="30"
+         oob_thread_pool.keep_alive_time="60000"
+         oob_thread_pool.queue_enabled="false"
+         oob_thread_pool.queue_max_size="100"
+         oob_thread_pool.rejection_policy="Discard"
+
+         internal_thread_pool.enabled="true"
+         internal_thread_pool.min_threads="1"
+         internal_thread_pool.max_threads="10"
+         internal_thread_pool.keep_alive_time="60000"
+         internal_thread_pool.queue_enabled="true"
+         internal_thread_pool.queue_max_size="100"
+         internal_thread_pool.rejection_policy="Discard"
+         />
+
+   <PING timeout="3000" num_initial_members="3"/>
+   <MERGE2 max_interval="30000" min_interval="10000"/>
+
+   <FD_SOCK/>
+   <FD_ALL timeout="15000" interval="3000"/>
+   <VERIFY_SUSPECT timeout="1500"/>
+
+   <pbcast.NAKACK2
+                    xmit_interval="1000"
+                    xmit_table_num_rows="100"
+                    xmit_table_msgs_per_row="10000"
+                    xmit_table_max_compaction_time="10000"
+                    max_msg_batch_size="100"/>
+   <UNICAST3
+              xmit_interval="500"
+              xmit_table_num_rows="20"
+              xmit_table_msgs_per_row="10000"
+              xmit_table_max_compaction_time="10000"
+              max_msg_batch_size="100"
+              conn_expiry_timeout="0"/>
+
+   <pbcast.STABLE stability_delay="500" desired_avg_gossip="5000" max_bytes="1m"/>
+   <pbcast.GMS print_local_addr="false" join_timeout="3000" view_bundling="true"/>
+   <tom.TOA/> <!-- the TOA is only needed for total order transactions-->
+
+   <UFC max_credits="2m" min_threshold="0.40"/>
+   <MFC max_credits="2m" min_threshold="0.40"/>
+   <FRAG2 frag_size="30k"  />
+   <RSVP timeout="60000" resend_interval="500" ack_on_delivery="false" />
+</config>