polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [15/48] polygene-java git commit: New (de)serialization API and SPI & new implementations
Date Mon, 13 Mar 2017 15:28:38 GMT
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTest.java b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTest.java
index aac68f8..24dd298 100644
--- a/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTest.java
+++ b/extensions/entitystore-sql/src/test/java/org/apache/polygene/entitystore/sql/SQLiteEntityStoreTest.java
@@ -19,9 +19,6 @@
  */
 package org.apache.polygene.entitystore.sql;
 
-import java.io.File;
-import org.apache.derby.iapi.services.io.FileUtil;
-import org.junit.BeforeClass;
 import org.apache.polygene.api.common.Visibility;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
@@ -30,7 +27,7 @@ import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
 import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
 import org.apache.polygene.test.EntityTestAssembler;
 import org.apache.polygene.test.entity.AbstractEntityStoreTest;
-import org.apache.polygene.valueserialization.orgjson.OrgJsonValueSerializationAssembler;
+import org.junit.BeforeClass;
 
 import static org.apache.polygene.test.util.Assume.assumeNoIbmJdk;
 
@@ -52,44 +49,28 @@ public class SQLiteEntityStoreTest
         super.assemble( module );
         ModuleAssembly config = module.layer().module( "config" );
         new EntityTestAssembler().assemble( config );
-        new OrgJsonValueSerializationAssembler().assemble( module );
 
         // START SNIPPET: assembly
         // DataSourceService
-        new DBCPDataSourceServiceAssembler().
-            identifiedBy( "sqlite-datasource-service" ).
-            visibleIn( Visibility.module ).
-            withConfig( config, Visibility.layer ).
-            assemble( module );
+        new DBCPDataSourceServiceAssembler()
+            .identifiedBy( "sqlite-datasource-service" )
+            .visibleIn( Visibility.module )
+            .withConfig( config, Visibility.layer )
+            .assemble( module );
 
         // DataSource
-        new DataSourceAssembler().
-            withDataSourceServiceIdentity( "sqlite-datasource-service" ).
-            identifiedBy( "sqlite-datasource" ).
-            visibleIn( Visibility.module ).
-            withCircuitBreaker().
-            assemble( module );
+        new DataSourceAssembler()
+            .withDataSourceServiceIdentity( "sqlite-datasource-service" )
+            .identifiedBy( "sqlite-datasource" )
+            .visibleIn( Visibility.module )
+            .withCircuitBreaker()
+            .assemble( module );
 
         // SQL EntityStore
-        new SQLiteEntityStoreAssembler().
-            visibleIn( Visibility.application ).
-            withConfig( config, Visibility.layer ).
-            assemble( module );
+        new SQLiteEntityStoreAssembler()
+            .visibleIn( Visibility.application )
+            .withConfig( config, Visibility.layer )
+            .assemble( module );
     }
     // END SNIPPET: assembly
-
-    @Override
-    public void tearDown()
-        throws Exception
-    {
-        try
-        {
-            FileUtil.removeDirectory( new File( "target/polygene-data" ) );
-        }
-        finally
-        {
-            super.tearDown();
-        }
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-elasticsearch/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/build.gradle b/extensions/indexing-elasticsearch/build.gradle
index faa63b8..fac6eec 100644
--- a/extensions/indexing-elasticsearch/build.gradle
+++ b/extensions/indexing-elasticsearch/build.gradle
@@ -34,7 +34,6 @@ dependencies {
   runtimeOnly polygene.core.runtime
 
   testImplementation polygene.core.testsupport
-  testImplementation polygene.extension( 'valueserialization-jackson' )
 
   testRuntimeOnly libraries.logback
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchIndexer.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchIndexer.java b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchIndexer.java
index 80172cc..ad023bd 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchIndexer.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchIndexer.java
@@ -19,10 +19,13 @@
  */
 package org.apache.polygene.index.elasticsearch;
 
-import java.util.Collections;
+import java.io.StringReader;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.stream.Collectors;
+import javax.json.Json;
+import javax.json.JsonArrayBuilder;
+import javax.json.JsonObjectBuilder;
+import javax.json.JsonValue;
 import org.apache.polygene.api.entity.EntityDescriptor;
 import org.apache.polygene.api.entity.EntityReference;
 import org.apache.polygene.api.identity.Identity;
@@ -30,15 +33,12 @@ import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.api.injection.scope.Structure;
 import org.apache.polygene.api.injection.scope.This;
 import org.apache.polygene.api.mixin.Mixins;
-import org.apache.polygene.api.service.qualifier.Tagged;
+import org.apache.polygene.api.serialization.Serializer;
 import org.apache.polygene.api.structure.ModuleDescriptor;
 import org.apache.polygene.api.time.SystemTime;
-import org.apache.polygene.api.type.ValueType;
 import org.apache.polygene.api.usecase.UsecaseBuilder;
 import org.apache.polygene.api.util.Classes;
-import org.apache.polygene.api.value.ValueSerialization;
-import org.apache.polygene.api.value.ValueSerializer;
-import org.apache.polygene.api.value.ValueSerializer.Options;
+import org.apache.polygene.serialization.javaxjson.JavaxJson;
 import org.apache.polygene.spi.entity.EntityState;
 import org.apache.polygene.spi.entity.EntityStatus;
 import org.apache.polygene.spi.entity.ManyAssociationState;
@@ -46,11 +46,9 @@ import org.apache.polygene.spi.entity.NamedAssociationState;
 import org.apache.polygene.spi.entitystore.EntityStore;
 import org.apache.polygene.spi.entitystore.EntityStoreUnitOfWork;
 import org.apache.polygene.spi.entitystore.StateChangeListener;
+import org.apache.polygene.spi.serialization.JsonSerializer;
 import org.elasticsearch.action.bulk.BulkRequestBuilder;
 import org.elasticsearch.action.bulk.BulkResponse;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -60,14 +58,11 @@ import org.slf4j.LoggerFactory;
  * QUID Use two indices, one for strict queries, one for full text and fuzzy search?
  */
 @Mixins( ElasticSearchIndexer.Mixin.class )
-public interface ElasticSearchIndexer
-    extends StateChangeListener
+public interface ElasticSearchIndexer extends StateChangeListener
 {
-
     class Mixin
         implements StateChangeListener
     {
-
         private static final Logger LOGGER = LoggerFactory.getLogger( ElasticSearchIndexer.class );
 
         @Structure
@@ -77,8 +72,7 @@ public interface ElasticSearchIndexer
         private EntityStore entityStore;
 
         @Service
-        @Tagged( ValueSerialization.Formats.JSON )
-        private ValueSerializer valueSerializer;
+        private JsonSerializer jsonSerializer;
 
         @This
         private ElasticSearchSupport support;
@@ -102,9 +96,9 @@ public interface ElasticSearchIndexer
             }
 
             EntityStoreUnitOfWork uow = entityStore.newUnitOfWork(
-                    module,
-                    UsecaseBuilder.newUsecase( "Load associations for indexing" ),
-                    SystemTime.now()
+                module,
+                UsecaseBuilder.newUsecase( "Load associations for indexing" ),
+                SystemTime.now()
             );
 
             // Bulk index request builder
@@ -117,27 +111,27 @@ public interface ElasticSearchIndexer
                 {
                     switch( changedState.status() )
                     {
-                    case REMOVED:
-                        LOGGER.trace( "Removing Entity State from Index: {}", changedState );
-                        remove( bulkBuilder, changedState.entityReference().identity().toString() );
-                        break;
-                    case UPDATED:
-                        LOGGER.trace( "Updating Entity State in Index: {}", changedState );
-                        remove( bulkBuilder, changedState.entityReference().identity().toString() );
-                        String updatedJson = toJSON( changedState, newStates, uow );
-                        LOGGER.trace( "Will index: {}", updatedJson );
-                        index( bulkBuilder, changedState.entityReference().identity().toString(), updatedJson );
-                        break;
-                    case NEW:
-                        LOGGER.trace( "Creating Entity State in Index: {}", changedState );
-                        String newJson = toJSON( changedState, newStates, uow );
-                        LOGGER.trace( "Will index: {}", newJson );
-                        index( bulkBuilder, changedState.entityReference().identity().toString(), newJson );
-                        break;
-                    case LOADED:
-                    default:
-                        // Ignored
-                        break;
+                        case REMOVED:
+                            LOGGER.trace( "Removing Entity State from Index: {}", changedState );
+                            remove( bulkBuilder, changedState.entityReference().identity().toString() );
+                            break;
+                        case UPDATED:
+                            LOGGER.trace( "Updating Entity State in Index: {}", changedState );
+                            remove( bulkBuilder, changedState.entityReference().identity().toString() );
+                            String updatedJson = toJSON( changedState, newStates, uow );
+                            LOGGER.trace( "Will index: {}", updatedJson );
+                            index( bulkBuilder, changedState.entityReference().identity().toString(), updatedJson );
+                            break;
+                        case NEW:
+                            LOGGER.trace( "Creating Entity State in Index: {}", changedState );
+                            String newJson = toJSON( changedState, newStates, uow );
+                            LOGGER.trace( "Will index: {}", newJson );
+                            index( bulkBuilder, changedState.entityReference().identity().toString(), newJson );
+                            break;
+                        case LOADED:
+                        default:
+                            // Ignored
+                            break;
                     }
                 }
             }
@@ -173,7 +167,7 @@ public interface ElasticSearchIndexer
         {
             bulkBuilder.add( support.client().
                 prepareIndex( support.index(), support.entitiesType(), identity ).
-                setSource( json ) );
+                                        setSource( json ) );
         }
 
         /**
@@ -190,72 +184,40 @@ public interface ElasticSearchIndexer
          */
         private String toJSON( EntityState state, Map<String, EntityState> newStates, EntityStoreUnitOfWork uow )
         {
-            JSONObject json = new JSONObject();
+            JsonObjectBuilder builder = Json.createObjectBuilder();
 
-            try
-            {
-                json.put( "_identity", state.entityReference().identity().toString() );
-                json.put( "_types", state.entityDescriptor()
-                    .mixinTypes()
-                    .map( Classes.toClassName() )
-                    .collect( Collectors.toList() ) );
-            }
-            catch( JSONException e )
-            {
-                throw new ElasticSearchIndexException( "Could not index EntityState", e );
-            }
+            builder.add( "_identity", state.entityReference().identity().toString() );
+
+            JsonArrayBuilder typesBuilder = Json.createArrayBuilder();
+            state.entityDescriptor().mixinTypes().map( Classes.toClassName() ).forEach( typesBuilder::add );
+            builder.add( "_types", typesBuilder.build() );
 
             EntityDescriptor entityType = state.entityDescriptor();
 
             // Properties
-            entityType.state().properties().forEach( propDesc -> {
-                try
+            entityType.state().properties().forEach(
+                propDesc ->
                 {
                     if( propDesc.queryable() )
                     {
                         String key = propDesc.qualifiedName().name();
                         Object value = state.propertyValueOf( propDesc.qualifiedName() );
-                        if( value == null || ValueType.isPrimitiveValue( value ) )
-                        {
-                            json.put( key, value );
-                        }
-                        else
-                        {
-                            String serialized = valueSerializer.serialize( new Options().withoutTypeInfo(), value );
-                            // TODO Theses tests are pretty fragile, find a better way to fix this, Jackson API should behave better
-                            if( serialized.startsWith( "{" ) )
-                            {
-                                json.put( key, new JSONObject( serialized ) );
-                            }
-                            else if( serialized.startsWith( "[" ) )
-                            {
-                                json.put( key, new JSONArray( serialized ) );
-                            }
-                            else
-                            {
-                                json.put( key, serialized );
-                            }
-                        }
+                        JsonValue jsonValue = jsonSerializer.toJson( Serializer.Options.NO_TYPE_INFO, value );
+                        builder.add( key, jsonValue );
                     }
-                }
-                catch( JSONException e )
-                {
-                    throw new ElasticSearchIndexException( "Could not index EntityState", e );
-                }
-            } );
+                } );
 
             // Associations
-            entityType.state().associations().forEach( assocDesc -> {
-                try
+            entityType.state().associations().forEach(
+                assocDesc ->
                 {
                     if( assocDesc.queryable() )
                     {
                         String key = assocDesc.qualifiedName().name();
                         EntityReference associated = state.associationValueOf( assocDesc.qualifiedName() );
-                        Object value;
                         if( associated == null )
                         {
-                            value = null;
+                            builder.add( key, JsonValue.NULL );
                         }
                         else
                         {
@@ -263,114 +225,120 @@ public interface ElasticSearchIndexer
                             {
                                 if( newStates.containsKey( associated.identity().toString() ) )
                                 {
-                                    value = new JSONObject( toJSON( newStates.get( associated.identity().toString() ), newStates, uow ) );
+                                    builder.add( key,
+                                                 Json.createReader( new StringReader(
+                                                     toJSON( newStates.get( associated.identity().toString() ),
+                                                             newStates, uow )
+                                                 ) ).readObject() );
                                 }
                                 else
                                 {
                                     EntityReference reference = EntityReference.create( associated.identity() );
                                     EntityState assocState = uow.entityStateOf( module, reference );
-                                    value = new JSONObject( toJSON( assocState, newStates, uow ) );
+                                    builder.add( key,
+                                                 Json.createReader( new StringReader(
+                                                     toJSON( assocState, newStates, uow )
+                                                 ) ).readObject() );
                                 }
                             }
                             else
                             {
-                                value = new JSONObject( Collections.singletonMap( "reference", associated.identity().toString() ) );
+                                builder.add( key, Json.createObjectBuilder()
+                                                      .add( "reference", associated.identity().toString() ) );
                             }
                         }
-                        json.put( key, value );
                     }
-                }
-                catch( JSONException e )
-                {
-                    throw new ElasticSearchIndexException( "Could not index EntityState", e );
-                }
-            } );
+                } );
 
             // ManyAssociations
-            entityType.state().manyAssociations().forEach( manyAssocDesc -> {
-                try
+            entityType.state().manyAssociations().forEach(
+                manyAssocDesc ->
                 {
                     if( manyAssocDesc.queryable() )
                     {
                         String key = manyAssocDesc.qualifiedName().name();
-                        JSONArray array = new JSONArray();
-                        ManyAssociationState associateds = state.manyAssociationValueOf( manyAssocDesc.qualifiedName() );
-                        for( EntityReference associated : associateds )
+                        JsonArrayBuilder assBuilder = Json.createArrayBuilder();
+                        ManyAssociationState assocs = state.manyAssociationValueOf( manyAssocDesc.qualifiedName() );
+                        for( EntityReference associated : assocs )
                         {
                             if( manyAssocDesc.isAggregated() || support.indexNonAggregatedAssociations() )
                             {
                                 if( newStates.containsKey( associated.identity().toString() ) )
                                 {
-                                    array.put( new JSONObject( toJSON( newStates.get( associated.identity().toString() ), newStates, uow ) ) );
+                                    assBuilder.add(
+                                        Json.createReader( new StringReader(
+                                            toJSON( newStates.get( associated.identity().toString() ), newStates, uow )
+                                        ) ).readObject() );
                                 }
                                 else
                                 {
                                     EntityReference reference = EntityReference.create( associated.identity() );
                                     EntityState assocState = uow.entityStateOf( module, reference );
-                                    array.put( new JSONObject( toJSON( assocState, newStates, uow ) ) );
+                                    assBuilder.add(
+                                        Json.createReader( new StringReader(
+                                            toJSON( assocState, newStates, uow )
+                                        ) ).readObject() );
                                 }
                             }
                             else
                             {
-                                array.put( new JSONObject( Collections.singletonMap( "reference", associated.identity().toString() ) ) );
+                                assBuilder.add( Json.createObjectBuilder().add( "reference",
+                                                                                associated.identity().toString() ) );
                             }
                         }
-                        json.put( key, array );
+                        builder.add( key, assBuilder.build() );
                     }
-                }
-                catch( JSONException e )
-                {
-                    throw new ElasticSearchIndexException( "Could not index EntityState", e );
-                }
-            } );
+                } );
 
             // NamedAssociations
-            entityType.state().namedAssociations().forEach( namedAssocDesc -> {
-                try
+            entityType.state().namedAssociations().forEach(
+                namedAssocDesc ->
                 {
                     if( namedAssocDesc.queryable() )
                     {
                         String key = namedAssocDesc.qualifiedName().name();
-                        JSONArray array = new JSONArray();
-                        NamedAssociationState associateds = state.namedAssociationValueOf( namedAssocDesc.qualifiedName() );
-                        for( String name : associateds )
+                        JsonArrayBuilder assBuilder = Json.createArrayBuilder();
+                        NamedAssociationState assocs = state.namedAssociationValueOf(
+                            namedAssocDesc.qualifiedName() );
+                        for( String name : assocs )
                         {
-                            Identity identity = associateds.get(name).identity();
+                            Identity identity = assocs.get( name ).identity();
                             if( namedAssocDesc.isAggregated() || support.indexNonAggregatedAssociations() )
                             {
                                 String identityString = identity.toString();
                                 if( newStates.containsKey( identityString ) )
                                 {
-                                    JSONObject obj = new JSONObject( toJSON( newStates.get( identityString ), newStates, uow ) );
-                                    obj.put( "_named", name );
-                                    array.put( obj );
+                                    assBuilder.add(
+                                        JavaxJson.toBuilder(
+                                            Json.createReader( new StringReader(
+                                                toJSON( newStates.get( identityString ), newStates, uow ) )
+                                            ).readObject()
+                                        ).add( "_named", name ).build() );
                                 }
                                 else
                                 {
                                     EntityReference reference = EntityReference.create( identity );
                                     EntityState assocState = uow.entityStateOf( module, reference );
-                                    JSONObject obj = new JSONObject( toJSON( assocState, newStates, uow ) );
-                                    obj.put( "_named", name );
-                                    array.put( obj );
+                                    assBuilder.add(
+                                        JavaxJson.toBuilder(
+                                            Json.createReader( new StringReader(
+                                                toJSON( assocState, newStates, uow )
+                                            ) ).readObject()
+                                        ).add( "_named", name ).build() );
                                 }
                             }
                             else
                             {
-                                JSONObject obj = new JSONObject();
-                                obj.put( "_named", name );
-                                obj.put( "reference", identity.toString() );
-                                array.put( obj );
+                                assBuilder.add( Json.createObjectBuilder()
+                                                    .add( "_named", name )
+                                                    .add( "reference", identity.toString() )
+                                                    .build() );
                             }
                         }
-                        json.put( key, array );
+                        builder.add( key, assBuilder.build() );
                     }
-                }
-                catch( JSONException e )
-                {
-                    throw new ElasticSearchIndexException( "Could not index EntityState", e );
-                }
-            } );
-            return json.toString();
+                } );
+            return builder.build().toString();
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESClientIndexQueryAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESClientIndexQueryAssembler.java b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESClientIndexQueryAssembler.java
index 10b1762..c6a0bdc 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESClientIndexQueryAssembler.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESClientIndexQueryAssembler.java
@@ -17,13 +17,11 @@
  */
 package org.apache.polygene.index.elasticsearch.assembly;
 
-import org.apache.polygene.api.value.ValueSerialization;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.index.elasticsearch.ElasticSearchConfiguration;
 import org.apache.polygene.index.elasticsearch.client.ESClientIndexQueryService;
 import org.apache.polygene.index.elasticsearch.internal.AbstractElasticSearchAssembler;
-import org.apache.polygene.valueserialization.orgjson.OrgJsonValueSerializationService;
 import org.elasticsearch.client.Client;
 
 public class ESClientIndexQueryAssembler
@@ -46,9 +44,6 @@ public class ESClientIndexQueryAssembler
               .visibleIn( visibility() )
               .instantiateOnStartup();
 
-        module.services( OrgJsonValueSerializationService.class )
-              .taggedWith( ValueSerialization.Formats.JSON );
-
         if( hasConfig() )
         {
             configModule().entities( ElasticSearchConfiguration.class )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESClusterIndexQueryAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESClusterIndexQueryAssembler.java b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESClusterIndexQueryAssembler.java
index 269a877..f2d803d 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESClusterIndexQueryAssembler.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESClusterIndexQueryAssembler.java
@@ -19,13 +19,11 @@
  */
 package org.apache.polygene.index.elasticsearch.assembly;
 
-import org.apache.polygene.api.value.ValueSerialization;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.index.elasticsearch.ElasticSearchClusterConfiguration;
 import org.apache.polygene.index.elasticsearch.cluster.ESClusterIndexQueryService;
 import org.apache.polygene.index.elasticsearch.internal.AbstractElasticSearchAssembler;
-import org.apache.polygene.valueserialization.orgjson.OrgJsonValueSerializationService;
 
 public class ESClusterIndexQueryAssembler
     extends AbstractElasticSearchAssembler<ESClusterIndexQueryAssembler>
@@ -40,9 +38,6 @@ public class ESClusterIndexQueryAssembler
               .visibleIn( visibility() )
               .instantiateOnStartup();
 
-        module.services( OrgJsonValueSerializationService.class ).
-            taggedWith( ValueSerialization.Formats.JSON );
-
         if( hasConfig() )
         {
             configModule().entities( ElasticSearchClusterConfiguration.class ).

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESFilesystemIndexQueryAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESFilesystemIndexQueryAssembler.java b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESFilesystemIndexQueryAssembler.java
index 015e2b0..1998fd8 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESFilesystemIndexQueryAssembler.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/assembly/ESFilesystemIndexQueryAssembler.java
@@ -19,13 +19,11 @@
  */
 package org.apache.polygene.index.elasticsearch.assembly;
 
-import org.apache.polygene.api.value.ValueSerialization;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.index.elasticsearch.ElasticSearchConfiguration;
 import org.apache.polygene.index.elasticsearch.filesystem.ESFilesystemIndexQueryService;
 import org.apache.polygene.index.elasticsearch.internal.AbstractElasticSearchAssembler;
-import org.apache.polygene.valueserialization.orgjson.OrgJsonValueSerializationService;
 
 public class ESFilesystemIndexQueryAssembler
     extends AbstractElasticSearchAssembler<ESFilesystemIndexQueryAssembler>

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-elasticsearch/src/test/java/org/apache/polygene/index/elasticsearch/ElasticSearchQueryTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/test/java/org/apache/polygene/index/elasticsearch/ElasticSearchQueryTest.java b/extensions/indexing-elasticsearch/src/test/java/org/apache/polygene/index/elasticsearch/ElasticSearchQueryTest.java
index ecd35fb..6b6feab 100644
--- a/extensions/indexing-elasticsearch/src/test/java/org/apache/polygene/index/elasticsearch/ElasticSearchQueryTest.java
+++ b/extensions/indexing-elasticsearch/src/test/java/org/apache/polygene/index/elasticsearch/ElasticSearchQueryTest.java
@@ -30,7 +30,6 @@ import org.apache.polygene.library.fileconfig.FileConfigurationOverride;
 import org.apache.polygene.test.EntityTestAssembler;
 import org.apache.polygene.test.indexing.AbstractQueryTest;
 import org.apache.polygene.test.util.NotYetImplemented;
-import org.apache.polygene.valueserialization.jackson.assembly.JacksonValueSerializationAssembler;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -79,9 +78,6 @@ public class ElasticSearchQueryTest extends AbstractQueryTest
                                                         testName.getMethodName() ) );
         esConfig.indexNonAggregatedAssociations().set( Boolean.TRUE );
 
-        // Serialization
-        new JacksonValueSerializationAssembler().assemble( module );
-
         // FileConfig
         new FileConfigurationAssembler()
             .withOverride( new FileConfigurationOverride().withConventionalRoot( tmpDir.getRoot() ) )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/build.gradle b/extensions/indexing-rdf/build.gradle
index ad465a4..73ebf31 100644
--- a/extensions/indexing-rdf/build.gradle
+++ b/extensions/indexing-rdf/build.gradle
@@ -33,7 +33,6 @@ dependencies {
   runtimeOnly polygene.core.runtime
 
   testImplementation polygene.core.testsupport
-  testImplementation polygene.extension( 'valueserialization-jackson' )
   testImplementation polygene.extension( 'entitystore-preferences' )
   testImplementation polygene.extension( 'entitystore-jdbm' )
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/main/java/org/apache/polygene/index/rdf/query/RdfQueryParserFactory.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/main/java/org/apache/polygene/index/rdf/query/RdfQueryParserFactory.java b/extensions/indexing-rdf/src/main/java/org/apache/polygene/index/rdf/query/RdfQueryParserFactory.java
index fa2c6ae..b317c48 100644
--- a/extensions/indexing-rdf/src/main/java/org/apache/polygene/index/rdf/query/RdfQueryParserFactory.java
+++ b/extensions/indexing-rdf/src/main/java/org/apache/polygene/index/rdf/query/RdfQueryParserFactory.java
@@ -20,17 +20,15 @@
 
 package org.apache.polygene.index.rdf.query;
 
-import org.openrdf.query.QueryLanguage;
 import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.api.injection.scope.Structure;
 import org.apache.polygene.api.mixin.Mixins;
 import org.apache.polygene.api.service.ServiceComposite;
-import org.apache.polygene.api.service.qualifier.Tagged;
-import org.apache.polygene.api.value.ValueSerialization;
-import org.apache.polygene.api.value.ValueSerializer;
 import org.apache.polygene.index.rdf.UnsupportedLanguageException;
 import org.apache.polygene.index.rdf.query.internal.RdfQueryParserImpl;
 import org.apache.polygene.spi.PolygeneSPI;
+import org.apache.polygene.spi.serialization.JsonSerializer;
+import org.openrdf.query.QueryLanguage;
 
 @Mixins( RdfQueryParserFactory.RdfQueryParserFactoryMixin.class )
 public interface RdfQueryParserFactory
@@ -45,15 +43,14 @@ public interface RdfQueryParserFactory
         private PolygeneSPI spi;
 
         @Service
-        @Tagged( ValueSerialization.Formats.JSON )
-        private ValueSerializer valueSerializer;
+        private JsonSerializer stateSerializer;
 
         @Override
         public RdfQueryParser newQueryParser( QueryLanguage language )
         {
             if( language.equals( QueryLanguage.SPARQL ) )
             {
-                return new RdfQueryParserImpl( spi, valueSerializer );
+                return new RdfQueryParserImpl( spi, stateSerializer );
             }
             throw new UnsupportedLanguageException( language );
         }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/main/java/org/apache/polygene/index/rdf/query/internal/RdfQueryParserImpl.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/main/java/org/apache/polygene/index/rdf/query/internal/RdfQueryParserImpl.java b/extensions/indexing-rdf/src/main/java/org/apache/polygene/index/rdf/query/internal/RdfQueryParserImpl.java
index d176dd3..c0bec0d 100644
--- a/extensions/indexing-rdf/src/main/java/org/apache/polygene/index/rdf/query/internal/RdfQueryParserImpl.java
+++ b/extensions/indexing-rdf/src/main/java/org/apache/polygene/index/rdf/query/internal/RdfQueryParserImpl.java
@@ -47,15 +47,14 @@ import org.apache.polygene.api.query.grammar.NePredicate;
 import org.apache.polygene.api.query.grammar.Notpredicate;
 import org.apache.polygene.api.query.grammar.OrPredicate;
 import org.apache.polygene.api.query.grammar.OrderBy;
-import org.apache.polygene.api.query.grammar.PropertyFunction;
 import org.apache.polygene.api.query.grammar.PropertyNotNullPredicate;
 import org.apache.polygene.api.query.grammar.PropertyNullPredicate;
 import org.apache.polygene.api.query.grammar.QuerySpecification;
 import org.apache.polygene.api.query.grammar.Variable;
-import org.apache.polygene.api.value.ValueSerializer;
-import org.apache.polygene.api.value.ValueSerializer.Options;
+import org.apache.polygene.api.serialization.Serializer;
 import org.apache.polygene.index.rdf.query.RdfQueryParser;
 import org.apache.polygene.spi.PolygeneSPI;
+import org.apache.polygene.spi.serialization.JsonSerializer;
 import org.slf4j.LoggerFactory;
 
 import static java.lang.String.format;
@@ -72,7 +71,7 @@ public class RdfQueryParserImpl
     private final Namespaces namespaces = new Namespaces();
     private final Triples triples = new Triples( namespaces );
     private final PolygeneSPI spi;
-    private final ValueSerializer valueSerializer;
+    private final JsonSerializer stateSerializer;
     private Map<String, Object> variables;
 
     static
@@ -90,10 +89,10 @@ public class RdfQueryParserImpl
         ) );
     }
 
-    public RdfQueryParserImpl( PolygeneSPI spi, ValueSerializer valueSerializer )
+    public RdfQueryParserImpl( PolygeneSPI spi, JsonSerializer stateSerializer )
     {
         this.spi = spi;
-        this.valueSerializer = valueSerializer;
+        this.stateSerializer = stateSerializer;
     }
 
     @Override
@@ -328,7 +327,8 @@ public class RdfQueryParserImpl
 
     private String createAndEscapeJSONString( Object value )
     {
-        return escapeJSONString( valueSerializer.serialize( new Options().withoutTypeInfo(), value ) );
+        String serialized = stateSerializer.serialize( Serializer.Options.NO_TYPE_INFO, value );
+        return escapeJSONString( serialized );
     }
 
     private String createRegexStringForContaining( String valueVariable, String containedString )
@@ -376,7 +376,7 @@ public class RdfQueryParserImpl
             String jsonStr = "";
             if( item != null )
             {
-                String serialized = valueSerializer.serialize( new Options().withoutTypeInfo(), item );
+                String serialized = stateSerializer.serialize( Serializer.Options.NO_TYPE_INFO, item );
                 if( item instanceof String )
                 {
                     serialized = "\"" + StringEscapeUtils.escapeJava( serialized ) + "\"";
@@ -424,7 +424,7 @@ public class RdfQueryParserImpl
         if( predicate instanceof ComparisonPredicate )
         {
             ComparisonPredicate<?> comparisonPredicate = (ComparisonPredicate<?>) predicate;
-            Triples.Triple triple = triples.addTriple( (PropertyFunction) comparisonPredicate.property(), false );
+            Triples.Triple triple = triples.addTriple( comparisonPredicate.property(), false );
 
             // Don't use FILTER for equals-comparison. Do direct match instead
             if( predicate instanceof EqPredicate && allowInline )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/ContainsAllTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/ContainsAllTest.java b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/ContainsAllTest.java
index 0db4bd0..3d7fb36 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/ContainsAllTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/ContainsAllTest.java
@@ -131,12 +131,12 @@ public class ContainsAllTest
 
     private static void populateStrings( ExampleEntity proto, String... strings )
     {
-        proto.strings().set( new HashSet<String>( Arrays.asList( strings ) ) );
+        proto.strings().set( setOf( strings ) );
     }
 
     private static void populateComplexValue( ExampleEntity proto, ValueBuilderFactory vbf, String... valueStrings )
     {
-        Set<ExampleValue> values = new HashSet<ExampleValue>();
+        Set<ExampleValue> values = new HashSet<>();
         for( String value : valueStrings )
         {
             ValueBuilder<ExampleValue2> vBuilder = vbf.newValueBuilder( ExampleValue2.class );
@@ -154,16 +154,9 @@ public class ContainsAllTest
     public void simpleContainsAllQuerySuccessTest()
         throws Exception
     {
-
         ExampleEntity result = this.performContainsAllStringsTest(
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2, TEST_STRING_3
-            )
-            ),
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2
-            )
-            )
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 ),
+            setOf( TEST_STRING_1, TEST_STRING_2 )
         );
 
         Assert.assertTrue( "The entity must have been found.", result != null );
@@ -174,14 +167,8 @@ public class ContainsAllTest
         throws Exception
     {
         ExampleEntity result = this.performContainsAllStringsTest(
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2, TEST_STRING_3
-            )
-            ),
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2, TEST_STRING_3
-            )
-            )
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 ),
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 )
         );
 
         Assert.assertTrue( "The entity must have been found.", result != null );
@@ -192,14 +179,8 @@ public class ContainsAllTest
         throws Exception
     {
         ExampleEntity result = this.performContainsAllStringsTest(
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2, TEST_STRING_3
-            )
-            ),
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2, TEST_STRING_3, TEST_STRING_4
-            )
-            )
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 ),
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3, TEST_STRING_4 )
         );
 
         Assert.assertTrue( "The entity must not have been found.", result == null );
@@ -210,14 +191,8 @@ public class ContainsAllTest
         throws Exception
     {
         ExampleEntity result = this.performContainsAllStringsTest(
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2, TEST_STRING_3
-            )
-            ),
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, null, TEST_STRING_2
-            )
-            )
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 ),
+            setOf( TEST_STRING_1, null, TEST_STRING_2 )
         );
 
         Assert.assertTrue( "The entity must have been found.", result != null );
@@ -228,11 +203,8 @@ public class ContainsAllTest
         throws Exception
     {
         ExampleEntity result = this.performContainsAllStringsTest(
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2
-            )
-            ),
-            new HashSet<String>()
+            setOf( TEST_STRING_1, TEST_STRING_2 ),
+            setOf()
         );
 
         Assert.assertTrue( "The entity must have been found.", result != null );
@@ -243,14 +215,8 @@ public class ContainsAllTest
         throws Exception
     {
         ExampleEntity result = this.performContainsAllStringValueTest(
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2
-            )
-            ),
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1
-            )
-            )
+            setOf( TEST_STRING_1, TEST_STRING_2 ),
+            setOf( TEST_STRING_1 )
         );
 
         Assert.assertTrue( "The entity must have been found.", result != null );
@@ -261,14 +227,8 @@ public class ContainsAllTest
         throws Exception
     {
         ExampleEntity result = this.performContainsAllStringValueTest(
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2
-            )
-            ),
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2
-            )
-            )
+            setOf( TEST_STRING_1, TEST_STRING_2 ),
+            setOf( TEST_STRING_1, TEST_STRING_2 )
         );
 
         Assert.assertTrue( "The entity must have been found", result != null );
@@ -279,14 +239,8 @@ public class ContainsAllTest
         throws Exception
     {
         ExampleEntity result = this.performContainsAllStringValueTest(
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2
-            )
-            ),
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2, TEST_STRING_3
-            )
-            )
+            setOf( TEST_STRING_1, TEST_STRING_2 ),
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 )
         );
 
         Assert.assertTrue( "The entity must not have been found.", result == null );
@@ -297,11 +251,8 @@ public class ContainsAllTest
         throws Exception
     {
         ExampleEntity result = this.performContainsAllStringValueTest(
-            new HashSet<String>( Arrays.asList(
-                TEST_STRING_1, TEST_STRING_2
-            )
-            ),
-            new HashSet<String>()
+            setOf( TEST_STRING_1, TEST_STRING_2 ),
+            setOf()
         );
 
         Assert.assertTrue( "The entity must have been found.", result != null );
@@ -312,8 +263,8 @@ public class ContainsAllTest
         QueryBuilder<ExampleEntity> builder = this.queryBuilderFactory.newQueryBuilder( ExampleEntity.class );
 
         builder = builder.where( QueryExpressions.containsAll(
-                QueryExpressions.templateFor( ExampleEntity.class ).strings(),
-                Arrays.asList( strings ) ) );
+            QueryExpressions.templateFor( ExampleEntity.class ).strings(),
+            Arrays.asList( strings ) ) );
         return this.unitOfWorkFactory.currentUnitOfWork().newQuery( builder ).find();
     }
 
@@ -337,9 +288,9 @@ public class ContainsAllTest
     {
         QueryBuilder<ExampleEntity> builder = this.queryBuilderFactory.newQueryBuilder( ExampleEntity.class );
         builder = builder.where( QueryExpressions.containsAll(
-                QueryExpressions.templateFor( ExampleEntity.class ).complexValue(),
-                valuez
-        )
+            QueryExpressions.templateFor( ExampleEntity.class ).complexValue(),
+            valuez
+                                 )
         );
 
         return this.unitOfWorkFactory.currentUnitOfWork().newQuery( builder );
@@ -349,14 +300,14 @@ public class ContainsAllTest
         throws Exception
     {
         UnitOfWork creatingUOW = this.unitOfWorkFactory.newUnitOfWork();
-        String[] entityStringsArray = new String[entityStrings.size()];
+        String[] entityStringsArray = new String[ entityStrings.size() ];
         createEntityWithStrings( creatingUOW, this.valueBuilderFactory, entityStrings.toArray( entityStringsArray ) );
         creatingUOW.complete();
 
         UnitOfWork queryingUOW = this.unitOfWorkFactory.newUnitOfWork();
         try
         {
-            String[] queryableStringsArray = new String[queryableStrings.size()];
+            String[] queryableStringsArray = new String[ queryableStrings.size() ];
             ExampleEntity entity = this.findEntity( queryableStrings.toArray( queryableStringsArray ) );
             return entity;
         }
@@ -370,15 +321,17 @@ public class ContainsAllTest
         throws Exception
     {
         UnitOfWork creatingUOW = this.unitOfWorkFactory.newUnitOfWork();
-        String[] entityStringsArray = new String[entityStrings.size()];
-        createEntityWithComplexValues( creatingUOW, this.valueBuilderFactory, entityStrings.toArray( entityStringsArray ) );
+        String[] entityStringsArray = new String[ entityStrings.size() ];
+        createEntityWithComplexValues( creatingUOW, this.valueBuilderFactory,
+                                       entityStrings.toArray( entityStringsArray ) );
         creatingUOW.complete();
 
         UnitOfWork queryingUOW = this.unitOfWorkFactory.newUnitOfWork();
         try
         {
-            String[] queryableStringsArray = new String[queryableStrings.size()];
-            ExampleEntity entity = this.findEntityBasedOnValueStrings( queryableStrings.toArray( queryableStringsArray ) );
+            String[] queryableStringsArray = new String[ queryableStrings.size() ];
+            ExampleEntity entity = this.findEntityBasedOnValueStrings(
+                queryableStrings.toArray( queryableStringsArray ) );
             return entity;
         }
         finally
@@ -386,4 +339,9 @@ public class ContainsAllTest
             queryingUOW.discard();
         }
     }
+
+    static <T> Set<T> setOf( T... elements )
+    {
+        return new HashSet<T>( Arrays.asList( elements ) );
+    }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/ContainsTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/ContainsTest.java b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/ContainsTest.java
index f96bc90..0cde1a7 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/ContainsTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/ContainsTest.java
@@ -20,8 +20,6 @@
 package org.apache.polygene.index.rdf;
 
 import java.io.File;
-import java.util.Arrays;
-import java.util.HashSet;
 import java.util.Set;
 import org.apache.polygene.api.common.Visibility;
 import org.apache.polygene.api.query.Query;
@@ -45,6 +43,12 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
+import static org.apache.polygene.index.rdf.ContainsAllTest.TEST_STRING_1;
+import static org.apache.polygene.index.rdf.ContainsAllTest.TEST_STRING_2;
+import static org.apache.polygene.index.rdf.ContainsAllTest.TEST_STRING_3;
+import static org.apache.polygene.index.rdf.ContainsAllTest.TEST_STRING_4;
+import static org.apache.polygene.index.rdf.ContainsAllTest.setOf;
+
 public class ContainsTest extends AbstractPolygeneTest
 {
     @Rule
@@ -76,10 +80,8 @@ public class ContainsTest extends AbstractPolygeneTest
     public void simpleContainsSuccessTest() throws Exception
     {
         ExampleEntity result = this.performContainsStringTest(
-            new HashSet<>( Arrays.asList(
-                ContainsAllTest.TEST_STRING_1, ContainsAllTest.TEST_STRING_2, ContainsAllTest.TEST_STRING_3
-            ) ),
-            ContainsAllTest.TEST_STRING_3
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 ),
+            TEST_STRING_3
         );
 
         Assert.assertTrue( "The entity must have been found", result != null );
@@ -89,10 +91,8 @@ public class ContainsTest extends AbstractPolygeneTest
     public void simpleContainsSuccessFailTest() throws Exception
     {
         ExampleEntity result = this.performContainsStringTest(
-            new HashSet<>( Arrays.asList(
-                ContainsAllTest.TEST_STRING_1, ContainsAllTest.TEST_STRING_2, ContainsAllTest.TEST_STRING_3
-            ) ),
-            ContainsAllTest.TEST_STRING_4
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 ),
+            TEST_STRING_4
         );
 
         Assert.assertTrue( "The entity must not have been found", result == null );
@@ -102,9 +102,7 @@ public class ContainsTest extends AbstractPolygeneTest
     public void simplecontainsNullTest() throws Exception
     {
         this.performContainsStringTest(
-            new HashSet<>( Arrays.asList(
-                ContainsAllTest.TEST_STRING_1, ContainsAllTest.TEST_STRING_2, ContainsAllTest.TEST_STRING_3
-            ) ),
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 ),
             null
         );
     }
@@ -113,10 +111,8 @@ public class ContainsTest extends AbstractPolygeneTest
     public void simpleContainsStringValueSuccessTest() throws Exception
     {
         ExampleEntity result = this.performContainsStringValueTest(
-            new HashSet<>( Arrays.asList(
-                ContainsAllTest.TEST_STRING_1, ContainsAllTest.TEST_STRING_2, ContainsAllTest.TEST_STRING_3
-            ) ),
-            ContainsAllTest.TEST_STRING_3
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 ),
+            TEST_STRING_3
         );
 
         Assert.assertTrue( "The entity must have been found", result != null );
@@ -126,10 +122,8 @@ public class ContainsTest extends AbstractPolygeneTest
     public void simpleContainsStringValueFailTest() throws Exception
     {
         ExampleEntity result = this.performContainsStringTest(
-            new HashSet<>( Arrays.asList(
-                ContainsAllTest.TEST_STRING_1, ContainsAllTest.TEST_STRING_2, ContainsAllTest.TEST_STRING_3
-            ) ),
-            ContainsAllTest.TEST_STRING_4
+            setOf( TEST_STRING_1, TEST_STRING_2, TEST_STRING_3 ),
+            TEST_STRING_4
         );
 
         Assert.assertTrue( "The entity must not have been found", result == null );
@@ -139,11 +133,8 @@ public class ContainsTest extends AbstractPolygeneTest
     {
         QueryBuilder<ExampleEntity> builder = this.queryBuilderFactory.newQueryBuilder( ExampleEntity.class );
 
-        builder = builder.where( QueryExpressions.contains(
-            QueryExpressions.templateFor( ExampleEntity.class ).strings(),
-            string
-                                 )
-        );
+        builder = builder.where(
+            QueryExpressions.contains( QueryExpressions.templateFor( ExampleEntity.class ).strings(), string ) );
         return this.unitOfWorkFactory.currentUnitOfWork().newQuery( builder ).find();
     }
 
@@ -161,11 +152,8 @@ public class ContainsTest extends AbstractPolygeneTest
     private Query<ExampleEntity> createComplexQuery( ExampleValue value )
     {
         QueryBuilder<ExampleEntity> builder = this.queryBuilderFactory.newQueryBuilder( ExampleEntity.class );
-        builder = builder.where( QueryExpressions.contains(
-            QueryExpressions.templateFor( ExampleEntity.class ).complexValue(),
-            value
-                                 )
-        );
+        builder = builder.where(
+            QueryExpressions.contains( QueryExpressions.templateFor( ExampleEntity.class ).complexValue(), value ) );
 
         return this.unitOfWorkFactory.currentUnitOfWork().newQuery( builder );
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfComplexQueryTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfComplexQueryTest.java b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfComplexQueryTest.java
index 6102e8b..31c2d3c 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfComplexQueryTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfComplexQueryTest.java
@@ -19,15 +19,13 @@
  */
 package org.apache.polygene.index.rdf;
 
-import org.junit.Ignore;
-import org.apache.polygene.api.value.ValueSerialization;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.library.rdf.entity.EntityStateSerializer;
 import org.apache.polygene.library.rdf.entity.EntityTypeSerializer;
 import org.apache.polygene.library.rdf.repository.MemoryRepositoryService;
 import org.apache.polygene.test.indexing.AbstractComplexQueryTest;
-import org.apache.polygene.valueserialization.orgjson.OrgJsonValueSerializationService;
+import org.junit.Ignore;
 
 @Ignore( "RDF Index/Query do not support Complex Queries, ie. queries by 'example values'" )
 public class RdfComplexQueryTest
@@ -40,7 +38,6 @@ public class RdfComplexQueryTest
     {
         super.assemble( module );
         module.services( RdfIndexingEngineService.class ).instantiateOnStartup();
-        module.services( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
         module.objects( EntityStateSerializer.class, EntityTypeSerializer.class );
         module.services( MemoryRepositoryService.class ).identifiedBy( "rdf-indexing" ).instantiateOnStartup();
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfEntityFinderTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfEntityFinderTest.java b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfEntityFinderTest.java
index 626d184..86723ce 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfEntityFinderTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfEntityFinderTest.java
@@ -19,14 +19,12 @@
  */
 package org.apache.polygene.index.rdf;
 
-import org.apache.polygene.api.value.ValueSerialization;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.library.rdf.entity.EntityStateSerializer;
 import org.apache.polygene.library.rdf.entity.EntityTypeSerializer;
 import org.apache.polygene.library.rdf.repository.MemoryRepositoryService;
 import org.apache.polygene.test.indexing.AbstractEntityFinderTest;
-import org.apache.polygene.valueserialization.orgjson.OrgJsonValueSerializationService;
 
 public class RdfEntityFinderTest extends AbstractEntityFinderTest
 {
@@ -37,7 +35,6 @@ public class RdfEntityFinderTest extends AbstractEntityFinderTest
         super.assemble( module );
         module.objects( EntityStateSerializer.class, EntityTypeSerializer.class );
         module.services( RdfIndexingEngineService.class ).instantiateOnStartup();
-        module.services( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
         module.services( MemoryRepositoryService.class ).identifiedBy( "rdf-indexing" ).instantiateOnStartup();
         // module.services( NativeRdfRepositoryService.class ).identifiedBy( "rdf-indexing" );
         // module.addComposites( NativeRdfConfiguration.class );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfNamedQueryMultimoduleTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfNamedQueryMultimoduleTest.java b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfNamedQueryMultimoduleTest.java
index 21f5d46..23c8f13 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfNamedQueryMultimoduleTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfNamedQueryMultimoduleTest.java
@@ -27,7 +27,6 @@ import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.bootstrap.unitofwork.DefaultUnitOfWorkAssembler;
 import org.apache.polygene.index.rdf.assembly.RdfMemoryStoreAssembler;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.apache.polygene.valueserialization.jackson.assembly.JacksonValueSerializationAssembler;
 
 public class RdfNamedQueryMultimoduleTest
     extends RdfNamedQueryTest
@@ -48,7 +47,6 @@ public class RdfNamedQueryMultimoduleTest
         ModuleAssembly indexModule = layer.module( "index" );
         new DefaultUnitOfWorkAssembler().assemble( indexModule );
         new RdfMemoryStoreAssembler( Visibility.layer, Visibility.module ).assemble( indexModule );
-        new JacksonValueSerializationAssembler().assemble( indexModule );
     }
 
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfNamedQueryTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfNamedQueryTest.java b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfNamedQueryTest.java
index 6ebbee8..e327387 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfNamedQueryTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfNamedQueryTest.java
@@ -27,8 +27,6 @@ import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.index.rdf.assembly.RdfMemoryStoreAssembler;
 import org.apache.polygene.index.rdf.query.SesameExpressions;
 import org.apache.polygene.test.indexing.AbstractNamedQueryTest;
-import org.apache.polygene.valueserialization.jackson.assembly.JacksonValueSerializationAssembler;
-import org.slf4j.LoggerFactory;
 
 public class RdfNamedQueryTest extends AbstractNamedQueryTest
 {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfQueryMultimoduleTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfQueryMultimoduleTest.java b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfQueryMultimoduleTest.java
index d9d0cf1..0ed4774 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfQueryMultimoduleTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RdfQueryMultimoduleTest.java
@@ -28,7 +28,6 @@ import org.apache.polygene.bootstrap.unitofwork.DefaultUnitOfWorkAssembler;
 import org.apache.polygene.index.rdf.assembly.RdfNativeSesameStoreAssembler;
 import org.apache.polygene.library.rdf.repository.NativeConfiguration;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.apache.polygene.valueserialization.jackson.assembly.JacksonValueSerializationAssembler;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
@@ -54,7 +53,6 @@ public class RdfQueryMultimoduleTest
         ModuleAssembly indexModule = layer.module( "index" );
         new RdfNativeSesameStoreAssembler( Visibility.layer, Visibility.module ).assemble( indexModule );
         new DefaultUnitOfWorkAssembler().assemble( indexModule );
-        new JacksonValueSerializationAssembler().assemble( indexModule );
 
         LayerAssembly configLayer = module.layer().application().layer( "config" );
         module.layer().uses( configLayer );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/qi66/Qi66IssueTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/qi66/Qi66IssueTest.java b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/qi66/Qi66IssueTest.java
index 372e9d8..d5a385c 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/qi66/Qi66IssueTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/qi66/Qi66IssueTest.java
@@ -19,12 +19,10 @@
  */
 package org.apache.polygene.index.rdf.qi66;
 
-import org.apache.polygene.api.identity.Identity;
-import org.junit.Test;
 import org.apache.polygene.api.entity.EntityBuilder;
+import org.apache.polygene.api.identity.Identity;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
 import org.apache.polygene.api.unitofwork.UnitOfWorkCompletionException;
-import org.apache.polygene.api.value.ValueSerialization;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.index.rdf.query.RdfQueryParserFactory;
@@ -34,7 +32,7 @@ import org.apache.polygene.library.rdf.entity.EntityTypeSerializer;
 import org.apache.polygene.library.rdf.repository.MemoryRepositoryService;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
-import org.apache.polygene.valueserialization.orgjson.OrgJsonValueSerializationService;
+import org.junit.Test;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
@@ -97,7 +95,6 @@ public class Qi66IssueTest
         module.services( RdfQueryService.class,
                          RdfQueryParserFactory.class,
                          MemoryRepositoryService.class );
-        module.services( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
         module.objects( EntityStateSerializer.class, EntityTypeSerializer.class );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/qi95/Qi95IssueTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/qi95/Qi95IssueTest.java b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/qi95/Qi95IssueTest.java
index 9dd94b7..2694153 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/qi95/Qi95IssueTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/qi95/Qi95IssueTest.java
@@ -23,10 +23,6 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import org.apache.polygene.bootstrap.unitofwork.DefaultUnitOfWorkAssembler;
-import org.apache.polygene.valueserialization.jackson.assembly.JacksonValueSerializationAssembler;
-import org.junit.Rule;
-import org.junit.Test;
 import org.apache.polygene.api.common.Visibility;
 import org.apache.polygene.api.entity.EntityBuilder;
 import org.apache.polygene.api.entity.EntityComposite;
@@ -37,13 +33,22 @@ import org.apache.polygene.api.structure.Application;
 import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
 import org.apache.polygene.api.unitofwork.UnitOfWorkFactory;
-import org.apache.polygene.bootstrap.*;
+import org.apache.polygene.bootstrap.ApplicationAssembler;
+import org.apache.polygene.bootstrap.ApplicationAssembly;
+import org.apache.polygene.bootstrap.ApplicationAssemblyFactory;
+import org.apache.polygene.bootstrap.Assembler;
+import org.apache.polygene.bootstrap.AssemblyException;
+import org.apache.polygene.bootstrap.Energy4Java;
+import org.apache.polygene.bootstrap.LayerAssembly;
+import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.entitystore.jdbm.JdbmConfiguration;
 import org.apache.polygene.entitystore.jdbm.assembly.JdbmEntityStoreAssembler;
 import org.apache.polygene.index.rdf.assembly.RdfMemoryStoreAssembler;
 import org.apache.polygene.index.rdf.assembly.RdfNativeSesameStoreAssembler;
 import org.apache.polygene.library.rdf.repository.NativeConfiguration;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Rule;
+import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
 import static org.junit.Assert.assertTrue;
@@ -221,7 +226,6 @@ public class Qi95IssueTest
         public ModuleAssembly buildModuleAssembly( LayerAssembly layer, String name )
             throws AssemblyException
         {
-            addModule( layer, name, new JacksonValueSerializationAssembler() );
             return addModule( layer, name, new RdfNativeSesameStoreAssembler() );
         }
     };
@@ -242,7 +246,6 @@ public class Qi95IssueTest
         public ModuleAssembly buildModuleAssembly( LayerAssembly layer, String name )
             throws AssemblyException
         {
-            addModule( layer, name, new JacksonValueSerializationAssembler() );
             return addModule( layer, name, new RdfMemoryStoreAssembler() );
         }
     };
@@ -282,7 +285,6 @@ public class Qi95IssueTest
                     throws AssemblyException
                 {
                     module.entities( ItemTypeEntity.class );
-                    new DefaultUnitOfWorkAssembler().assemble( module );
                 }
             } );
             return domainLayer;
@@ -298,7 +300,6 @@ public class Qi95IssueTest
                 throws AssemblyException
             {
                 new EntityTestAssembler().assemble( module );
-                new DefaultUnitOfWorkAssembler().assemble( module );
 
                 module.entities( NativeConfiguration.class ).visibleIn( Visibility.application );
                 module.forMixin( NativeConfiguration.class )
@@ -324,9 +325,7 @@ public class Qi95IssueTest
             public void assemble( ModuleAssembly module )
                 throws AssemblyException
             {
-                new JacksonValueSerializationAssembler().assemble( module );
                 new JdbmEntityStoreAssembler().visibleIn( Visibility.application ).assemble( module );
-                new DefaultUnitOfWorkAssembler().assemble( module );
             }
         };
     }
@@ -336,7 +335,6 @@ public class Qi95IssueTest
     {
         ModuleAssembly moduleAssembly = layerAssembly.module( name );
         assembler.assemble( moduleAssembly );
-        new DefaultUnitOfWorkAssembler().assemble( moduleAssembly );
         return moduleAssembly;
     }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-solr/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/indexing-solr/build.gradle b/extensions/indexing-solr/build.gradle
index 20ad610..df06bc6 100644
--- a/extensions/indexing-solr/build.gradle
+++ b/extensions/indexing-solr/build.gradle
@@ -34,7 +34,6 @@ dependencies {
   runtimeOnly polygene.core.runtime
 
   testImplementation polygene.core.testsupport
-  testImplementation polygene.extension( 'valueserialization-jackson' )
 
   testRuntimeOnly libraries.logback
   testRuntimeOnly libraries.servlet_api

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-solr/src/main/java/org/apache/polygene/index/solr/assembly/SolrIndexingAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-solr/src/main/java/org/apache/polygene/index/solr/assembly/SolrIndexingAssembler.java b/extensions/indexing-solr/src/main/java/org/apache/polygene/index/solr/assembly/SolrIndexingAssembler.java
index fa6b59c..4932cdc 100644
--- a/extensions/indexing-solr/src/main/java/org/apache/polygene/index/solr/assembly/SolrIndexingAssembler.java
+++ b/extensions/indexing-solr/src/main/java/org/apache/polygene/index/solr/assembly/SolrIndexingAssembler.java
@@ -20,28 +20,23 @@
 
 package org.apache.polygene.index.solr.assembly;
 
-import org.apache.polygene.api.value.ValueSerialization;
 import org.apache.polygene.bootstrap.Assemblers;
-import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
-import org.apache.polygene.bootstrap.ServiceDeclaration;
 import org.apache.polygene.index.solr.EmbeddedSolrService;
 import org.apache.polygene.index.solr.SolrQueryService;
 import org.apache.polygene.library.rdf.entity.EntityStateSerializer;
-import org.apache.polygene.valueserialization.orgjson.OrgJsonValueSerializationService;
 
 public class SolrIndexingAssembler extends Assemblers.VisibilityIdentityConfig<SolrIndexingAssembler>
 {
     @Override
-   public void assemble( ModuleAssembly module ) throws AssemblyException
-   {
-      module.services( EmbeddedSolrService.class ).identifiedBy( "solr" ).instantiateOnStartup();
-      ServiceDeclaration queryService = module.services( SolrQueryService.class );
-      queryService.
-            taggedWith( "solr", "search", "indexing", "query" ).
-            identifiedBy( identity() ).
-            visibleIn( visibility() ).
-            instantiateOnStartup();
-      module.objects( EntityStateSerializer.class );
-   }
+    public void assemble( ModuleAssembly module )
+    {
+        module.services( EmbeddedSolrService.class ).identifiedBy( "solr" ).instantiateOnStartup();
+        module.services( SolrQueryService.class )
+              .taggedWith( "solr", "search", "indexing", "query" )
+              .identifiedBy( identity() )
+              .visibleIn( visibility() )
+              .instantiateOnStartup();
+        module.objects( EntityStateSerializer.class );
+    }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-solr/src/main/java/org/apache/polygene/index/solr/internal/SolrEntityIndexerMixin.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-solr/src/main/java/org/apache/polygene/index/solr/internal/SolrEntityIndexerMixin.java b/extensions/indexing-solr/src/main/java/org/apache/polygene/index/solr/internal/SolrEntityIndexerMixin.java
index 1301718..14335d0 100644
--- a/extensions/indexing-solr/src/main/java/org/apache/polygene/index/solr/internal/SolrEntityIndexerMixin.java
+++ b/extensions/indexing-solr/src/main/java/org/apache/polygene/index/solr/internal/SolrEntityIndexerMixin.java
@@ -21,15 +21,19 @@
 package org.apache.polygene.index.solr.internal;
 
 import java.io.IOException;
+import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import org.apache.solr.client.solrj.SolrServer;
-import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.common.SolrInputDocument;
-import org.apache.solr.core.SolrCore;
-import org.apache.solr.schema.SchemaField;
+import javax.json.Json;
+import javax.json.JsonArray;
+import javax.json.JsonNumber;
+import javax.json.JsonObject;
+import javax.json.JsonReader;
+import javax.json.JsonString;
+import javax.json.JsonValue;
+import javax.json.stream.JsonParser;
 import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.api.injection.scope.Uses;
 import org.apache.polygene.index.solr.EmbeddedSolrService;
@@ -37,9 +41,11 @@ import org.apache.polygene.index.solr.SolrQueryService;
 import org.apache.polygene.library.rdf.entity.EntityStateSerializer;
 import org.apache.polygene.spi.entity.EntityState;
 import org.apache.polygene.spi.entity.EntityStatus;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.core.SolrCore;
+import org.apache.solr.schema.SchemaField;
 import org.openrdf.model.BNode;
 import org.openrdf.model.Graph;
 import org.openrdf.model.Literal;
@@ -151,7 +157,7 @@ public abstract class SolrEntityIndexerMixin
     }
 
     private SolrInputDocument indexEntityState( final EntityState entityState )
-        throws IOException, SolrServerException, JSONException
+        throws IOException, SolrServerException
     {
         Graph graph = new GraphImpl();
         stateSerializer.serialize( entityState, false, graph );
@@ -171,15 +177,24 @@ public abstract class SolrEntityIndexerMixin
                     String value = statement.getObject().stringValue();
                     if( field.getType().getTypeName().equals( "json" ) )
                     {
-                        if( value.charAt( 0 ) == '[' )
-                        {
-                            JSONArray array = new JSONArray( value );
-                            indexJson( input, array );
-                        }
-                        else if( value.charAt( 0 ) == '{' )
+                        try( JsonParser parser = Json.createParser( new StringReader( value ) ) )
                         {
-                            JSONObject object = new JSONObject( value );
-                            indexJson( input, object );
+                            JsonParser.Event event = parser.next();
+                            switch( event )
+                            {
+                                case START_ARRAY:
+                                    try( JsonReader reader = Json.createReader( new StringReader( value ) ) )
+                                    {
+                                        indexJson( input, reader.readArray() );
+                                    }
+                                    break;
+                                case START_OBJECT:
+                                    try( JsonReader reader = Json.createReader( new StringReader( value ) ) )
+                                    {
+                                        indexJson( input, reader.readObject() );
+                                    }
+                                    break;
+                            }
                         }
                     }
                     else
@@ -215,34 +230,54 @@ public abstract class SolrEntityIndexerMixin
     }
 
     private void indexJson( SolrInputDocument input, Object object )
-        throws JSONException
     {
-        if( object instanceof JSONArray )
+        if( object instanceof JsonArray )
         {
-            JSONArray array = (JSONArray) object;
-            for( int i = 0; i < array.length(); i++ )
+            JsonArray array = (JsonArray) object;
+            for( int i = 0; i < array.size(); i++ )
             {
                 indexJson( input, array.get( i ) );
             }
         }
         else
         {
-            JSONObject jsonObject = (JSONObject) object;
-            Iterator keys = jsonObject.keys();
-            while( keys.hasNext() )
+            JsonObject jsonObject = (JsonObject) object;
+            for( String name : jsonObject.keySet() )
             {
-                Object name = keys.next();
-                Object value = jsonObject.get( name.toString() );
-                if( value instanceof JSONObject || value instanceof JSONArray )
+                JsonValue jsonValue = jsonObject.get( name );
+                if( jsonValue.getValueType() == JsonValue.ValueType.OBJECT
+                    || jsonValue.getValueType() == JsonValue.ValueType.ARRAY )
                 {
-                    indexJson( input, value );
+                    indexJson( input, jsonValue );
                 }
                 else
                 {
-                    SchemaField field = indexedFields.get( name.toString() );
+                    SchemaField field = indexedFields.get( name );
                     if( field != null )
                     {
-                        input.addField( name.toString(), jsonObject.get( name.toString() ) );
+                        Object value;
+                        switch( jsonValue.getValueType() )
+                        {
+                            case NULL:
+                                value = null;
+                                break;
+                            case STRING:
+                                value = ( (JsonString) jsonValue ).getString();
+                                break;
+                            case NUMBER:
+                                JsonNumber jsonNumber = (JsonNumber) jsonValue;
+                                value = jsonNumber.isIntegral() ? jsonNumber.longValue() : jsonNumber.doubleValue();
+                                break;
+                            case TRUE:
+                                value = Boolean.TRUE;
+                                break;
+                            case FALSE:
+                                value = Boolean.FALSE;
+                                break;
+                            default:
+                                value = jsonValue.toString();
+                        }
+                        input.addField( name, value );
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-sql/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/build.gradle b/extensions/indexing-sql/build.gradle
index 0c8a21e..e0e50e8 100644
--- a/extensions/indexing-sql/build.gradle
+++ b/extensions/indexing-sql/build.gradle
@@ -38,7 +38,6 @@ dependencies {
 
   testImplementation polygene.internals.testsupport
   testImplementation polygene.library( 'sql-dbcp' )
-  testImplementation polygene.extension( 'valueserialization-jackson' )
 
   testRuntimeOnly libraries.logback
   testRuntimeOnly libraries.derby

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7c2814ee/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java b/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
index 6648590..ed1bc47 100644
--- a/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
+++ b/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
@@ -83,6 +83,7 @@ class SQLCompatEntityStateWrapper
                    || Enum.class.isAssignableFrom( primaryType )
                    || String.class.isAssignableFrom( primaryType )
                    || Identity.class.isAssignableFrom( primaryType )
+                   // TODO javax.time support in indexing-sql
                    // || Date.class.isAssignableFrom( primaryType )
                    // || DateTime.class.isAssignableFrom( primaryType )
                    // || LocalDateTime.class.isAssignableFrom( primaryType )


Mime
View raw message