polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [05/10] zest-sandbox git commit: Cleanup Zest Sandbox - Use Qi4j 2.0
Date Mon, 20 Apr 2015 08:08:10 GMT
Cleanup Zest Sandbox - Use Qi4j 2.0


Project: http://git-wip-us.apache.org/repos/asf/zest-sandbox/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-sandbox/commit/562f2ca3
Tree: http://git-wip-us.apache.org/repos/asf/zest-sandbox/tree/562f2ca3
Diff: http://git-wip-us.apache.org/repos/asf/zest-sandbox/diff/562f2ca3

Branch: refs/heads/develop
Commit: 562f2ca3beeeb5907c4e74e714f1f28566849d95
Parents: af38f70
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sun Apr 19 18:47:21 2015 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sun Apr 19 18:47:21 2015 +0200

----------------------------------------------------------------------
 .../cassandra/CassandraEntityStoreService.java  |  6 +--
 .../cassandra/CassandraMapEntityStoreMixin.java | 21 ++++----
 .../cassandra/CassandraEntityStoreTest.java     |  5 +-
 .../jgroups/JGroupsEntityStoreMixin.java        | 26 ++++-----
 .../jgroups/JGroupsEntityStoreService.java      |  7 ++-
 .../jgroups/JGroupsEntityStoreTest.java         | 42 ++++++++-------
 .../qi4j/entitystore/jndi/JndiEntityState.java  | 23 +++-----
 .../entitystore/jndi/JndiEntityStoreMixin.java  | 20 +++----
 .../jndi/JndiEntityStoreService.java            |  4 +-
 .../java/org/qi4j/entitystore/jndi/JndiUow.java | 36 ++++++-------
 .../jndi/JndiReadEntityStoreTest.java           | 11 ++--
 .../rmi/ClientRmiEntityStoreMixin.java          | 14 ++---
 .../rmi/ClientRmiEntityStoreService.java        |  5 +-
 .../org/qi4j/entitystore/rmi/RegistryMixin.java | 12 ++---
 .../qi4j/entitystore/rmi/RegistryService.java   |  5 +-
 .../rmi/ServerRemoteEntityStoreMixin.java       | 10 ++--
 .../rmi/ServerRmiEntityStoreService.java        |  5 +-
 .../entitystore/s3/S3EntityStoreService.java    |  5 +-
 .../s3/S3SerializationStoreMixin.java           | 18 +++----
 .../qi4j/entitystore/s3/S3EntityStoreTest.java  |  6 +--
 .../org/qi4j/entitystore/swift/DataStore.java   |  8 +--
 .../qi4j/entitystore/swift/RecordManager.java   |  2 +-
 .../swift/SwiftEntityStoreAssembler.java        |  6 +--
 .../swift/SwiftEntityStoreMixin.java            | 24 ++++-----
 .../swift/SwiftEntityStoreService.java          |  7 ++-
 .../entitystore/swift/SwiftEntityStoreTest.java | 14 ++---
 libraries/beans/pom.xml                         |  4 ++
 .../beans/support/DelegatingIterator.java       |  6 +--
 .../beans/support/DelegatingListIterator.java   |  6 +--
 .../beans/support/JavabeanAssociation.java      | 30 +++++------
 .../beans/support/JavabeanManyAssociation.java  | 33 +++++-------
 .../library/beans/support/JavabeanMixin.java    | 57 +++++++++++---------
 .../library/beans/support/JavabeanProperty.java | 22 ++++----
 .../org/qi4j/library/beans/support/Wrapper.java |  4 +-
 .../beans/properties/PropertiesMixinTest.java   |  5 +-
 .../beans/support/JavabeanBackedTest.java       |  9 ++--
 .../qi4j/library/entityproxy/EntityProxy.java   |  6 +--
 .../library/entityproxy/EntityProxyHelper.java  |  6 +--
 .../library/entityproxy/ProxyableEntity.java    |  2 +-
 .../entityproxy/internal/EntityProxyCache.java  | 10 ++--
 .../internal/EntityProxyCacheService.java       |  2 +-
 .../library/entityproxy/EntityProxyTest.java    | 23 ++++----
 .../org/qi4j/library/entityproxy/SomeRole.java  |  4 +-
 .../qi4j/library/executor/ExecuteService.java   |  8 ++-
 .../qi4j/library/executor/ExecutorMixin.java    |  9 ++--
 .../library/executor/ExecutorSideEffect.java    |  6 +--
 .../executor/ExecuteSideEffectTest.java         |  8 +--
 .../server/ApacheDirectoryServiceMixin.java     | 13 +++--
 .../qi4j/library/ldap/server/LdapService.java   |  4 +-
 .../library/ldap/server/LdapServerTest.java     |  4 +-
 .../java/org/qi4j/library/rmi/RMIMixinTest.java |  4 +-
 .../library/thread/NewThreadServiceMixin.java   |  6 +--
 .../thread/PooledThreadServiceComposite.java    |  4 +-
 .../thread/PooledThreadServiceMixin.java        | 19 ++++---
 .../library/thread/ThreadGroupServiceMixin.java |  2 +-
 .../assembly/NewThreadServiceAssembler.java     |  8 +--
 .../assembly/PooledThreadServiceAssembler.java  |  8 +--
 .../library/thread/NewThreadServiceTest.java    | 10 ++--
 .../library/thread/PooledThreadServiceTest.java | 11 ++--
 pom.xml                                         |  2 +-
 60 files changed, 343 insertions(+), 354 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-cassandra/src/main/java/org/qi4j/entitystore/cassandra/CassandraEntityStoreService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/qi4j/entitystore/cassandra/CassandraEntityStoreService.java b/extensions/entitystore-cassandra/src/main/java/org/qi4j/entitystore/cassandra/CassandraEntityStoreService.java
index 3e55e16..b183d75 100644
--- a/extensions/entitystore-cassandra/src/main/java/org/qi4j/entitystore/cassandra/CassandraEntityStoreService.java
+++ b/extensions/entitystore-cassandra/src/main/java/org/qi4j/entitystore/cassandra/CassandraEntityStoreService.java
@@ -16,17 +16,17 @@ package org.qi4j.entitystore.cassandra;
 
 import org.qi4j.api.concern.Concerns;
 import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.ServiceComposite;
-import org.qi4j.entitystore.map.MapEntityStoreMixin;
+import org.qi4j.api.service.ServiceActivation;
 import org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern;
 import org.qi4j.spi.entitystore.EntityStateVersions;
 import org.qi4j.spi.entitystore.EntityStore;
 import org.qi4j.spi.entitystore.StateChangeNotificationConcern;
+import org.qi4j.spi.entitystore.helpers.MapEntityStoreMixin;
 
 @Concerns({StateChangeNotificationConcern.class,
         ConcurrentModificationCheckConcern.class})
 @Mixins({MapEntityStoreMixin.class, CassandraMapEntityStoreMixin.class})
 public interface CassandraEntityStoreService extends EntityStateVersions,
-        EntityStore, ServiceComposite {
+        EntityStore, ServiceActivation {
 
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-cassandra/src/main/java/org/qi4j/entitystore/cassandra/CassandraMapEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/qi4j/entitystore/cassandra/CassandraMapEntityStoreMixin.java b/extensions/entitystore-cassandra/src/main/java/org/qi4j/entitystore/cassandra/CassandraMapEntityStoreMixin.java
index 80e0511..eb6a214 100644
--- a/extensions/entitystore-cassandra/src/main/java/org/qi4j/entitystore/cassandra/CassandraMapEntityStoreMixin.java
+++ b/extensions/entitystore-cassandra/src/main/java/org/qi4j/entitystore/cassandra/CassandraMapEntityStoreMixin.java
@@ -11,10 +11,10 @@ import me.prettyprint.hector.api.query.ColumnQuery;
 import me.prettyprint.hector.api.query.QueryResult;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.injection.scope.Service;
-import org.qi4j.api.io.Input;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.entitystore.map.MapEntityStore;
-import org.qi4j.spi.entity.EntityType;
+import org.qi4j.api.entity.EntityDescriptor;
+import org.qi4j.api.service.ServiceActivation;
+import org.qi4j.io.Input;
+import org.qi4j.spi.entitystore.helpers.MapEntityStore;
 import org.qi4j.spi.entitystore.EntityAlreadyExistsException;
 import org.qi4j.spi.entitystore.EntityNotFoundException;
 import org.qi4j.spi.entitystore.EntityStoreException;
@@ -41,7 +41,7 @@ import static me.prettyprint.hector.api.factory.HFactory.*;
  * @author pvdyck
  * @since 4.0
  */
-public class CassandraMapEntityStoreMixin implements MapEntityStore, Activatable {
+public class CassandraMapEntityStoreMixin implements MapEntityStore, ServiceActivation {
    private static final String COLUMN_NAME = "entry";
    private final Logger logger = LoggerFactory.getLogger(CassandraMapEntityStoreMixin.class);
 
@@ -62,14 +62,14 @@ public class CassandraMapEntityStoreMixin implements MapEntityStore, Activatable
    private
    CassandraConfiguration conf;
 
-   public void activate() throws Exception {
+   public void activateService() throws Exception {
       c = HFactory.getOrCreateCluster("Qi4jCluster", conf.getHost() + ":" + conf.getPort());
       ko = HFactory.createKeyspace(keySpace, c);
       logger.info("started cassandra store");
    }
 
 
-   public void passivate() throws Exception {
+   public void passivateService() throws Exception {
       logger.info("shutting down cassandra");
    }
 
@@ -166,19 +166,18 @@ public class CassandraMapEntityStoreMixin implements MapEntityStore, Activatable
    class MapUpdater implements MapEntityStore.MapChanger {
       me.prettyprint.hector.api.mutation.Mutator m = createMutator(ko);
 
-
-      public Writer newEntity(final EntityReference ref, EntityType entityType) {
+      public Writer newEntity(final EntityReference ref, EntityDescriptor entityDescriptor) {
          checkAbsentBeforeCreate(ref);
          return getWriter(ref);
       }
 
-      public Writer updateEntity(final EntityReference ref, EntityType entityType)
+      public Writer updateEntity(final EntityReference ref, EntityDescriptor entityDescriptor)
             throws IOException {
          checkPresentBeforeUpdate(ref);
          return getWriter(ref);
       }
 
-      public void removeEntity(EntityReference ref, EntityType entityType)
+      public void removeEntity(EntityReference ref, EntityDescriptor entityDescriptor)
             throws EntityNotFoundException {
          checkPresentBeforeDelete(ref);
          m.addDeletion(ref.identity(), cf, COLUMN_NAME, se);

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-cassandra/src/test/java/org/qi4j/entitystore/cassandra/CassandraEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/test/java/org/qi4j/entitystore/cassandra/CassandraEntityStoreTest.java b/extensions/entitystore-cassandra/src/test/java/org/qi4j/entitystore/cassandra/CassandraEntityStoreTest.java
index 9baaaf6..d018404 100644
--- a/extensions/entitystore-cassandra/src/test/java/org/qi4j/entitystore/cassandra/CassandraEntityStoreTest.java
+++ b/extensions/entitystore-cassandra/src/test/java/org/qi4j/entitystore/cassandra/CassandraEntityStoreTest.java
@@ -6,9 +6,11 @@ import org.apache.thrift.transport.TTransportException;
 import org.junit.BeforeClass;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.core.testsupport.AbstractEntityStoreTest;
+import org.qi4j.test.entity.AbstractEntityStoreTest;
 
 import java.io.IOException;
+import org.qi4j.api.value.ValueSerialization;
+import org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationService;
 
 
 //need to launch a cassandra instance b4 running this test...
@@ -23,6 +25,7 @@ public class CassandraEntityStoreTest extends AbstractEntityStoreTest {
       super.assemble(module);
       module.addServices(CassandraEntityStoreService.class,
                          CassandraConfigurationService.class);
+      module.services( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
    }
 
    @BeforeClass

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-jgroups/src/main/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jgroups/src/main/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreMixin.java b/extensions/entitystore-jgroups/src/main/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreMixin.java
index 9c721c6..6997f0d 100644
--- a/extensions/entitystore-jgroups/src/main/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreMixin.java
+++ b/extensions/entitystore-jgroups/src/main/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreMixin.java
@@ -20,28 +20,28 @@ package org.qi4j.entitystore.jgroups;
 import org.jgroups.JChannel;
 import org.jgroups.blocks.ReplicatedHashMap;
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.api.io.Input;
-import org.qi4j.api.io.Output;
-import org.qi4j.api.io.Receiver;
-import org.qi4j.api.io.Sender;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.entitystore.map.MapEntityStore;
-import org.qi4j.spi.entity.EntityType;
+import org.qi4j.io.Input;
+import org.qi4j.io.Output;
+import org.qi4j.io.Receiver;
+import org.qi4j.io.Sender;
 import org.qi4j.spi.entitystore.EntityNotFoundException;
 import org.qi4j.spi.entitystore.EntityStoreException;
 
 import java.io.*;
+import org.qi4j.api.entity.EntityDescriptor;
+import org.qi4j.api.service.ServiceActivation;
+import org.qi4j.spi.entitystore.helpers.MapEntityStore;
 
 /**
  * JGroups implementation of EntityStore
  */
 public class JGroupsEntityStoreMixin
-        implements Activatable, MapEntityStore
+        implements ServiceActivation, MapEntityStore
 {
     private JChannel channel;
     private ReplicatedHashMap<String, String> replicatedMap;
 
-    public void activate() throws Exception
+    public void activateService() throws Exception
     {
         channel = new JChannel();
         channel.connect( "entitystore" );
@@ -49,7 +49,7 @@ public class JGroupsEntityStoreMixin
         replicatedMap.setBlockingUpdates( true );
     }
 
-    public void passivate() throws Exception
+    public void passivateService() throws Exception
     {
         channel.close();
     }
@@ -102,7 +102,7 @@ public class JGroupsEntityStoreMixin
         {
             changes.visitMap( new MapChanger()
             {
-                public Writer newEntity( final EntityReference ref, EntityType entityType ) throws IOException
+                public Writer newEntity( final EntityReference ref, EntityDescriptor entityDescriptor ) throws IOException
                 {
                     return new StringWriter( 1000 )
                     {
@@ -117,7 +117,7 @@ public class JGroupsEntityStoreMixin
                     };
                 }
 
-                public Writer updateEntity( final EntityReference ref, EntityType entityType ) throws IOException
+                public Writer updateEntity( final EntityReference ref, EntityDescriptor entityDescriptor ) throws IOException
                 {
                     return new StringWriter( 1000 )
                     {
@@ -132,7 +132,7 @@ public class JGroupsEntityStoreMixin
                     };
                 }
 
-                public void removeEntity( EntityReference ref, EntityType entityType ) throws EntityNotFoundException
+                public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor ) throws EntityNotFoundException
                 {
                     replicatedMap.remove( ref.identity() );
                 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-jgroups/src/main/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jgroups/src/main/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreService.java b/extensions/entitystore-jgroups/src/main/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreService.java
index 018f97f..bf82584 100644
--- a/extensions/entitystore-jgroups/src/main/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreService.java
+++ b/extensions/entitystore-jgroups/src/main/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreService.java
@@ -19,13 +19,12 @@ package org.qi4j.entitystore.jgroups;
 
 import org.qi4j.api.concern.Concerns;
 import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.api.service.ServiceComposite;
-import org.qi4j.entitystore.map.MapEntityStoreMixin;
+import org.qi4j.api.service.ServiceActivation;
 import org.qi4j.library.locking.LockingAbstractComposite;
 import org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern;
 import org.qi4j.spi.entitystore.EntityStore;
 import org.qi4j.spi.entitystore.StateChangeNotificationConcern;
+import org.qi4j.spi.entitystore.helpers.MapEntityStoreMixin;
 
 /**
  * EntityStore service backed by JGroups store.
@@ -34,7 +33,7 @@ import org.qi4j.spi.entitystore.StateChangeNotificationConcern;
 @Concerns({ StateChangeNotificationConcern.class, ConcurrentModificationCheckConcern.class})
 @Mixins({ MapEntityStoreMixin.class, JGroupsEntityStoreMixin.class})
 public interface JGroupsEntityStoreService
-    extends EntityStore, ServiceComposite, Activatable, LockingAbstractComposite
+    extends EntityStore, ServiceActivation, LockingAbstractComposite
 
 {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-jgroups/src/test/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jgroups/src/test/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreTest.java b/extensions/entitystore-jgroups/src/test/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreTest.java
index 92e4777..d4f3423 100644
--- a/extensions/entitystore-jgroups/src/test/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreTest.java
+++ b/extensions/entitystore-jgroups/src/test/java/org/qi4j/entitystore/jgroups/JGroupsEntityStoreTest.java
@@ -21,13 +21,14 @@ package org.qi4j.entitystore.jgroups;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
+
 import org.junit.Test;
 import org.junit.Ignore;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.entity.EntityBuilder;
 import org.qi4j.api.entity.EntityComposite;
-import org.qi4j.api.entity.association.Association;
-import org.qi4j.api.entity.association.ManyAssociation;
+import org.qi4j.api.association.Association;
+import org.qi4j.api.association.ManyAssociation;
 import org.qi4j.api.property.Immutable;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.unitofwork.NoSuchEntityException;
@@ -35,11 +36,13 @@ import org.qi4j.api.unitofwork.UnitOfWork;
 import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
 import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueComposite;
+import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.bootstrap.SingletonAssembler;
 import org.qi4j.spi.uuid.UuidIdentityGeneratorService;
 import org.qi4j.test.AbstractQi4jTest;
+import org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationService;
 
 /**
  * Test of JGroups EntityStore backend.
@@ -49,10 +52,11 @@ public class JGroupsEntityStoreTest
 {
     public void assemble( ModuleAssembly module ) throws AssemblyException
     {
-        module.addServices( UuidIdentityGeneratorService.class );
-        module.addEntities( TestEntity.class );
-        module.addValues( TestValue.class );
-        module.addServices( JGroupsEntityStoreService.class );
+        module.services( UuidIdentityGeneratorService.class );
+        module.services( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
+        module.entities( TestEntity.class );
+        module.values( TestValue.class );
+        module.services( JGroupsEntityStoreService.class );
     }
 
     @Test
@@ -65,8 +69,9 @@ public class JGroupsEntityStoreTest
         {
             public void assemble( ModuleAssembly module ) throws AssemblyException
             {
-                module.addServices( JGroupsEntityStoreService.class, UuidIdentityGeneratorService.class ).instantiateOnStartup();
-                module.addEntities( TestEntity.class );
+                module.services( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
+                module.services( JGroupsEntityStoreService.class, UuidIdentityGeneratorService.class ).instantiateOnStartup();
+                module.entities( TestEntity.class );
             }
         };
 
@@ -75,14 +80,15 @@ public class JGroupsEntityStoreTest
         {
             public void assemble( ModuleAssembly module ) throws AssemblyException
             {
-                module.addServices( JGroupsEntityStoreService.class, UuidIdentityGeneratorService.class ).instantiateOnStartup();
-                module.addEntities( TestEntity.class );
+                module.services( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
+                module.services( JGroupsEntityStoreService.class, UuidIdentityGeneratorService.class ).instantiateOnStartup();
+                module.entities( TestEntity.class );
             }
         };
 
         // Create entity in app 1
         System.out.println( "Create entity" );
-        UnitOfWork app1Unit = app1.unitOfWorkFactory().newUnitOfWork();
+        UnitOfWork app1Unit = app1.module().newUnitOfWork();
         EntityBuilder<TestEntity> builder = app1Unit.newEntityBuilder( TestEntity.class );
         TestEntity instance = builder.instance();
         instance.name().set( "Foo" );
@@ -93,7 +99,7 @@ public class JGroupsEntityStoreTest
 
         // Find entity in app 2
         System.out.println( "Find entity" );
-        UnitOfWork app2Unit = app2.unitOfWorkFactory().newUnitOfWork();
+        UnitOfWork app2Unit = app2.module().newUnitOfWork();
         instance = app2Unit.get( instance );
 
         System.out.println( instance.name() );
@@ -108,14 +114,14 @@ public class JGroupsEntityStoreTest
     {
         try
         {
-            UnitOfWork unitOfWork = unitOfWorkFactory.newUnitOfWork();
+            UnitOfWork unitOfWork = module.newUnitOfWork();
             try
             {
                 TestEntity instance = createEntity( unitOfWork );
                 unitOfWork.complete();
 
                 // Find entity
-                unitOfWork = unitOfWorkFactory.newUnitOfWork();
+                unitOfWork = module.newUnitOfWork();
                 instance = unitOfWork.get( instance );
 
                 // Check state
@@ -153,7 +159,7 @@ public class JGroupsEntityStoreTest
     public void whenRemovedEntityThenCannotFindEntity()
         throws Exception
     {
-        UnitOfWork unitOfWork = unitOfWorkFactory.newUnitOfWork();
+        UnitOfWork unitOfWork = module.newUnitOfWork();
         try
         {
             TestEntity newInstance = createEntity( unitOfWork );
@@ -161,13 +167,13 @@ public class JGroupsEntityStoreTest
             unitOfWork.complete();
 
             // Remove entity
-            unitOfWork = unitOfWorkFactory.newUnitOfWork();
+            unitOfWork = module.newUnitOfWork();
             TestEntity instance = unitOfWork.get( newInstance );
             unitOfWork.remove( instance );
             unitOfWork.complete();
 
             // Find entity
-            unitOfWork = unitOfWorkFactory.newUnitOfWork();
+            unitOfWork = module.newUnitOfWork();
             try
             {
                 instance = unitOfWork.get( TestEntity.class, identity );
@@ -207,7 +213,7 @@ public class JGroupsEntityStoreTest
         instance.name().set( "Test" );
         instance.association().set( instance );
 
-        ValueBuilder<TestValue> valueBuilder = valueBuilderFactory.newValueBuilder( TestValue.class );
+        ValueBuilder<TestValue> valueBuilder = module.newValueBuilder( TestValue.class );
         TestValue state = valueBuilder.prototype();
         state.someValue().set( "Foo" );
         state.otherValue().set( 5 );

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityState.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityState.java b/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityState.java
index 34f6181..036995e 100644
--- a/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityState.java
+++ b/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityState.java
@@ -18,17 +18,15 @@
 
 package org.qi4j.entitystore.jndi;
 
+import org.qi4j.api.entity.EntityDescriptor;
 import org.qi4j.spi.entity.EntityState;
 import org.qi4j.spi.entity.EntityStatus;
-import org.qi4j.spi.entity.EntityDescriptor;
-import org.qi4j.spi.entity.ManyAssociationState;
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.api.common.TypeName;
+import org.qi4j.spi.entity.ManyAssociationState;
 import org.qi4j.api.common.QualifiedName;
 import java.util.Map;
 import java.util.List;
 import java.util.HashMap;
-import org.qi4j.spi.entity.NamedAssociationState;
 
 public class JndiEntityState
     implements EntityState
@@ -102,7 +100,7 @@ public class JndiEntityState
         return status;
     }
 
-    public boolean isOfType( TypeName type )
+    public boolean isAssignableTo( Class<?> type )
     {
         return false;
     }
@@ -112,32 +110,27 @@ public class JndiEntityState
         return entityDescriptor;
     }
 
-    public Object getProperty( QualifiedName stateName )
+    public Object propertyValueOf( QualifiedName stateName )
     {
         return properties.get( stateName );
     }
 
-    public void setProperty( QualifiedName stateName, Object json )
+    public void setPropertyValue( QualifiedName stateName, Object json )
     {
         properties.put( stateName, json );
     }
 
-    public EntityReference getAssociation( QualifiedName stateName )
+    public EntityReference associationValueOf( QualifiedName stateName )
     {
         return associations.get( stateName );
     }
 
-    public void setAssociation( QualifiedName stateName, EntityReference newEntity )
+    public void setAssociationValue( QualifiedName stateName, EntityReference newEntity )
     {
         associations.put( stateName, newEntity );
     }
 
-    public ManyAssociationState getManyAssociation( QualifiedName stateName )
-    {
-        return null;
-    }
-
-    public NamedAssociationState getNamedAssociation( QualifiedName qn )
+    public ManyAssociationState manyAssociationValueOf( QualifiedName stateName )
     {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityStoreMixin.java b/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityStoreMixin.java
index e0b1fa9..c20738a 100644
--- a/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityStoreMixin.java
+++ b/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityStoreMixin.java
@@ -19,29 +19,29 @@ package org.qi4j.entitystore.jndi;
 
 import org.qi4j.api.configuration.Configuration;
 import org.qi4j.api.injection.scope.This;
-import org.qi4j.api.io.Input;
-import org.qi4j.api.io.Output;
+import org.qi4j.io.Input;
+import org.qi4j.io.Output;
 import org.qi4j.api.property.Property;
-import org.qi4j.api.service.Activatable;
 import org.qi4j.api.usecase.Usecase;
 import org.qi4j.spi.entity.EntityState;
 import org.qi4j.spi.entitystore.EntityStore;
 import org.qi4j.spi.entitystore.EntityStoreException;
 import org.qi4j.spi.entitystore.EntityStoreUnitOfWork;
-import org.qi4j.spi.structure.ModuleSPI;
 
 import javax.naming.Context;
 import javax.naming.NamingException;
 import javax.naming.directory.InitialDirContext;
 import java.util.Hashtable;
+import org.qi4j.api.service.ServiceActivation;
+import org.qi4j.api.structure.Module;
 
 public class JndiEntityStoreMixin
-    implements Activatable, EntityStore
+    implements ServiceActivation, EntityStore
 {
     @This private Configuration<JndiConfiguration> configuration;
     private JndiSetup setup;
 
-    public void activate()
+    public void activateService()
         throws Exception
     {
         connect();
@@ -50,7 +50,7 @@ public class JndiEntityStoreMixin
     private void connect()
         throws NamingException
     {
-        JndiConfiguration conf = configuration.configuration();
+        JndiConfiguration conf = configuration.get();
         setup = new JndiSetup();
         setup.instanceVersionAttribute = conf.versionAttribute().get();
         if( setup.instanceVersionAttribute == null )
@@ -102,19 +102,19 @@ public class JndiEntityStoreMixin
         }
     }
 
-    public void passivate()
+    public void passivateService()
         throws Exception
     {
         setup.context.close();
         setup = null;
     }
 
-    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, ModuleSPI module, long currentTime )
+    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
     {
         return new JndiUow( setup, usecase, module, currentTime );
     }
 
-    public Input<EntityState, EntityStoreException> entityStates( ModuleSPI module )
+    public Input<EntityState, EntityStoreException> entityStates( Module module )
     {
         return new Input<EntityState, EntityStoreException>()
         {

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityStoreService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityStoreService.java b/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityStoreService.java
index 41d4554..f73d5ec 100644
--- a/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityStoreService.java
+++ b/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiEntityStoreService.java
@@ -20,7 +20,7 @@ package org.qi4j.entitystore.jndi;
 import org.qi4j.api.concern.Concerns;
 import org.qi4j.api.configuration.Configuration;
 import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.Activatable;
+import org.qi4j.api.service.ServiceActivation;
 import org.qi4j.api.service.ServiceComposite;
 import org.qi4j.library.locking.LockingAbstractComposite;
 import org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern;
@@ -28,6 +28,6 @@ import org.qi4j.spi.entitystore.EntityStore;
 
 @Concerns( ConcurrentModificationCheckConcern.class )
 @Mixins( JndiEntityStoreMixin.class )
-public interface JndiEntityStoreService extends Activatable, EntityStore, ServiceComposite, LockingAbstractComposite, Configuration
+public interface JndiEntityStoreService extends ServiceActivation, EntityStore, ServiceComposite, LockingAbstractComposite, Configuration
 {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiUow.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiUow.java b/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiUow.java
index da72ee0..3685f27 100644
--- a/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiUow.java
+++ b/extensions/entitystore-jndi/src/main/java/org/qi4j/entitystore/jndi/JndiUow.java
@@ -27,22 +27,20 @@ import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapName;
+import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.common.QualifiedName;
+import org.qi4j.api.entity.EntityDescriptor;
 import org.qi4j.api.entity.EntityReference;
+import org.qi4j.api.property.PropertyDescriptor;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.usecase.Usecase;
-import org.qi4j.spi.entity.EntityDescriptor;
 import org.qi4j.spi.entity.EntityState;
 import org.qi4j.spi.entity.EntityStatus;
-import org.qi4j.spi.entity.EntityType;
-import org.qi4j.spi.entity.association.AssociationType;
 import org.qi4j.spi.entitystore.EntityNotFoundException;
 import org.qi4j.spi.entitystore.EntityStoreException;
 import org.qi4j.spi.entitystore.EntityStoreUnitOfWork;
 import org.qi4j.spi.entitystore.ReadOnlyEntityStoreException;
 import org.qi4j.spi.entitystore.StateCommitter;
-import org.qi4j.spi.property.PropertyType;
-import org.qi4j.spi.structure.ModuleSPI;
 
 public class JndiUow implements EntityStoreUnitOfWork
 {
@@ -84,7 +82,7 @@ public class JndiUow implements EntityStoreUnitOfWork
         throw new ReadOnlyEntityStoreException( "JndiEntityStore is read-only." );
     }
 
-    public EntityState getEntityState( EntityReference identity )
+    public EntityState entityStateOf( EntityReference identity )
         throws EntityStoreException, EntityNotFoundException
     {
         try
@@ -95,11 +93,10 @@ public class JndiUow implements EntityStoreUnitOfWork
             String version = Long.toString( getVersion( attrs ) );
             long lastModified = getLastModified( attrs );
             EntityStatus status = EntityStatus.LOADED;
-            EntityDescriptor descriptor = ((ModuleSPI) module).entityDescriptor( getType( attrs ) );
-            EntityType entityType = descriptor.entityType();
-            Map<QualifiedName, Object> properties = getProperties( attrs, entityType );
-            Map<QualifiedName, EntityReference> associations = getAssociations( attrs, entityType );
-            Map<QualifiedName, List<EntityReference>> manyAssocations = getManyAssociations( attrs, entityType );
+            EntityDescriptor descriptor = module.entityDescriptor( getType( attrs ) );
+            Map<QualifiedName, Object> properties = getProperties( attrs, descriptor );
+            Map<QualifiedName, EntityReference> associations = getAssociations( attrs, descriptor );
+            Map<QualifiedName, List<EntityReference>> manyAssocations = getManyAssociations( attrs, descriptor );
             return new JndiEntityState( this,
                                         version,
                                         lastModified,
@@ -180,12 +177,11 @@ public class JndiUow implements EntityStoreUnitOfWork
     }
 
 
-    private Map<QualifiedName, Object> getProperties( Attributes attrs, EntityType entityType )
+    private Map<QualifiedName, Object> getProperties( Attributes attrs, EntityDescriptor entityType )
         throws NamingException
     {
         Map<QualifiedName, Object> result = new HashMap<QualifiedName, Object>();
-        Iterable<PropertyType> props = entityType.properties();
-        for( PropertyType property : props )
+        for( PropertyDescriptor property : entityType.state().properties() )
         {
             QualifiedName qualifiedName = property.qualifiedName();
             String propertyName = qualifiedName.name();
@@ -201,29 +197,27 @@ public class JndiUow implements EntityStoreUnitOfWork
         return result;
     }
 
-    private Map<QualifiedName, EntityReference> getAssociations( Attributes attrs, EntityType entityType )
+    private Map<QualifiedName, EntityReference> getAssociations( Attributes attrs, EntityDescriptor entityType )
         throws NamingException
     {
         Map<QualifiedName, EntityReference> result = new HashMap<QualifiedName, EntityReference>();
-        Iterable<AssociationType> assocs = entityType.associations();
-        for( AssociationType associationType : assocs )
+        for( AssociationDescriptor associationType : entityType.state().associations() )
         {
             QualifiedName qualifiedName = associationType.qualifiedName();
             String associationName = qualifiedName.name();
             Attribute attribute = attrs.get( associationName );
             String identity = (String) attribute.get();
-            EntityReference entityReference = EntityReference.getEntityReference( identity );
+            EntityReference entityReference = EntityReference.parseEntityReference( identity );
             result.put( qualifiedName, entityReference );
         }
         return result;
     }
 
-    private Map<QualifiedName, List<EntityReference>> getManyAssociations( Attributes attrs, EntityType entityType )
+    private Map<QualifiedName, List<EntityReference>> getManyAssociations( Attributes attrs, EntityDescriptor entityType )
         throws NamingException
     {
         Map<QualifiedName, List<EntityReference>> result = new HashMap<QualifiedName, List<EntityReference>>();
-        Iterable<AssociationType> assocs = entityType.manyAssociations();
-        for( AssociationType associationType : assocs )
+        for( AssociationDescriptor associationType : entityType.state().manyAssociations() )
         {
             QualifiedName qualifiedName = associationType.qualifiedName();
             String associationName = qualifiedName.name();

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-jndi/src/test/java/org/qi4j/entitystore/jndi/JndiReadEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jndi/src/test/java/org/qi4j/entitystore/jndi/JndiReadEntityStoreTest.java b/extensions/entitystore-jndi/src/test/java/org/qi4j/entitystore/jndi/JndiReadEntityStoreTest.java
index 84ddf8d..1e57060 100644
--- a/extensions/entitystore-jndi/src/test/java/org/qi4j/entitystore/jndi/JndiReadEntityStoreTest.java
+++ b/extensions/entitystore-jndi/src/test/java/org/qi4j/entitystore/jndi/JndiReadEntityStoreTest.java
@@ -24,22 +24,25 @@ import org.qi4j.api.common.Visibility;
 import org.qi4j.api.unitofwork.UnitOfWork;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.memory.MemoryEntityStoreService;
 import org.qi4j.spi.uuid.UuidIdentityGeneratorService;
 import org.qi4j.test.AbstractQi4jTest;
 
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
+import org.qi4j.api.value.ValueSerialization;
+import org.qi4j.test.EntityTestAssembler;
+import org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationService;
 
 public class JndiReadEntityStoreTest extends AbstractQi4jTest
 {
     public void assemble( ModuleAssembly module ) throws AssemblyException
     {
-        module.addServices( JndiEntityStoreService.class, UuidIdentityGeneratorService.class );
+        module.services( JndiEntityStoreService.class, UuidIdentityGeneratorService.class );
+        module.services( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
         ModuleAssembly config = module.layer().module( "config" );
         config.entities( JndiConfiguration.class ).visibleIn( Visibility.layer );
-        config.services( MemoryEntityStoreService.class );
+        new EntityTestAssembler().assemble( config );
 
         module.entities( UserEntity.class, GroupEntity.class );
     }
@@ -64,7 +67,7 @@ public class JndiReadEntityStoreTest extends AbstractQi4jTest
     public void testReadNiclasFromLdap()
         throws Exception
     {
-        UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
+        UnitOfWork uow = module.newUnitOfWork();
         try
         {
             User user = uow.get( User.class, "niclas.hedhman" );

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ClientRmiEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ClientRmiEntityStoreMixin.java b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ClientRmiEntityStoreMixin.java
index 6508491..a44105b 100644
--- a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ClientRmiEntityStoreMixin.java
+++ b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ClientRmiEntityStoreMixin.java
@@ -17,34 +17,34 @@
 package org.qi4j.entitystore.rmi;
 
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.api.io.Input;
-import org.qi4j.api.io.Output;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.entitystore.map.MapEntityStore;
+import org.qi4j.io.Input;
+import org.qi4j.io.Output;
 import org.qi4j.spi.entitystore.EntityStoreException;
 
 import java.io.IOException;
 import java.io.Reader;
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
+import org.qi4j.api.service.ServiceActivation;
+import org.qi4j.spi.entitystore.helpers.MapEntityStore;
 
 /**
  * RMI client implementation of Entity
  */
 public class ClientRmiEntityStoreMixin
-    implements Activatable, MapEntityStore
+    implements ServiceActivation, MapEntityStore
 {
     private RemoteEntityStore remote;
 
     // Activatable implementation
-    public void activate()
+    public void activateService()
         throws Exception
     {
         Registry registry = LocateRegistry.getRegistry( "localhost" );
         remote = (RemoteEntityStore) registry.lookup( ServerRmiEntityStoreService.class.getSimpleName() );
     }
 
-    public void passivate()
+    public void passivateService()
         throws Exception
     {
         remote = null;

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ClientRmiEntityStoreService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ClientRmiEntityStoreService.java b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ClientRmiEntityStoreService.java
index 5cd0229..f46424c 100644
--- a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ClientRmiEntityStoreService.java
+++ b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ClientRmiEntityStoreService.java
@@ -17,8 +17,7 @@
 package org.qi4j.entitystore.rmi;
 
 import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.api.service.ServiceComposite;
+import org.qi4j.api.service.ServiceActivation;
 import org.qi4j.library.locking.LockingAbstractComposite;
 import org.qi4j.spi.entitystore.EntityStore;
 
@@ -28,6 +27,6 @@ import org.qi4j.spi.entitystore.EntityStore;
 
 @Mixins( { ClientRmiEntityStoreMixin.class } )
 public interface ClientRmiEntityStoreService
-    extends EntityStore, ServiceComposite, Activatable, LockingAbstractComposite
+    extends EntityStore, ServiceActivation, LockingAbstractComposite
 {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/RegistryMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/RegistryMixin.java b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/RegistryMixin.java
index 8746451..198e11f 100644
--- a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/RegistryMixin.java
+++ b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/RegistryMixin.java
@@ -3,7 +3,7 @@ package org.qi4j.entitystore.rmi;
 import org.qi4j.api.common.AppliesTo;
 import org.qi4j.api.configuration.Configuration;
 import org.qi4j.api.injection.scope.This;
-import org.qi4j.api.service.Activatable;
+import org.qi4j.api.service.ServiceActivation;
 
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
@@ -15,19 +15,19 @@ import java.rmi.server.UnicastRemoteObject;
 /**
  * Create and delegate to a RMI registry.
  */
-@AppliesTo( { Registry.class, Activatable.class } )
+@AppliesTo( { Registry.class, ServiceActivation.class } )
 public class RegistryMixin
-    implements InvocationHandler, Activatable
+    implements InvocationHandler, ServiceActivation
 {
     Registry registry;
 
     @This Configuration<RegistryConfiguration> config;
 
-    public void activate() throws Exception
+    public void activateService() throws Exception
     {
         try
         {
-            Integer port = config.configuration().port().get();
+            Integer port = config.get().port().get();
             registry = LocateRegistry.createRegistry( port );
         }
         catch( RemoteException e )
@@ -36,7 +36,7 @@ public class RegistryMixin
         }
     }
 
-    public void passivate() throws Exception
+    public void passivateService() throws Exception
     {
         for( String boundService : registry.list() )
         {

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/RegistryService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/RegistryService.java b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/RegistryService.java
index 79f2cd6..7adbc7d 100644
--- a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/RegistryService.java
+++ b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/RegistryService.java
@@ -1,8 +1,7 @@
 package org.qi4j.entitystore.rmi;
 
 import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.api.service.ServiceComposite;
+import org.qi4j.api.service.ServiceActivation;
 
 import java.rmi.registry.Registry;
 
@@ -11,6 +10,6 @@ import java.rmi.registry.Registry;
  */
 @Mixins( RegistryMixin.class )
 public interface RegistryService
-    extends ServiceComposite, Registry, Activatable
+    extends ServiceActivation, Registry
 {
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ServerRemoteEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ServerRemoteEntityStoreMixin.java b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ServerRemoteEntityStoreMixin.java
index d76e232..93c2e59 100644
--- a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ServerRemoteEntityStoreMixin.java
+++ b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ServerRemoteEntityStoreMixin.java
@@ -24,7 +24,8 @@ import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.injection.scope.Uses;
-import org.qi4j.api.service.Activatable;
+import org.qi4j.api.service.ServiceActivation;
+import org.qi4j.api.service.ServiceDescriptor;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.api.structure.Module;
 import org.qi4j.library.locking.WriteLock;
@@ -33,13 +34,12 @@ import org.qi4j.spi.entity.EntityState;
 import org.qi4j.spi.entity.QualifiedIdentity;
 import org.qi4j.spi.entitystore.EntityStore;
 import org.qi4j.spi.entitystore.EntityStoreException;
-import org.qi4j.spi.service.ServiceDescriptor;
 
 /**
  * RMI server implementation of EntityStore
  */
 public class ServerRemoteEntityStoreMixin
-    implements RemoteEntityStore, Activatable
+    implements RemoteEntityStore, ServiceActivation
 {
     @Uses
     private ServiceDescriptor descriptor;
@@ -63,14 +63,14 @@ public class ServerRemoteEntityStoreMixin
     private ServiceReference<Registry> registry;
 
     // Activatable implementation
-    public void activate()
+    public void activateService()
         throws Exception
     {
         RemoteEntityStore stub = (RemoteEntityStore) UnicastRemoteObject.exportObject( remote, 0 );
         registry.get().bind( descriptor.identity(), stub );
     }
 
-    public void passivate()
+    public void passivateService()
         throws Exception
     {
         if( registry.isActive() )

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ServerRmiEntityStoreService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ServerRmiEntityStoreService.java b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ServerRmiEntityStoreService.java
index 0ea8707..f3850e6 100644
--- a/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ServerRmiEntityStoreService.java
+++ b/extensions/entitystore-rmi/src/main/java/org/qi4j/entitystore/rmi/ServerRmiEntityStoreService.java
@@ -17,8 +17,7 @@
 package org.qi4j.entitystore.rmi;
 
 import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.api.service.ServiceComposite;
+import org.qi4j.api.service.ServiceActivation;
 import org.qi4j.library.locking.LockingAbstractComposite;
 
 /**
@@ -27,6 +26,6 @@ import org.qi4j.library.locking.LockingAbstractComposite;
 
 @Mixins( { ServerRemoteEntityStoreMixin.class } )
 public interface ServerRmiEntityStoreService
-    extends ServiceComposite, Activatable, LockingAbstractComposite
+    extends ServiceActivation, LockingAbstractComposite
 {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-s3/src/main/java/org/qi4j/entitystore/s3/S3EntityStoreService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-s3/src/main/java/org/qi4j/entitystore/s3/S3EntityStoreService.java b/extensions/entitystore-s3/src/main/java/org/qi4j/entitystore/s3/S3EntityStoreService.java
index a07cc43..37f925a 100644
--- a/extensions/entitystore-s3/src/main/java/org/qi4j/entitystore/s3/S3EntityStoreService.java
+++ b/extensions/entitystore-s3/src/main/java/org/qi4j/entitystore/s3/S3EntityStoreService.java
@@ -17,8 +17,7 @@
 package org.qi4j.entitystore.s3;
 
 import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.api.service.ServiceComposite;
+import org.qi4j.api.service.ServiceActivation;
 import org.qi4j.library.locking.LockingAbstractComposite;
 import org.qi4j.spi.entitystore.EntityStore;
 
@@ -28,7 +27,7 @@ import org.qi4j.spi.entitystore.EntityStore;
 
 @Mixins( { S3SerializationStoreMixin.class } )
 public interface S3EntityStoreService
-    extends EntityStore, ServiceComposite, Activatable, LockingAbstractComposite
+    extends EntityStore, ServiceActivation, LockingAbstractComposite
 
 {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-s3/src/main/java/org/qi4j/entitystore/s3/S3SerializationStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-s3/src/main/java/org/qi4j/entitystore/s3/S3SerializationStoreMixin.java b/extensions/entitystore-s3/src/main/java/org/qi4j/entitystore/s3/S3SerializationStoreMixin.java
index 1278f76..82640bb 100644
--- a/extensions/entitystore-s3/src/main/java/org/qi4j/entitystore/s3/S3SerializationStoreMixin.java
+++ b/extensions/entitystore-s3/src/main/java/org/qi4j/entitystore/s3/S3SerializationStoreMixin.java
@@ -23,14 +23,14 @@ import org.jets3t.service.security.AWSCredentials;
 import org.qi4j.api.configuration.Configuration;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.injection.scope.This;
-import org.qi4j.api.io.Input;
-import org.qi4j.api.io.Output;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.entitystore.map.MapEntityStore;
+import org.qi4j.io.Input;
+import org.qi4j.io.Output;
 import org.qi4j.spi.entitystore.EntityStoreException;
 
 import java.io.IOException;
 import java.io.Reader;
+import org.qi4j.api.service.ServiceActivation;
+import org.qi4j.spi.entitystore.helpers.MapEntityStore;
 
 /**
  * Amazon S3 implementation of SerializationStore.
@@ -38,7 +38,7 @@ import java.io.Reader;
  * To use this you must supply your own access key and secret key for your Amazon S3 account.
  */
 public class S3SerializationStoreMixin
-    implements Activatable, MapEntityStore
+    implements ServiceActivation, MapEntityStore
 {
 
     @This
@@ -48,11 +48,11 @@ public class S3SerializationStoreMixin
     private S3Bucket entityBucket;
 
     // Activatable implementation
-    public void activate()
+    public void activateService()
         throws Exception
     {
-        String awsAccessKey = configuration.configuration().accessKey().get();
-        String awsSecretKey = configuration.configuration().secretKey().get();
+        String awsAccessKey = configuration.get().accessKey().get();
+        String awsSecretKey = configuration.get().secretKey().get();
 
         if( awsAccessKey == null || awsSecretKey == null )
         {
@@ -77,7 +77,7 @@ public class S3SerializationStoreMixin
         }
     }
 
-    public void passivate()
+    public void passivateService()
         throws Exception
     {
     }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-s3/src/test/java/org/qi4j/entitystore/s3/S3EntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-s3/src/test/java/org/qi4j/entitystore/s3/S3EntityStoreTest.java b/extensions/entitystore-s3/src/test/java/org/qi4j/entitystore/s3/S3EntityStoreTest.java
index 71f26dc..7afe3ec 100644
--- a/extensions/entitystore-s3/src/test/java/org/qi4j/entitystore/s3/S3EntityStoreTest.java
+++ b/extensions/entitystore-s3/src/test/java/org/qi4j/entitystore/s3/S3EntityStoreTest.java
@@ -21,7 +21,7 @@ import org.qi4j.api.common.Visibility;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.entitystore.memory.MemoryEntityStoreService;
-import org.qi4j.core.testsupport.AbstractEntityStoreTest;
+import org.qi4j.test.entity.AbstractEntityStoreTest;
 
 /**
  * Amazon S3 EntityStore test
@@ -35,8 +35,8 @@ public abstract class S3EntityStoreTest
         module.addServices( S3EntityStoreService.class ).instantiateOnStartup();
 
         ModuleAssembly config = module.layer().module( "config" );
-        config.addEntities( S3Configuration.class ).visibleIn( Visibility.layer );
-        config.addServices( MemoryEntityStoreService.class );
+        config.entities( S3Configuration.class ).visibleIn( Visibility.layer );
+        config.services( MemoryEntityStoreService.class );
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/DataStore.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/DataStore.java b/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/DataStore.java
index 85563f7..8364c2e 100644
--- a/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/DataStore.java
+++ b/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/DataStore.java
@@ -18,10 +18,10 @@
 package org.qi4j.entitystore.swift;
 
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.api.io.Input;
-import org.qi4j.api.io.Output;
-import org.qi4j.api.io.Receiver;
-import org.qi4j.api.io.Sender;
+import org.qi4j.io.Input;
+import org.qi4j.io.Output;
+import org.qi4j.io.Receiver;
+import org.qi4j.io.Sender;
 import org.qi4j.spi.entitystore.EntityStoreException;
 
 import java.io.*;

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/RecordManager.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/RecordManager.java b/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/RecordManager.java
index 1df027b..9bd7efa 100644
--- a/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/RecordManager.java
+++ b/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/RecordManager.java
@@ -18,7 +18,7 @@
 package org.qi4j.entitystore.swift;
 
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.api.io.Input;
+import org.qi4j.io.Input;
 import org.qi4j.spi.entitystore.EntityStoreException;
 
 import java.io.File;

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreAssembler.java b/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreAssembler.java
index 43a9a66..55c217b 100644
--- a/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreAssembler.java
+++ b/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreAssembler.java
@@ -21,7 +21,6 @@ import org.qi4j.api.common.Visibility;
 import org.qi4j.bootstrap.Assembler;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.memory.MemoryEntityStoreService;
 import org.qi4j.spi.uuid.UuidIdentityGeneratorService;
 
 public class SwiftEntityStoreAssembler
@@ -36,9 +35,8 @@ public class SwiftEntityStoreAssembler
 
     public void assemble( ModuleAssembly module ) throws AssemblyException
     {
-        module.addServices( SwiftEntityStoreService.class, UuidIdentityGeneratorService.class );
+        module.services( SwiftEntityStoreService.class, UuidIdentityGeneratorService.class );
         ModuleAssembly config = module.layer().module( configurationModuleName );
-        config.addEntities( SwiftConfiguration.class ).visibleIn( Visibility.layer );
-        config.addServices( MemoryEntityStoreService.class );
+        config.entities( SwiftConfiguration.class ).visibleIn( Visibility.layer );
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreMixin.java b/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreMixin.java
index 6609e81..89cf3e5 100644
--- a/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreMixin.java
+++ b/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreMixin.java
@@ -21,29 +21,29 @@ import org.qi4j.api.configuration.Configuration;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.injection.scope.Uses;
-import org.qi4j.api.io.Input;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.entitystore.map.MapEntityStore;
-import org.qi4j.spi.entity.EntityType;
+import org.qi4j.api.service.ServiceActivation;
+import org.qi4j.api.service.ServiceDescriptor;
+import org.qi4j.io.Input;
 import org.qi4j.spi.entitystore.EntityNotFoundException;
 import org.qi4j.spi.entitystore.EntityStoreException;
-import org.qi4j.spi.service.ServiceDescriptor;
+import org.qi4j.spi.entitystore.helpers.MapEntityStore;
 
 import java.io.*;
 import java.util.concurrent.locks.ReadWriteLock;
+import org.qi4j.api.entity.EntityDescriptor;
 
 public class SwiftEntityStoreMixin
-    implements Activatable, MapEntityStore
+    implements ServiceActivation, MapEntityStore
 {
     private @This ReadWriteLock lock;
     @Uses private ServiceDescriptor descriptor;
     @This private Configuration<SwiftConfiguration> configuration;
     private RecordManager recordManager;
 
-    public void activate()
+    public void activateService()
         throws Exception
     {
-        SwiftConfiguration conf = configuration.configuration();
+        SwiftConfiguration conf = configuration.get();
         String storage = conf.storageDirectory().get();
         File storageDir;
         storageDir = new File( storage );
@@ -55,7 +55,7 @@ public class SwiftEntityStoreMixin
         recordManager = new RecordManager( storageDir, recover );
     }
 
-    public void passivate()
+    public void passivateService()
         throws Exception
     {
         recordManager.close();
@@ -97,7 +97,7 @@ public class SwiftEntityStoreMixin
         {
             changes.visitMap( new MapChanger()
             {
-                public Writer newEntity( final EntityReference ref, EntityType entityType ) throws IOException
+                public Writer newEntity( final EntityReference ref, EntityDescriptor entityType ) throws IOException
                 {
                     return new StringWriter( 1000 )
                     {
@@ -112,7 +112,7 @@ public class SwiftEntityStoreMixin
                     };
                 }
 
-                public Writer updateEntity( final EntityReference ref, EntityType entityType ) throws IOException
+                public Writer updateEntity( final EntityReference ref, EntityDescriptor entityType ) throws IOException
                 {
                     return new StringWriter( 1000 )
                     {
@@ -126,7 +126,7 @@ public class SwiftEntityStoreMixin
                     };
                 }
 
-                public void removeEntity( EntityReference ref, EntityType entityType ) throws EntityNotFoundException
+                public void removeEntity( EntityReference ref, EntityDescriptor entityType ) throws EntityNotFoundException
                 {
                     try
                     {

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreService.java b/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreService.java
index d3a2c91..3386862 100644
--- a/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreService.java
+++ b/extensions/entitystore-swift/src/main/java/org/qi4j/entitystore/swift/SwiftEntityStoreService.java
@@ -19,18 +19,17 @@ package org.qi4j.entitystore.swift;
 
 import org.qi4j.api.concern.Concerns;
 import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.api.service.ServiceComposite;
-import org.qi4j.entitystore.map.MapEntityStoreMixin;
+import org.qi4j.api.service.ServiceActivation;
 import org.qi4j.library.locking.LockingAbstractComposite;
 import org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern;
 import org.qi4j.spi.entitystore.EntityStateVersions;
 import org.qi4j.spi.entitystore.EntityStore;
 import org.qi4j.spi.entitystore.StateChangeNotificationConcern;
+import org.qi4j.spi.entitystore.helpers.MapEntityStoreMixin;
 
 @Concerns( { StateChangeNotificationConcern.class, ConcurrentModificationCheckConcern.class } )
 @Mixins( { MapEntityStoreMixin.class, SwiftEntityStoreMixin.class } )
 public interface SwiftEntityStoreService
-    extends Activatable, EntityStore, EntityStateVersions, ServiceComposite, LockingAbstractComposite
+    extends ServiceActivation, EntityStore, EntityStateVersions, LockingAbstractComposite
 {
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/extensions/entitystore-swift/src/test/java/org/qi4j/entitystore/swift/SwiftEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-swift/src/test/java/org/qi4j/entitystore/swift/SwiftEntityStoreTest.java b/extensions/entitystore-swift/src/test/java/org/qi4j/entitystore/swift/SwiftEntityStoreTest.java
index 79d90f2..e039475 100644
--- a/extensions/entitystore-swift/src/test/java/org/qi4j/entitystore/swift/SwiftEntityStoreTest.java
+++ b/extensions/entitystore-swift/src/test/java/org/qi4j/entitystore/swift/SwiftEntityStoreTest.java
@@ -17,13 +17,14 @@
  */
 package org.qi4j.entitystore.swift;
 
-import org.junit.Ignore;
 import org.qi4j.api.common.Visibility;
+import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.memory.MemoryEntityStoreService;
-import org.qi4j.core.testsupport.AbstractEntityStoreTest;
+import org.qi4j.test.entity.AbstractEntityStoreTest;
 import org.qi4j.spi.uuid.UuidIdentityGeneratorService;
+import org.qi4j.test.EntityTestAssembler;
+import org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationService;
 
 public class SwiftEntityStoreTest extends AbstractEntityStoreTest
 {
@@ -31,11 +32,12 @@ public class SwiftEntityStoreTest extends AbstractEntityStoreTest
         throws AssemblyException
     {
         super.assemble( module );
-        module.addServices( SwiftEntityStoreService.class, UuidIdentityGeneratorService.class );
+        module.services( SwiftEntityStoreService.class, UuidIdentityGeneratorService.class );
+        module.services( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
 
         ModuleAssembly config = module.layer().module( "config" );
-        config.addEntities( SwiftConfiguration.class ).visibleIn( Visibility.layer );
-        config.addServices( MemoryEntityStoreService.class );
+        config.entities( SwiftConfiguration.class ).visibleIn( Visibility.layer );
+        new EntityTestAssembler().assemble( config );
     }
 
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/beans/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/beans/pom.xml b/libraries/beans/pom.xml
index defdb50..c8c36c7 100644
--- a/libraries/beans/pom.xml
+++ b/libraries/beans/pom.xml
@@ -16,6 +16,10 @@
     </dependency>
     <dependency>
       <groupId>org.qi4j.core</groupId>
+      <artifactId>org.qi4j.core.spi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.qi4j.core</groupId>
       <artifactId>org.qi4j.core.bootstrap</artifactId>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/beans/src/main/java/org/qi4j/library/beans/support/DelegatingIterator.java
----------------------------------------------------------------------
diff --git a/libraries/beans/src/main/java/org/qi4j/library/beans/support/DelegatingIterator.java b/libraries/beans/src/main/java/org/qi4j/library/beans/support/DelegatingIterator.java
index 18721c9..c8bb012 100644
--- a/libraries/beans/src/main/java/org/qi4j/library/beans/support/DelegatingIterator.java
+++ b/libraries/beans/src/main/java/org/qi4j/library/beans/support/DelegatingIterator.java
@@ -17,19 +17,19 @@
  */
 package org.qi4j.library.beans.support;
 
-import org.qi4j.api.entity.association.AssociationInfo;
 import org.qi4j.api.composite.TransientBuilderFactory;
 
 import java.util.Iterator;
+import org.qi4j.api.association.AssociationDescriptor;
 
 public class DelegatingIterator
     implements Iterator
 {
     private Iterator source;
-    private final AssociationInfo info;
+    private final AssociationDescriptor info;
     private final TransientBuilderFactory cbf;
 
-    public DelegatingIterator( Iterator source, AssociationInfo info, TransientBuilderFactory cbf )
+    public DelegatingIterator( Iterator source, AssociationDescriptor info, TransientBuilderFactory cbf )
     {
         this.source = source;
         this.info = info;

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/beans/src/main/java/org/qi4j/library/beans/support/DelegatingListIterator.java
----------------------------------------------------------------------
diff --git a/libraries/beans/src/main/java/org/qi4j/library/beans/support/DelegatingListIterator.java b/libraries/beans/src/main/java/org/qi4j/library/beans/support/DelegatingListIterator.java
index 4855dd9..4dc5fb5 100644
--- a/libraries/beans/src/main/java/org/qi4j/library/beans/support/DelegatingListIterator.java
+++ b/libraries/beans/src/main/java/org/qi4j/library/beans/support/DelegatingListIterator.java
@@ -17,19 +17,19 @@
  */
 package org.qi4j.library.beans.support;
 
-import org.qi4j.api.entity.association.AssociationInfo;
 import org.qi4j.api.composite.TransientBuilderFactory;
 
 import java.util.ListIterator;
+import org.qi4j.api.association.AssociationDescriptor;
 
 public class DelegatingListIterator
     implements ListIterator
 {
     private ListIterator source;
-    private final AssociationInfo info;
+    private final AssociationDescriptor info;
     private final TransientBuilderFactory cbf;
 
-    public DelegatingListIterator( ListIterator source, AssociationInfo info, TransientBuilderFactory cbf )
+    public DelegatingListIterator( ListIterator source, AssociationDescriptor info, TransientBuilderFactory cbf )
     {
         this.source = source;
         this.info = info;

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanAssociation.java
----------------------------------------------------------------------
diff --git a/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanAssociation.java b/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanAssociation.java
index c2c549a..a30e495 100644
--- a/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanAssociation.java
+++ b/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanAssociation.java
@@ -17,58 +17,53 @@
  */
 package org.qi4j.library.beans.support;
 
-import org.qi4j.api.common.MetaInfo;
 import org.qi4j.api.common.QualifiedName;
-import org.qi4j.api.entity.association.Association;
-import org.qi4j.api.entity.association.GenericAssociationInfo;
+import org.qi4j.api.association.Association;
 import org.qi4j.api.composite.TransientBuilder;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.lang.reflect.UndeclaredThrowableException;
+import org.qi4j.api.association.AssociationDescriptor;
 
 public class JavabeanAssociation
     implements Association
 {
-    public Method pojoMethod;
-    private GenericAssociationInfo delegate;
-    private JavabeanMixin javabeanMixin;
+    private final JavabeanMixin javabeanMixin;
+    private final AssociationDescriptor descriptor;
+    public final Method pojoMethod;
 
-    public JavabeanAssociation( JavabeanMixin javabeanMixin, Method method )
+    public JavabeanAssociation( JavabeanMixin javabeanMixin, AssociationDescriptor descriptor, Method pojoMethod )
     {
         this.javabeanMixin = javabeanMixin;
-        delegate = new GenericAssociationInfo( method, new MetaInfo() );
-    }
-
-    void setPojoMethod( Method pojoMethod )
-    {
+        this.descriptor = descriptor;
         this.pojoMethod = pojoMethod;
     }
 
     public <T> T metaInfo( Class<T> infoType )
     {
-        return delegate.metaInfo( infoType );
+        return descriptor.metaInfo( infoType );
     }
 
     public QualifiedName qualifiedName()
     {
-        return delegate.qualifiedName();
+        return descriptor.qualifiedName();
     }
 
     public Type type()
     {
-        return delegate.type();
+        return descriptor.type();
     }
 
     public boolean isImmutable()
     {
-        return delegate.isImmutable();
+        return descriptor.isImmutable();
     }
 
     public boolean isAggregated()
     {
-        return delegate.isAggregated();
+        return descriptor.isAggregated();
     }
 
     public Object get()
@@ -98,6 +93,5 @@ public class JavabeanAssociation
     public void set( Object associated ) throws IllegalArgumentException
     {
         //TODO: Auto-generated, need attention.
-
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanManyAssociation.java
----------------------------------------------------------------------
diff --git a/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanManyAssociation.java b/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanManyAssociation.java
index 948cff4..c8a96b8 100644
--- a/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanManyAssociation.java
+++ b/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanManyAssociation.java
@@ -17,10 +17,9 @@
  */
 package org.qi4j.library.beans.support;
 
-import org.qi4j.api.common.MetaInfo;
 import org.qi4j.api.common.QualifiedName;
-import org.qi4j.api.entity.association.GenericAssociationInfo;
-import org.qi4j.api.entity.association.ManyAssociation;
+import org.qi4j.api.association.AssociationDescriptor;
+import org.qi4j.api.association.ManyAssociation;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -34,44 +33,40 @@ import java.util.List;
 public class JavabeanManyAssociation
     implements ManyAssociation
 {
-    private Method pojoMethod;
-    private GenericAssociationInfo delegate;
     private final JavabeanMixin javabeanMixin;
+    private final AssociationDescriptor descriptor;
+    private final Method pojoMethod;
 
-    public JavabeanManyAssociation( JavabeanMixin javabeanMixin, Method method )
+    public JavabeanManyAssociation( JavabeanMixin javabeanMixin, AssociationDescriptor descriptor, Method pojoMethod )
     {
         this.javabeanMixin = javabeanMixin;
-        delegate = new GenericAssociationInfo( method, new MetaInfo() );
-    }
-
-    void setPojoMethod( Method pojoMethod )
-    {
+        this.descriptor = descriptor;
         this.pojoMethod = pojoMethod;
     }
 
     public <T> T metaInfo( Class<T> infoType )
     {
-        return delegate.metaInfo( infoType );
+        return descriptor.metaInfo( infoType );
     }
 
     public QualifiedName qualifiedName()
     {
-        return delegate.qualifiedName();
+        return descriptor.qualifiedName();
     }
 
     public Type type()
     {
-        return delegate.type();
+        return descriptor.type();
     }
 
     public boolean isImmutable()
     {
-        return delegate.isImmutable();
+        return descriptor.isImmutable();
     }
 
     public boolean isAggregated()
     {
-        return delegate.isAggregated();
+        return descriptor.isAggregated();
     }
 
     public int size()
@@ -101,7 +96,7 @@ public class JavabeanManyAssociation
 
     public Iterator iterator()
     {
-        return new DelegatingIterator( delegate().iterator(), this, javabeanMixin.cbf );
+        return new DelegatingIterator( delegate().iterator(), descriptor, javabeanMixin.cbf );
     }
 
     public Object[] toArray()
@@ -110,7 +105,7 @@ public class JavabeanManyAssociation
         Object[] wrapped = new Object[objects.length];
         for( int i = 0; i < objects.length; i++ )
         {
-            wrapped[ i ] = Wrapper.wrap( objects[ i ], this, javabeanMixin.cbf );
+            wrapped[ i ] = Wrapper.wrap( objects[ i ], descriptor, javabeanMixin.cbf );
         }
         return wrapped;
     }
@@ -177,7 +172,7 @@ public class JavabeanManyAssociation
         Object[] array = delegate().toArray( objects );
         for( int i = 0; i < array.length; i++ )
         {
-            array[ i ] = Wrapper.wrap( array[ i ], this, javabeanMixin.cbf );
+            array[ i ] = Wrapper.wrap( array[ i ], descriptor, javabeanMixin.cbf );
         }
         return array;
     }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanMixin.java
----------------------------------------------------------------------
diff --git a/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanMixin.java b/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanMixin.java
index d25a2a4..b6b6772 100644
--- a/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanMixin.java
+++ b/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanMixin.java
@@ -18,57 +18,64 @@
 
 package org.qi4j.library.beans.support;
 
+import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.util.HashMap;
+import org.qi4j.api.Qi4j;
 import org.qi4j.api.common.AppliesTo;
 import org.qi4j.api.common.AppliesToFilter;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.composite.TransientBuilderFactory;
-import org.qi4j.api.entity.association.Association;
-import org.qi4j.api.entity.association.ManyAssociation;
+import org.qi4j.api.association.Association;
+import org.qi4j.api.association.AssociationDescriptor;
+import org.qi4j.api.association.AssociationStateDescriptor;
+import org.qi4j.api.association.ManyAssociation;
+import org.qi4j.api.composite.CompositeDescriptor;
+import org.qi4j.api.composite.StateDescriptor;
+import org.qi4j.api.composite.StatefulCompositeDescriptor;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.injection.scope.Uses;
 import org.qi4j.api.property.Property;
-import org.qi4j.spi.util.MethodKeyMap;
+import org.qi4j.api.property.PropertyDescriptor;
+import org.qi4j.api.structure.Module;
 
 @AppliesTo( { JavabeanMixin.JavabeanSupportFilter.class } )
 public class JavabeanMixin
     implements JavabeanSupport, InvocationHandler
 {
-    private HashMap<Method, Object> handlers;
+    private HashMap<AccessibleObject, Object> handlers;
 
     @Structure TransientBuilderFactory cbf;
     Object pojo;
 
-    public JavabeanMixin( @This Composite thisComposite, @Uses Object pojo )
+    public JavabeanMixin( @Structure Module module, @This Composite thisComposite, @Uses Object pojo )
     {
         this.pojo = pojo;
-        handlers = new MethodKeyMap<Object>();
-        Class<? extends Composite> type = thisComposite.type();
-        for( Method method : type.getMethods() )
+        this.handlers = new HashMap<AccessibleObject, Object>();
+        CompositeDescriptor thisDescriptor = Qi4j.FUNCTION_DESCRIPTOR_FOR.map( thisComposite );
+        if( thisDescriptor instanceof StatefulCompositeDescriptor )
         {
-            Class<?> returnType = method.getReturnType();
-            if( Property.class.isAssignableFrom( returnType ) )
+            StateDescriptor stateDescriptor = ( (StatefulCompositeDescriptor) thisDescriptor ).state();
+            for( PropertyDescriptor propDesc : stateDescriptor.properties() )
             {
-                JavabeanProperty prop = new JavabeanProperty( this, method );
-                Method pojoMethod = findMethod( pojo, prop.qualifiedName().name() );
-                prop.setPojoMethod( pojoMethod );
-                handlers.put( method, prop );
+                Method pojoMethod = findMethod( pojo, propDesc.qualifiedName().name() );
+                handlers.put( propDesc.accessor(), new JavabeanProperty( this, propDesc, pojoMethod ) );
             }
-            else if( ManyAssociation.class.isAssignableFrom( returnType ) )
+            if( stateDescriptor instanceof AssociationStateDescriptor )
             {
-                JavabeanManyAssociation association = new JavabeanManyAssociation( this, method );
-                Method pojoMethod = findMethod( pojo, association.qualifiedName().name() );
-                association.setPojoMethod( pojoMethod );
-                handlers.put( method, association );
-            }
-            else if( Association.class.isAssignableFrom( returnType ) )
-            {
-                JavabeanAssociation association = new JavabeanAssociation( this, method );
-                association.pojoMethod = findMethod( pojo, association.qualifiedName().name() );
-                handlers.put( method, association );
+                AssociationStateDescriptor assocStateDesc = (AssociationStateDescriptor) stateDescriptor;
+                for( AssociationDescriptor assocDesc : assocStateDesc.associations() )
+                {
+                    Method pojoMethod = findMethod( pojo, assocDesc.qualifiedName().name() );
+                    handlers.put( assocDesc.accessor(), new JavabeanAssociation( this, assocDesc, pojoMethod ) );
+                }
+                for( AssociationDescriptor assocDesc : assocStateDesc.manyAssociations() )
+                {
+                    Method pojoMethod = findMethod( pojo, assocDesc.qualifiedName().name() );
+                    handlers.put( assocDesc.accessor(), new JavabeanManyAssociation( this, assocDesc, pojoMethod ) );
+                }
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanProperty.java
----------------------------------------------------------------------
diff --git a/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanProperty.java b/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanProperty.java
index 541d4fc..6ca01f7 100644
--- a/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanProperty.java
+++ b/libraries/beans/src/main/java/org/qi4j/library/beans/support/JavabeanProperty.java
@@ -26,17 +26,20 @@ import java.util.Arrays;
 import java.util.List;
 import org.qi4j.api.composite.TransientBuilder;
 import org.qi4j.api.composite.TransientBuilderFactory;
-import org.qi4j.api.property.ComputedPropertyInstance;
+import org.qi4j.api.property.Property;
+import org.qi4j.api.property.PropertyDescriptor;
 
-public class JavabeanProperty extends ComputedPropertyInstance
+public class JavabeanProperty implements Property
 {
-    private Method pojoMethod;
-    private JavabeanMixin javabeanMixin;
+    private final JavabeanMixin javabeanMixin;
+    private final PropertyDescriptor descriptor;
+    private final Method pojoMethod;
 
-    public JavabeanProperty( JavabeanMixin javabeanMixin, Method qi4jPropertyMethod )
+    public JavabeanProperty( JavabeanMixin javabeanMixin, PropertyDescriptor descriptor, Method pojoMethod )
     {
-        super( qi4jPropertyMethod );
         this.javabeanMixin = javabeanMixin;
+        this.descriptor = descriptor;
+        this.pojoMethod = pojoMethod;
     }
 
     public Object get()
@@ -62,7 +65,7 @@ public class JavabeanProperty extends ComputedPropertyInstance
         {
             return null;
         }
-        Type type = type();
+        Type type = descriptor.type();
         if( type instanceof Class )
         {
             Class clazz = (Class) type;
@@ -112,8 +115,9 @@ public class JavabeanProperty extends ComputedPropertyInstance
         return resultObject;
     }
 
-    void setPojoMethod( Method pojoMethod )
+    public void set( Object newValue )
+        throws IllegalArgumentException, IllegalStateException
     {
-        this.pojoMethod = pojoMethod;
+        //TODO: Auto-generated, need attention.
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/beans/src/main/java/org/qi4j/library/beans/support/Wrapper.java
----------------------------------------------------------------------
diff --git a/libraries/beans/src/main/java/org/qi4j/library/beans/support/Wrapper.java b/libraries/beans/src/main/java/org/qi4j/library/beans/support/Wrapper.java
index 0125b77..d717f75 100644
--- a/libraries/beans/src/main/java/org/qi4j/library/beans/support/Wrapper.java
+++ b/libraries/beans/src/main/java/org/qi4j/library/beans/support/Wrapper.java
@@ -19,11 +19,11 @@ package org.qi4j.library.beans.support;
 
 import org.qi4j.api.composite.TransientBuilderFactory;
 import org.qi4j.api.composite.TransientBuilder;
-import org.qi4j.api.entity.association.AssociationInfo;
+import org.qi4j.api.association.AssociationDescriptor;
 
 public class Wrapper
 {
-    static Object wrap( Object resultObject, AssociationInfo info, TransientBuilderFactory cbf )
+    static Object wrap( Object resultObject, AssociationDescriptor info, TransientBuilderFactory cbf )
     {
         Class type = (Class) info.type();
         if( type.isInterface() )

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/beans/src/test/java/org/qi4j/library/beans/properties/PropertiesMixinTest.java
----------------------------------------------------------------------
diff --git a/libraries/beans/src/test/java/org/qi4j/library/beans/properties/PropertiesMixinTest.java b/libraries/beans/src/test/java/org/qi4j/library/beans/properties/PropertiesMixinTest.java
index 69150fd..8ca4dee 100644
--- a/libraries/beans/src/test/java/org/qi4j/library/beans/properties/PropertiesMixinTest.java
+++ b/libraries/beans/src/test/java/org/qi4j/library/beans/properties/PropertiesMixinTest.java
@@ -17,7 +17,6 @@ import static junit.framework.Assert.assertFalse;
 import static org.junit.Assert.*;
 import org.junit.Before;
 import org.junit.Test;
-import org.qi4j.api.composite.Composite;
 import org.qi4j.api.composite.TransientBuilder;
 import org.qi4j.api.composite.TransientComposite;
 import org.qi4j.api.mixin.Mixins;
@@ -33,7 +32,7 @@ public class PropertiesMixinTest extends AbstractQi4jTest
 
     public void assemble( ModuleAssembly aModule ) throws AssemblyException
     {
-        aModule.addTransients( SampleJavaBeanComposite.class );
+        aModule.transients( SampleJavaBeanComposite.class );
     }
 
     @Override
@@ -41,7 +40,7 @@ public class PropertiesMixinTest extends AbstractQi4jTest
     public void setUp() throws Exception
     {
         super.setUp();
-        TransientBuilder<SampleJavaBeanComposite> builder = transientBuilderFactory.newTransientBuilder( SampleJavaBeanComposite.class );
+        TransientBuilder<SampleJavaBeanComposite> builder = module.newTransientBuilder( SampleJavaBeanComposite.class );
         m_proxy = builder.newInstance();
     }
 

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/beans/src/test/java/org/qi4j/library/beans/support/JavabeanBackedTest.java
----------------------------------------------------------------------
diff --git a/libraries/beans/src/test/java/org/qi4j/library/beans/support/JavabeanBackedTest.java b/libraries/beans/src/test/java/org/qi4j/library/beans/support/JavabeanBackedTest.java
index f69e480..e1ed9a8 100644
--- a/libraries/beans/src/test/java/org/qi4j/library/beans/support/JavabeanBackedTest.java
+++ b/libraries/beans/src/test/java/org/qi4j/library/beans/support/JavabeanBackedTest.java
@@ -23,11 +23,10 @@ import static org.junit.Assert.assertTrue;
 import org.junit.Test;
 import org.junit.Ignore;
 import org.qi4j.api.common.Optional;
-import org.qi4j.api.composite.Composite;
 import org.qi4j.api.composite.TransientComposite;
 import org.qi4j.api.composite.TransientBuilder;
-import org.qi4j.api.entity.association.Association;
-import org.qi4j.api.entity.association.ManyAssociation;
+import org.qi4j.api.association.Association;
+import org.qi4j.api.association.ManyAssociation;
 import org.qi4j.api.property.Property;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
@@ -43,7 +42,7 @@ public class JavabeanBackedTest extends AbstractQi4jTest
 
     public void assemble( ModuleAssembly module ) throws AssemblyException
     {
-        module.addTransients( PersonComposite.class, CountryComposite.class, CityComposite.class );
+        module.transients( PersonComposite.class, CountryComposite.class, CityComposite.class );
     }
 
     @Test
@@ -76,7 +75,7 @@ public class JavabeanBackedTest extends AbstractQi4jTest
         friendsNiclas.add( makasPojo );
         friendsNiclas.add( edwardPojo );
 
-        TransientBuilder<Person> builder = transientBuilderFactory.newTransientBuilder( Person.class );
+        TransientBuilder<Person> builder = module.newTransientBuilder( Person.class );
         builder.use( niclasPojo );
         Person niclas = builder.newInstance();
         Property<String> stringProperty = niclas.name();


Mime
View raw message