polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [04/10] zest-sandbox git commit: Cleanup Zest Sandbox - Use Qi4j 2.0
Date Mon, 20 Apr 2015 08:08:09 GMT
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/EntityProxy.java
----------------------------------------------------------------------
diff --git a/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/EntityProxy.java
b/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/EntityProxy.java
index ca1ad28..f212b63 100644
--- a/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/EntityProxy.java
+++ b/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/EntityProxy.java
@@ -20,10 +20,10 @@ import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Immutable;
 import org.qi4j.api.property.Property;
-import org.qi4j.api.unitofwork.UnitOfWorkConcern;
 import org.qi4j.api.unitofwork.UnitOfWorkFactory;
-import org.qi4j.api.unitofwork.UnitOfWorkPropagation;
-import org.qi4j.api.unitofwork.UnitOfWorkPropagation.Propagation;
+import org.qi4j.api.unitofwork.concern.UnitOfWorkConcern;
+import org.qi4j.api.unitofwork.concern.UnitOfWorkPropagation;
+import org.qi4j.api.unitofwork.concern.UnitOfWorkPropagation.Propagation;
 
 @Mixins({
     EntityProxy.EntityProxyMixin.class

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/EntityProxyHelper.java
----------------------------------------------------------------------
diff --git a/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/EntityProxyHelper.java
b/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/EntityProxyHelper.java
index 625e8b9..5376bee 100644
--- a/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/EntityProxyHelper.java
+++ b/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/EntityProxyHelper.java
@@ -18,10 +18,10 @@ import org.qi4j.api.concern.Concerns;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.service.ServiceComposite;
-import org.qi4j.api.unitofwork.UnitOfWorkConcern;
 import org.qi4j.api.unitofwork.UnitOfWorkFactory;
-import org.qi4j.api.unitofwork.UnitOfWorkPropagation;
-import org.qi4j.api.unitofwork.UnitOfWorkPropagation.Propagation;
+import org.qi4j.api.unitofwork.concern.UnitOfWorkConcern;
+import org.qi4j.api.unitofwork.concern.UnitOfWorkPropagation;
+import org.qi4j.api.unitofwork.concern.UnitOfWorkPropagation.Propagation;
 
 /**
  *

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/ProxyableEntity.java
----------------------------------------------------------------------
diff --git a/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/ProxyableEntity.java
b/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/ProxyableEntity.java
index 672b0c0..38ce038 100644
--- a/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/ProxyableEntity.java
+++ b/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/ProxyableEntity.java
@@ -69,7 +69,7 @@ public interface ProxyableEntity
       Class<?> commonClass = this.doGetCommonType(proxyClass);
       if (commonClass == null)
       {
-         throw new NoCommonClassFoundException("Did not find common class for entity of type:
" + this._meAsEntityComposite.type() + " [proxyClass: " + proxyClass.getName() + "].");
+         throw new NoCommonClassFoundException("Did not find common class for entity of type:
" + this._meAsEntityComposite.getClass().getName() + " [proxyClass: " + proxyClass.getName()
+ "].");
       }
       state.commonClass().set(commonClass);
       state.entityID().set(this._meAsEntityComposite.identity().get());

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/internal/EntityProxyCache.java
----------------------------------------------------------------------
diff --git a/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/internal/EntityProxyCache.java
b/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/internal/EntityProxyCache.java
index 3e495a5..c2e84a7 100644
--- a/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/internal/EntityProxyCache.java
+++ b/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/internal/EntityProxyCache.java
@@ -17,11 +17,11 @@ package org.qi4j.library.entityproxy.internal;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
-import org.qi4j.api.service.Activatable;
+import org.qi4j.api.service.ServiceActivation;
 import org.qi4j.library.constraints.annotation.GreaterThan;
 import org.qi4j.library.entityproxy.EntityProxy;
 
-public interface EntityProxyCache
+public interface EntityProxyCache extends ServiceActivation
 {
     public EntityProxy getFromCache(String entityID);
 
@@ -35,7 +35,7 @@ public interface EntityProxyCache
 
     public void setMaxCacheSize(@GreaterThan(0) Integer newSize);
 
-   public abstract class EntityProxyUtilsMixin implements EntityProxyCache, Activatable
+   public abstract class EntityProxyUtilsMixin implements EntityProxyCache
    {
 
       private static final Integer DEFAULT_MAX_PROXIES = 1000;
@@ -45,14 +45,14 @@ public interface EntityProxyCache
       private Integer _maxProxies;
 
       @Override
-      public void activate() throws Exception
+      public void activateService() throws Exception
       {
          this._maxProxies = DEFAULT_MAX_PROXIES;
          this._entityProxyMapping = new LinkedHashMap<String, EntityProxy>(this._maxProxies);
       }
 
       @Override
-      public void passivate() throws Exception
+      public void passivateService() throws Exception
       {
       }
 

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/internal/EntityProxyCacheService.java
----------------------------------------------------------------------
diff --git a/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/internal/EntityProxyCacheService.java
b/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/internal/EntityProxyCacheService.java
index 12674c9..cd2ab00 100644
--- a/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/internal/EntityProxyCacheService.java
+++ b/libraries/entityproxy/src/main/java/org/qi4j/library/entityproxy/internal/EntityProxyCacheService.java
@@ -17,7 +17,7 @@ package org.qi4j.library.entityproxy.internal;
 import org.qi4j.api.concern.Concerns;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.service.ServiceComposite;
-import org.qi4j.api.unitofwork.UnitOfWorkConcern;
+import org.qi4j.api.unitofwork.concern.UnitOfWorkConcern;
 
 @Mixins({
    EntityProxyCache.EntityProxyUtilsMixin.class

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/entityproxy/src/test/java/org/qi4j/library/entityproxy/EntityProxyTest.java
----------------------------------------------------------------------
diff --git a/libraries/entityproxy/src/test/java/org/qi4j/library/entityproxy/EntityProxyTest.java
b/libraries/entityproxy/src/test/java/org/qi4j/library/entityproxy/EntityProxyTest.java
index 19a708f..2563be2 100644
--- a/libraries/entityproxy/src/test/java/org/qi4j/library/entityproxy/EntityProxyTest.java
+++ b/libraries/entityproxy/src/test/java/org/qi4j/library/entityproxy/EntityProxyTest.java
@@ -23,14 +23,13 @@ import org.qi4j.api.unitofwork.UnitOfWork;
 import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.memory.MemoryEntityStoreService;
 import org.qi4j.library.entityproxy.EntityWithMutualType.EntityCompositeWithMutualType;
 import org.qi4j.library.entityproxy.EntityWithMutualType.EntityProxyWithMutualType;
 import org.qi4j.library.entityproxy.MissingMutualTypeEntity.MissingMutualTypeEntityComposite;
 import org.qi4j.library.entityproxy.MissingMutualTypeEntity.MissingMutualTypeEntityProxy;
 import org.qi4j.library.entityproxy.assembling.EntityProxyAssembler;
-import org.qi4j.spi.uuid.UuidIdentityGeneratorService;
 import org.qi4j.test.AbstractQi4jTest;
+import org.qi4j.test.EntityTestAssembler;
 
 /**
  *
@@ -43,18 +42,18 @@ public class EntityProxyTest extends AbstractQi4jTest
     public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
-        module.addEntities( EntityCompositeWithMutualType.class, MissingMutualTypeEntityComposite.class
);
-        module.addTransients( EntityProxyWithMutualType.class, MissingMutualTypeEntityProxy.class
);
+        module.entities( EntityCompositeWithMutualType.class, MissingMutualTypeEntityComposite.class
);
+        module.transients( EntityProxyWithMutualType.class, MissingMutualTypeEntityProxy.class
);
 
         EntityProxyAssembler eAss = new EntityProxyAssembler();
         eAss.assemble( module );
 
-        module.addServices( UuidIdentityGeneratorService.class, MemoryEntityStoreService.class
);
+        new EntityTestAssembler().assemble( module );
     }
 
     private <EntityType> EntityType createEntity(Class<EntityType> entityClass)
throws ConcurrentEntityModificationException, UnitOfWorkCompletionException
     {
-        UnitOfWork uow = this.unitOfWorkFactory.newUnitOfWork();
+        UnitOfWork uow = module.newUnitOfWork();
         EntityType result = uow.newEntity( entityClass );
         uow.complete();
         return result;
@@ -65,7 +64,7 @@ public class EntityProxyTest extends AbstractQi4jTest
     {
         EntityWithMutualType entity = this.createEntity( EntityCompositeWithMutualType.class
);
 
-        UnitOfWork uow = this.unitOfWorkFactory.newUnitOfWork();
+        UnitOfWork uow = module.newUnitOfWork();
         EntityWithMutualType proxy = ((ProxyableEntity)uow.get( entity )).getProxy( EntityWithMutualType.class
);
         uow.complete();
 
@@ -77,13 +76,13 @@ public class EntityProxyTest extends AbstractQi4jTest
     {
         EntityWithMutualType entity = this.createEntity( EntityCompositeWithMutualType.class
);
 
-        UnitOfWork uow = this.unitOfWorkFactory.newUnitOfWork();
+        UnitOfWork uow = module.newUnitOfWork();
         EntityWithMutualType proxy = ((ProxyableEntity)uow.get( entity )).getProxy( EntityWithMutualType.class
);
         uow.complete();
 
         entity = ((EntityProxy)proxy).getEntity( EntityWithMutualType.class );
 
-        uow = this.unitOfWorkFactory.newUnitOfWork();
+        uow = module.newUnitOfWork();
         try
         {
             Assert.assertNotNull( "The proxy must point to existing entity.", uow.get(entity)
);
@@ -98,7 +97,7 @@ public class EntityProxyTest extends AbstractQi4jTest
     {
         MissingMutualTypeEntity entity = this.createEntity( MissingMutualTypeEntity.class
);
 
-        UnitOfWork uow = this.unitOfWorkFactory.newUnitOfWork();
+        UnitOfWork uow = module.newUnitOfWork();
         try
         {
             MissingMutualTypeEntity proxy = ((ProxyableEntity)uow.get( entity )).getProxy(
MissingMutualTypeEntity.class );
@@ -113,13 +112,13 @@ public class EntityProxyTest extends AbstractQi4jTest
     {
         EntityWithMutualType entity = this.createEntity( EntityCompositeWithMutualType.class
);
 
-        UnitOfWork uow = this.unitOfWorkFactory.newUnitOfWork();
+        UnitOfWork uow = module.newUnitOfWork();
         EntityWithMutualType proxy = ((ProxyableEntity)uow.get( entity )).getProxy( EntityWithMutualType.class
);
         uow.complete();
 
         proxy.setMyString( "TestString" );
 
-        uow = this.unitOfWorkFactory.newUnitOfWork();
+        uow = module.newUnitOfWork();
         try
         {
             Assert.assertEquals( "The change must go down to entity.", "TestString", uow.get(
entity ).getMyString() );

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/entityproxy/src/test/java/org/qi4j/library/entityproxy/SomeRole.java
----------------------------------------------------------------------
diff --git a/libraries/entityproxy/src/test/java/org/qi4j/library/entityproxy/SomeRole.java
b/libraries/entityproxy/src/test/java/org/qi4j/library/entityproxy/SomeRole.java
index d9cb6ff..8c1e18b 100644
--- a/libraries/entityproxy/src/test/java/org/qi4j/library/entityproxy/SomeRole.java
+++ b/libraries/entityproxy/src/test/java/org/qi4j/library/entityproxy/SomeRole.java
@@ -19,8 +19,8 @@ import org.qi4j.api.common.Optional;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Property;
-import org.qi4j.api.unitofwork.UnitOfWorkPropagation;
-import org.qi4j.api.unitofwork.UnitOfWorkPropagation.Propagation;
+import org.qi4j.api.unitofwork.concern.UnitOfWorkPropagation;
+import org.qi4j.api.unitofwork.concern.UnitOfWorkPropagation.Propagation;
 
 /**
  *

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/executor/src/main/java/org/qi4j/library/executor/ExecuteService.java
----------------------------------------------------------------------
diff --git a/libraries/executor/src/main/java/org/qi4j/library/executor/ExecuteService.java
b/libraries/executor/src/main/java/org/qi4j/library/executor/ExecuteService.java
index 6d1042f..5e41afb 100644
--- a/libraries/executor/src/main/java/org/qi4j/library/executor/ExecuteService.java
+++ b/libraries/executor/src/main/java/org/qi4j/library/executor/ExecuteService.java
@@ -14,17 +14,15 @@
 
 package org.qi4j.library.executor;
 
-import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.api.service.ServiceComposite;
-
 import java.util.concurrent.Executor;
+import org.qi4j.api.mixin.Mixins;
+import org.qi4j.api.service.ServiceActivation;
 
 /**
  * JAVADOC
  */
 @Mixins( ExecutorMixin.class )
 public interface ExecuteService
-    extends Executor, Activatable, ServiceComposite
+    extends Executor, ServiceActivation
 {
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/executor/src/main/java/org/qi4j/library/executor/ExecutorMixin.java
----------------------------------------------------------------------
diff --git a/libraries/executor/src/main/java/org/qi4j/library/executor/ExecutorMixin.java
b/libraries/executor/src/main/java/org/qi4j/library/executor/ExecutorMixin.java
index 8fd56eb..61cca65 100644
--- a/libraries/executor/src/main/java/org/qi4j/library/executor/ExecutorMixin.java
+++ b/libraries/executor/src/main/java/org/qi4j/library/executor/ExecutorMixin.java
@@ -14,26 +14,25 @@
 
 package org.qi4j.library.executor;
 
-import org.qi4j.api.service.Activatable;
-
 import java.util.concurrent.Executor;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
+import org.qi4j.api.service.ServiceActivation;
 
 /**
  * Delegate Runnable's to a ScheduledThreadPoolExecutor
  */
 public class ExecutorMixin
-    implements Executor, Activatable
+    implements Executor, ServiceActivation
 {
     private ExecutorService service;
 
-    public void activate() throws Exception
+    public void activateService() throws Exception
     {
         service = new ScheduledThreadPoolExecutor( 10 );
     }
 
-    public void passivate() throws Exception
+    public void passivateService() throws Exception
     {
         System.out.println( "Shutdown executors" );
         service.shutdown();

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/executor/src/main/java/org/qi4j/library/executor/ExecutorSideEffect.java
----------------------------------------------------------------------
diff --git a/libraries/executor/src/main/java/org/qi4j/library/executor/ExecutorSideEffect.java
b/libraries/executor/src/main/java/org/qi4j/library/executor/ExecutorSideEffect.java
index ea579c4..9f6be86 100644
--- a/libraries/executor/src/main/java/org/qi4j/library/executor/ExecutorSideEffect.java
+++ b/libraries/executor/src/main/java/org/qi4j/library/executor/ExecutorSideEffect.java
@@ -18,13 +18,13 @@ import org.qi4j.api.common.AppliesTo;
 import org.qi4j.api.injection.scope.Invocation;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
-import org.qi4j.api.object.ObjectBuilderFactory;
 import org.qi4j.api.sideeffect.GenericSideEffect;
 
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.concurrent.Executor;
+import org.qi4j.api.structure.Module;
 
 /**
  * JAVADOC
@@ -32,7 +32,7 @@ import java.util.concurrent.Executor;
 @AppliesTo( ExecuteSideEffect.class )
 public class ExecutorSideEffect extends GenericSideEffect
 {
-    @Structure ObjectBuilderFactory objectBuilderFactory;
+    @Structure Module module;
     @Service Executor executor;
 
     @Invocation ExecuteSideEffect execute;
@@ -63,7 +63,7 @@ public class ExecutorSideEffect extends GenericSideEffect
             {
                 try
                 {
-                    Object executed = objectBuilderFactory.newObject( execute.value() );
+                    Object executed = module.newObject( execute.value() );
                     runSideEffect( executed );
                 }
                 catch( InvocationTargetException e )

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/executor/src/test/java/org/qi4j/library/framework/executor/ExecuteSideEffectTest.java
----------------------------------------------------------------------
diff --git a/libraries/executor/src/test/java/org/qi4j/library/framework/executor/ExecuteSideEffectTest.java
b/libraries/executor/src/test/java/org/qi4j/library/framework/executor/ExecuteSideEffectTest.java
index 4522c9e..4e89593 100644
--- a/libraries/executor/src/test/java/org/qi4j/library/framework/executor/ExecuteSideEffectTest.java
+++ b/libraries/executor/src/test/java/org/qi4j/library/framework/executor/ExecuteSideEffectTest.java
@@ -27,16 +27,16 @@ public class ExecuteSideEffectTest
 
     public void assemble( ModuleAssembly module ) throws AssemblyException
     {
-        module.addTransients( TestComposite.class );
-        module.addObjects( LogCall.class );
-        module.addServices( ExecuteService.class ).instantiateOnStartup();
+        module.transients( TestComposite.class );
+        module.objects( LogCall.class );
+        module.services( ExecuteService.class ).instantiateOnStartup();
     }
 
     @Test
     public void givenMethodWithAnnotationWhenCallThenExecuteSideEffect()
         throws InterruptedException
     {
-        TestComposite instance = transientBuilderFactory.newTransient( TestComposite.class
);
+        TestComposite instance = module.newTransient( TestComposite.class );
         System.out.println( instance.doStuff() );
         latch.await();
         assertTrue( "doStuff sideeffect called", LogCall.methodsCalled.contains( "doStuff"
) );

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/ldap/server/src/main/java/org/qi4j/library/ldap/server/ApacheDirectoryServiceMixin.java
----------------------------------------------------------------------
diff --git a/libraries/ldap/server/src/main/java/org/qi4j/library/ldap/server/ApacheDirectoryServiceMixin.java
b/libraries/ldap/server/src/main/java/org/qi4j/library/ldap/server/ApacheDirectoryServiceMixin.java
index edb098a..d8b959f 100644
--- a/libraries/ldap/server/src/main/java/org/qi4j/library/ldap/server/ApacheDirectoryServiceMixin.java
+++ b/libraries/ldap/server/src/main/java/org/qi4j/library/ldap/server/ApacheDirectoryServiceMixin.java
@@ -29,11 +29,10 @@ import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.qi4j.api.configuration.Configuration;
 import org.qi4j.api.injection.scope.This;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.api.service.ServiceComposite;
+import org.qi4j.api.service.ServiceActivation;
 
 public class ApacheDirectoryServiceMixin
-    implements Activatable, Ldap
+    implements ServiceActivation, Ldap
 {
     @This private Configuration<LdapConfiguration> configuration;
 
@@ -48,7 +47,7 @@ public class ApacheDirectoryServiceMixin
         System.out.println( "Starting LDAP." );
     }
 
-    public void activate()
+    public void activateService()
         throws Exception
     {
         // Initialize the LDAP service
@@ -58,7 +57,7 @@ public class ApacheDirectoryServiceMixin
         service.getChangeLog().setEnabled( false );
 
 
-        LdapConfiguration conf = configuration.configuration();
+        LdapConfiguration conf = configuration.get();
         String partitionId = conf.partitionId().get();
         Partition partition = addPartition( partitionId, conf.partitionDn().get() );
 
@@ -87,11 +86,11 @@ public class ApacheDirectoryServiceMixin
 
     private String[] configAttributes()
     {
-        String attrs = configuration.configuration().indexAttributes().get();
+        String attrs = configuration.get().indexAttributes().get();
         return attrs.split( "," );
     }
 
-    public void passivate()
+    public void passivateService()
         throws Exception
     {
         running = false;

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/ldap/server/src/main/java/org/qi4j/library/ldap/server/LdapService.java
----------------------------------------------------------------------
diff --git a/libraries/ldap/server/src/main/java/org/qi4j/library/ldap/server/LdapService.java
b/libraries/ldap/server/src/main/java/org/qi4j/library/ldap/server/LdapService.java
index a740315..fceab2d 100644
--- a/libraries/ldap/server/src/main/java/org/qi4j/library/ldap/server/LdapService.java
+++ b/libraries/ldap/server/src/main/java/org/qi4j/library/ldap/server/LdapService.java
@@ -18,10 +18,10 @@
 
 package org.qi4j.library.ldap.server;
 
-import org.qi4j.api.service.ServiceComposite;
 import org.qi4j.api.mixin.Mixins;
+import org.qi4j.api.service.ServiceActivation;
 
 @Mixins( ApacheDirectoryServiceMixin.class )
-public interface LdapService extends Ldap, ServiceComposite
+public interface LdapService extends Ldap, ServiceActivation
 {
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/ldap/server/src/test/java/org/qi4j/library/ldap/server/LdapServerTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldap/server/src/test/java/org/qi4j/library/ldap/server/LdapServerTest.java
b/libraries/ldap/server/src/test/java/org/qi4j/library/ldap/server/LdapServerTest.java
index d843f29..2b808ee 100644
--- a/libraries/ldap/server/src/test/java/org/qi4j/library/ldap/server/LdapServerTest.java
+++ b/libraries/ldap/server/src/test/java/org/qi4j/library/ldap/server/LdapServerTest.java
@@ -30,8 +30,8 @@ public class LdapServerTest
     public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
-        module.addServices( LdapService.class ).instantiateOnStartup();
-        module.addEntities( LdapConfiguration.class );
+        module.services( LdapService.class ).instantiateOnStartup();
+        module.entities( LdapConfiguration.class );
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/rmi/src/test/java/org/qi4j/library/rmi/RMIMixinTest.java
----------------------------------------------------------------------
diff --git a/libraries/rmi/src/test/java/org/qi4j/library/rmi/RMIMixinTest.java b/libraries/rmi/src/test/java/org/qi4j/library/rmi/RMIMixinTest.java
index 11187d1..5eeb948 100644
--- a/libraries/rmi/src/test/java/org/qi4j/library/rmi/RMIMixinTest.java
+++ b/libraries/rmi/src/test/java/org/qi4j/library/rmi/RMIMixinTest.java
@@ -34,7 +34,7 @@ public class RMIMixinTest
     public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
-        module.addTransients( RemoteInterfaceComposite.class );
+        module.transients( RemoteInterfaceComposite.class );
     }
 
     @Test
@@ -47,7 +47,7 @@ public class RMIMixinTest
         Registry registry = LocateRegistry.createRegistry( 1099 );
         registry.rebind( RemoteInterface.class.getSimpleName(), stub );
 
-        RemoteInterface remote = transientBuilderFactory.newTransient( RemoteInterfaceComposite.class
);
+        RemoteInterface remote = module.newTransient( RemoteInterfaceComposite.class );
 
         // MethodCallExpression remote interface
         System.out.println( remote.foo( "Bar" ) );

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/thread/src/main/java/org/qi4j/library/thread/NewThreadServiceMixin.java
----------------------------------------------------------------------
diff --git a/libraries/thread/src/main/java/org/qi4j/library/thread/NewThreadServiceMixin.java
b/libraries/thread/src/main/java/org/qi4j/library/thread/NewThreadServiceMixin.java
index 6395007..00455d1 100644
--- a/libraries/thread/src/main/java/org/qi4j/library/thread/NewThreadServiceMixin.java
+++ b/libraries/thread/src/main/java/org/qi4j/library/thread/NewThreadServiceMixin.java
@@ -34,12 +34,12 @@ public class NewThreadServiceMixin
     {
         synchronized( this )
         {
-            Integer max = config.configuration().maxThreads().get();
+            Integer max = config.get().maxThreads().get();
             if( threadCount >= max )
             {
                 throw new MaximumThreadsException( max );
             }
-            ThreadServiceConfiguration configuration = config.configuration();
+            ThreadServiceConfiguration configuration = config.get();
             String name = configuration.threadBaseName().get() + sequence.newSequenceValue();
             String tgName = configuration.threadGroupName().get();
             ThreadGroup threadGroup = threadGroupService.getThreadGroup( tgName );
@@ -49,7 +49,7 @@ public class NewThreadServiceMixin
 
     public ThreadServiceConfiguration configuration()
     {
-        return config.configuration();
+        return config.get();
     }
 
     public class RunnableWrapper

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceComposite.java
----------------------------------------------------------------------
diff --git a/libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceComposite.java
b/libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceComposite.java
index de63839..e6c498e 100644
--- a/libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceComposite.java
+++ b/libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceComposite.java
@@ -18,9 +18,9 @@
 package org.qi4j.library.thread;
 
 import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.ServiceComposite;
+import org.qi4j.api.service.ServiceActivation;
 
 @Mixins( PooledThreadServiceMixin.class )
-public interface PooledThreadServiceComposite extends ThreadService, ServiceComposite
+public interface PooledThreadServiceComposite extends ThreadService, ServiceActivation
 {
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceMixin.java
----------------------------------------------------------------------
diff --git a/libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceMixin.java
b/libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceMixin.java
index f810e55..3c05bcf 100644
--- a/libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceMixin.java
+++ b/libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceMixin.java
@@ -17,16 +17,15 @@
  */
 package org.qi4j.library.thread;
 
+import java.util.LinkedList;
 import org.qi4j.api.configuration.Configuration;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.This;
-import org.qi4j.api.service.Activatable;
+import org.qi4j.api.service.ServiceActivation;
 import org.qi4j.library.uid.sequence.Sequencing;
 
-import java.util.LinkedList;
-
 public class PooledThreadServiceMixin
-    implements ThreadService, Activatable
+    implements ThreadService, ServiceActivation
 {
     @This private Configuration<ThreadServiceConfiguration> config;
     @Service private Sequencing sequence;
@@ -46,7 +45,7 @@ public class PooledThreadServiceMixin
         {
             if( pool.isEmpty() )
             {
-                Integer max = config.configuration().maxThreads().get();
+                Integer max = config.get().maxThreads().get();
                 if( threadCount >= max )
                 {
                     throw new MaximumThreadsException( max );
@@ -61,14 +60,14 @@ public class PooledThreadServiceMixin
 
     public ThreadServiceConfiguration configuration()
     {
-        return config.configuration();
+        return config.get();
     }
 
-    public void activate()
+    public void activateService()
         throws Exception
     {
         pool = new LinkedList<RunnableThread>();
-        int prefered = config.configuration().preferedNumberOfThreads().get();
+        int prefered = config.get().preferedNumberOfThreads().get();
         for( int i = 0; i < prefered; i++ )
         {
             createNewThread();
@@ -77,7 +76,7 @@ public class PooledThreadServiceMixin
 
     private void createNewThread()
     {
-        ThreadServiceConfiguration configuration = config.configuration();
+        ThreadServiceConfiguration configuration = config.get();
         String tgName = configuration.threadGroupName().get();
         ThreadGroup group = threadGroupService.getThreadGroup( tgName );
         String name = configuration.threadBaseName().get() + "-" + sequence.newSequenceValue();
@@ -89,7 +88,7 @@ public class PooledThreadServiceMixin
         pool.add( runnableThread );
     }
 
-    public void passivate()
+    public void passivateService()
         throws Exception
     {
         for( RunnableThread thread : pool )

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/thread/src/main/java/org/qi4j/library/thread/ThreadGroupServiceMixin.java
----------------------------------------------------------------------
diff --git a/libraries/thread/src/main/java/org/qi4j/library/thread/ThreadGroupServiceMixin.java
b/libraries/thread/src/main/java/org/qi4j/library/thread/ThreadGroupServiceMixin.java
index 07c0b24..88a9372 100644
--- a/libraries/thread/src/main/java/org/qi4j/library/thread/ThreadGroupServiceMixin.java
+++ b/libraries/thread/src/main/java/org/qi4j/library/thread/ThreadGroupServiceMixin.java
@@ -31,7 +31,7 @@ public class ThreadGroupServiceMixin
 
     public ThreadGroupServiceMixin( @This Configuration<ThreadGroupConfiguration> config
)
     {
-        ThreadGroupConfiguration configuration = config.configuration();
+        ThreadGroupConfiguration configuration = config.get();
         Property<String> rootName = configuration.rootGroupName();
         String name = rootName.get();
         groups = new HashMap<String, ThreadGroup>();

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/thread/src/main/java/org/qi4j/library/thread/assembly/NewThreadServiceAssembler.java
----------------------------------------------------------------------
diff --git a/libraries/thread/src/main/java/org/qi4j/library/thread/assembly/NewThreadServiceAssembler.java
b/libraries/thread/src/main/java/org/qi4j/library/thread/assembly/NewThreadServiceAssembler.java
index d63d3d8..e969a86 100644
--- a/libraries/thread/src/main/java/org/qi4j/library/thread/assembly/NewThreadServiceAssembler.java
+++ b/libraries/thread/src/main/java/org/qi4j/library/thread/assembly/NewThreadServiceAssembler.java
@@ -31,10 +31,10 @@ public class NewThreadServiceAssembler
 {
     public void assemble( ModuleAssembly module ) throws AssemblyException
     {
-        module.addServices( NewThreadServiceComposite.class );
-        module.addServices( ThreadGroupServiceComposite.class );
-        module.addEntities( ThreadServiceConfigurationEntity.class );
-        module.addEntities( ThreadGroupConfigurationEntity.class );
+        module.services( NewThreadServiceComposite.class );
+        module.services( ThreadGroupServiceComposite.class );
+        module.entities( ThreadServiceConfigurationEntity.class );
+        module.entities( ThreadGroupConfigurationEntity.class );
         new TransientSequencingAssembler().assemble( module );
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/thread/src/main/java/org/qi4j/library/thread/assembly/PooledThreadServiceAssembler.java
----------------------------------------------------------------------
diff --git a/libraries/thread/src/main/java/org/qi4j/library/thread/assembly/PooledThreadServiceAssembler.java
b/libraries/thread/src/main/java/org/qi4j/library/thread/assembly/PooledThreadServiceAssembler.java
index 52f0c9e..07131eb 100644
--- a/libraries/thread/src/main/java/org/qi4j/library/thread/assembly/PooledThreadServiceAssembler.java
+++ b/libraries/thread/src/main/java/org/qi4j/library/thread/assembly/PooledThreadServiceAssembler.java
@@ -32,10 +32,10 @@ public class PooledThreadServiceAssembler
     public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
-        module.addServices( PooledThreadServiceComposite.class );
-        module.addServices( ThreadGroupServiceComposite.class );
-        module.addEntities( ThreadServiceConfigurationEntity.class );
-        module.addEntities( ThreadGroupConfigurationEntity.class );
+        module.services( PooledThreadServiceComposite.class );
+        module.services( ThreadGroupServiceComposite.class );
+        module.entities( ThreadServiceConfigurationEntity.class );
+        module.entities( ThreadGroupConfigurationEntity.class );
         new TransientSequencingAssembler().assemble( module );
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/thread/src/test/java/org/qi4j/library/thread/NewThreadServiceTest.java
----------------------------------------------------------------------
diff --git a/libraries/thread/src/test/java/org/qi4j/library/thread/NewThreadServiceTest.java
b/libraries/thread/src/test/java/org/qi4j/library/thread/NewThreadServiceTest.java
index cdf7e93..52bd44b 100644
--- a/libraries/thread/src/test/java/org/qi4j/library/thread/NewThreadServiceTest.java
+++ b/libraries/thread/src/test/java/org/qi4j/library/thread/NewThreadServiceTest.java
@@ -18,24 +18,24 @@
 package org.qi4j.library.thread;
 
 import static org.junit.Assert.assertFalse;
+
 import org.junit.Test;
-import org.qi4j.api.composite.Composite;
 import org.qi4j.api.composite.TransientComposite;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.memory.MemoryEntityStoreService;
 import org.qi4j.library.thread.assembly.NewThreadServiceAssembler;
 import org.qi4j.test.AbstractQi4jTest;
+import org.qi4j.test.EntityTestAssembler;
 
 public class NewThreadServiceTest extends AbstractQi4jTest
 {
     public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
-        module.addTransients( UnderTestComposite.class );
-        module.addServices( MemoryEntityStoreService.class );
+        module.transients( UnderTestComposite.class );
+        new EntityTestAssembler().assemble( module );
         new NewThreadServiceAssembler().assemble( module );
     }
 
@@ -45,7 +45,7 @@ public class NewThreadServiceTest extends AbstractQi4jTest
     {
         TestRunnable r1 = new TestRunnable();
         TestRunnable r2 = new TestRunnable();
-        UnderTest underTest = transientBuilderFactory.newTransient( UnderTest.class );
+        UnderTest underTest = module.newTransient( UnderTest.class );
         Thread t1 = underTest.fetchThread( r1 );
         Thread t2 = underTest.fetchThread( r2 );
         assertFalse( t1.equals( t2 ) );

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/libraries/thread/src/test/java/org/qi4j/library/thread/PooledThreadServiceTest.java
----------------------------------------------------------------------
diff --git a/libraries/thread/src/test/java/org/qi4j/library/thread/PooledThreadServiceTest.java
b/libraries/thread/src/test/java/org/qi4j/library/thread/PooledThreadServiceTest.java
index 2358010..5637671 100644
--- a/libraries/thread/src/test/java/org/qi4j/library/thread/PooledThreadServiceTest.java
+++ b/libraries/thread/src/test/java/org/qi4j/library/thread/PooledThreadServiceTest.java
@@ -18,28 +18,29 @@
 package org.qi4j.library.thread;
 
 import org.junit.Assert;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+
 import org.junit.Test;
-import org.qi4j.api.composite.Composite;
 import org.qi4j.api.composite.TransientComposite;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.memory.MemoryEntityStoreService;
 import org.qi4j.library.thread.assembly.PooledThreadServiceAssembler;
 import org.qi4j.test.AbstractQi4jTest;
 
 import java.util.ArrayList;
+import org.qi4j.test.EntityTestAssembler;
 
 public class PooledThreadServiceTest extends AbstractQi4jTest
 {
     public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
-        module.addTransients( UnderTestComposite.class );
-        module.addServices( MemoryEntityStoreService.class );
+        module.transients( UnderTestComposite.class );
+        new EntityTestAssembler().assemble( module );
         new PooledThreadServiceAssembler().assemble( module );
     }
 
@@ -47,7 +48,7 @@ public class PooledThreadServiceTest extends AbstractQi4jTest
     public void whenUsingPooledThreadProviderThenSameThreadsAreHandedBack()
         throws Exception
     {
-        UnderTest underTest = transientBuilderFactory.newTransient( UnderTest.class );
+        UnderTest underTest = module.newTransient( UnderTest.class );
         ArrayList<Thread> threads = new ArrayList<Thread>();
         int poolsize = underTest.maxThreads();
         TestRunnable r1 = new TestRunnable();

http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/562f2ca3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0a5e4f2..3bce8a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
   </repositories>
 
   <properties>
-    <version.qi4j>1.4.1</version.qi4j>
+    <version.qi4j>2.0</version.qi4j>
   </properties>
 
   <dependencyManagement>


Mime
View raw message