polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [16/34] zest-java git commit: ZEST-136 - Massive changes to the Runtime, refactoring the Model and Instance relationship.
Date Thu, 14 Apr 2016 06:13:22 GMT
http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/extensions/valueserialization-stax/src/test/java/org/apache/zest/valueserialization/stax/StaxConfigurationDeserializationTest.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-stax/src/test/java/org/apache/zest/valueserialization/stax/StaxConfigurationDeserializationTest.java b/extensions/valueserialization-stax/src/test/java/org/apache/zest/valueserialization/stax/StaxConfigurationDeserializationTest.java
index 9e1c4df..9e166d5 100644
--- a/extensions/valueserialization-stax/src/test/java/org/apache/zest/valueserialization/stax/StaxConfigurationDeserializationTest.java
+++ b/extensions/valueserialization-stax/src/test/java/org/apache/zest/valueserialization/stax/StaxConfigurationDeserializationTest.java
@@ -46,7 +46,7 @@ public class StaxConfigurationDeserializationTest
     @Test
     public void serializeTest()
     {
-        ValueBuilder<ConfigSerializationConfig> builder = module.newValueBuilder( ConfigSerializationConfig.class );
+        ValueBuilder<ConfigSerializationConfig> builder = valueBuilderFactory.newValueBuilder( ConfigSerializationConfig.class );
         builder.prototype().name().set( "main" );
         builder.prototype().host().set( createHost() );
         builder.prototype().identity().set( "configtest" );
@@ -57,7 +57,7 @@ public class StaxConfigurationDeserializationTest
 
     private Host createHost()
     {
-        ValueBuilder<Host> builder = module.newValueBuilder( Host.class );
+        ValueBuilder<Host> builder = valueBuilderFactory.newValueBuilder( Host.class );
         builder.prototype().ip().set( "12.23.34.45" );
         builder.prototype().port().set( 1234 );
         return builder.newInstance();

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmHistoryImplTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmHistoryImplTest.java b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmHistoryImplTest.java
index 2589ed0..61e9e49 100644
--- a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmHistoryImplTest.java
+++ b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmHistoryImplTest.java
@@ -283,14 +283,14 @@ public class AlarmHistoryImplTest
 
     private AlarmPoint createAlarm( String name )
     {
-        ServiceReference<AlarmSystem> ref = module.findService( AlarmSystem.class );
+        ServiceReference<AlarmSystem> ref = serviceFinder.findService( AlarmSystem.class );
         alarmSystem = ref.get();
         return alarmSystem.createAlarm( name, createCategory( "AlarmHistoryTest" ) );
     }
 
     private AlarmCategory createCategory( String name )
     {
-        ValueBuilder<AlarmCategory> builder = module.newValueBuilder( AlarmCategory.class );
+        ValueBuilder<AlarmCategory> builder = valueBuilderFactory.newValueBuilder( AlarmCategory.class );
         builder.prototype().name().set( name );
         return builder.newInstance();
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmPointImplTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmPointImplTest.java b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmPointImplTest.java
index fd79250..1b3c1fc 100644
--- a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmPointImplTest.java
+++ b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmPointImplTest.java
@@ -224,14 +224,14 @@ public class AlarmPointImplTest extends AbstractZestTest
 
     private AlarmPoint createAlarm( String name )
     {
-        ServiceReference<AlarmSystem> ref = module.findService( AlarmSystem.class );
+        ServiceReference<AlarmSystem> ref = serviceFinder.findService( AlarmSystem.class );
         alarmSystem = ref.get();
         return alarmSystem.createAlarm( name, createCategory( "AlarmPointImplTest" ) );
     }
 
     private AlarmCategory createCategory( String name )
     {
-        ValueBuilder<AlarmCategory> builder = module.newValueBuilder( AlarmCategory.class );
+        ValueBuilder<AlarmCategory> builder = valueBuilderFactory.newValueBuilder( AlarmCategory.class );
         builder.prototype().name().set( name );
         return builder.newInstance();
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmServiceTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmServiceTest.java b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmServiceTest.java
index e1d6ea0..3c9663a 100644
--- a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmServiceTest.java
+++ b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/AlarmServiceTest.java
@@ -85,7 +85,7 @@ public class AlarmServiceTest
     @Test
     public void testGetAlarmModels()
     {
-        AlarmSystem alarmService = (AlarmSystem) module.findService( AlarmSystem.class ).get();
+        AlarmSystem alarmService = (AlarmSystem) serviceFinder.findService( AlarmSystem.class ).get();
         List<AlarmModelDescriptor> models = alarmService.alarmModels();
         assertNotNull( models );
         assertEquals( 2, models.size() );
@@ -95,7 +95,7 @@ public class AlarmServiceTest
     public void testDefaultModel()
         throws Exception
     {
-        AlarmSystem alarmService = (AlarmSystem) module.findService( AlarmSystem.class ).get();
+        AlarmSystem alarmService = (AlarmSystem) serviceFinder.findService( AlarmSystem.class ).get();
         List<AlarmModelDescriptor> models = alarmService.alarmModels();
         assertNotNull( models );
         assertEquals( 2, models.size() );
@@ -108,7 +108,7 @@ public class AlarmServiceTest
     public void testListeners()
         throws Exception
     {
-        AlarmSystem alarmService = (AlarmSystem) module.findService( AlarmSystem.class ).get();
+        AlarmSystem alarmService = (AlarmSystem) serviceFinder.findService( AlarmSystem.class ).get();
         AlarmPoint alarm = alarmService.createAlarm( "TestAlarm", createCategory("AlarmServiceTest") );
 
         CountingListener listener1 = new CountingListener();
@@ -175,7 +175,7 @@ public class AlarmServiceTest
 
     private AlarmCategory createCategory( String name )
     {
-        ValueBuilder<AlarmCategory> builder = module.newValueBuilder( AlarmCategory.class );
+        ValueBuilder<AlarmCategory> builder = valueBuilderFactory.newValueBuilder( AlarmCategory.class );
         builder.prototype().name().set( name );
         return builder.newInstance();
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/alarm/src/test/java/org/apache/zest/library/alarm/ExtendedAlarmModelTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/ExtendedAlarmModelTest.java b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/ExtendedAlarmModelTest.java
index 0df9255..159c5af 100644
--- a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/ExtendedAlarmModelTest.java
+++ b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/ExtendedAlarmModelTest.java
@@ -86,7 +86,7 @@ public class ExtendedAlarmModelTest
     public void testDescription()
         throws Exception
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         boolean test1 = provider.modelDescription().toLowerCase().contains( "normal" );
         boolean test2 = provider.modelDescription().toLowerCase().contains( "activated" );
         boolean test3 = provider.modelDescription().toLowerCase().contains( "deactivated" );
@@ -119,7 +119,7 @@ public class ExtendedAlarmModelTest
     public void testTriggers()
         throws Exception
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint underTest = createAlarm( "Test AlarmPoint" );
         List<String> triggers = provider.alarmTriggers();
         assertEquals( 7, triggers.size() );
@@ -163,7 +163,7 @@ public class ExtendedAlarmModelTest
     public void testStateChangeFromNormal()
         throws Exception
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         AlarmEvent event1 = provider.evaluate( alarm, AlarmPoint.TRIGGER_ACTIVATE );
         assertEquals( AlarmPoint.EVENT_ACTIVATION, event1.systemName().get() );
@@ -197,7 +197,7 @@ public class ExtendedAlarmModelTest
     public void testStateChangeFromActivated()
         throws Exception
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
 
@@ -239,7 +239,7 @@ public class ExtendedAlarmModelTest
     public void testStateChangeFromAcknowledged()
         throws Exception
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
         alarm.acknowledge();
@@ -288,7 +288,7 @@ public class ExtendedAlarmModelTest
     public void testStateChangeFromDeactivated()
         throws Exception
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
         alarm.deactivate();
@@ -336,7 +336,7 @@ public class ExtendedAlarmModelTest
     public void testStateChangeFromBlocked()
         throws Exception
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
         alarm.trigger( "block" );
@@ -384,7 +384,7 @@ public class ExtendedAlarmModelTest
     public void testStateChangeFromDisabled()
         throws Exception
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
         alarm.trigger( "disable" );
@@ -434,7 +434,7 @@ public class ExtendedAlarmModelTest
     {
         try
         {
-            AlarmModel provider = module.findService( AlarmModel.class ).get();
+            AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
             AlarmPoint underTest = createAlarm( "Test AlarmPoint" );
             provider.evaluate( underTest, "my-trigger" );
             fail( "IllegalArgumentException not thrown." );
@@ -844,7 +844,7 @@ public class ExtendedAlarmModelTest
     public void testComputeCondition()
         throws Exception
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus s1 = createStatus( AlarmPoint.STATUS_NORMAL );
         assertFalse( provider.computeCondition( s1 ) );
         AlarmStatus s2 = createStatus( AlarmPoint.STATUS_ACTIVATED );
@@ -866,7 +866,7 @@ public class ExtendedAlarmModelTest
     public void testComputeTriggerNormal()
         throws Exception
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus status = createStatus( AlarmPoint.STATUS_NORMAL );
         String trigger1 = provider.computeTrigger( status, true );
         String trigger2 = provider.computeTrigger( status, false );
@@ -877,7 +877,7 @@ public class ExtendedAlarmModelTest
     @Test
     public void testComputeTriggerActivated()
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus status = createStatus( AlarmPoint.STATUS_ACTIVATED );
         String trigger1 = provider.computeTrigger( status, true );
         String trigger2 = provider.computeTrigger( status, false );
@@ -888,7 +888,7 @@ public class ExtendedAlarmModelTest
     @Test
     public void testComputeTRiggerDeactivated()
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus status = createStatus( AlarmPoint.STATUS_DEACTIVATED );
         String trigger1 = provider.computeTrigger( status, true );
         String trigger2 = provider.computeTrigger( status, false );
@@ -899,7 +899,7 @@ public class ExtendedAlarmModelTest
     @Test
     public void testComputeTriggerAcknowledged()
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus status = createStatus( AlarmPoint.STATUS_ACKNOWLEDGED );
         String trigger1 = provider.computeTrigger( status, true );
         String trigger2 = provider.computeTrigger( status, false );
@@ -910,7 +910,7 @@ public class ExtendedAlarmModelTest
     @Test
     public void testComputeTriggerReactivated()
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus status = createStatus( AlarmPoint.STATUS_REACTIVATED );
         String trigger1 = provider.computeTrigger( status, true );
         String trigger2 = provider.computeTrigger( status, false );
@@ -921,7 +921,7 @@ public class ExtendedAlarmModelTest
     @Test
     public void testComputeTriggerBlocked()
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus status = createStatus( AlarmPoint.STATUS_BLOCKED );
         String trigger1 = provider.computeTrigger( status, true );
         String trigger2 = provider.computeTrigger( status, false );
@@ -932,7 +932,7 @@ public class ExtendedAlarmModelTest
     @Test
     public void testComputeTriggerDisabled()
     {
-        AlarmModel provider = module.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus status = createStatus( AlarmPoint.STATUS_DISABLED );
         String trigger1 = provider.computeTrigger( status, true );
         String trigger2 = provider.computeTrigger( status, false );
@@ -954,7 +954,7 @@ public class ExtendedAlarmModelTest
 
     private AlarmCategory createCategory( String name )
     {
-        ValueBuilder<AlarmCategory> builder = module.newValueBuilder( AlarmCategory.class );
+        ValueBuilder<AlarmCategory> builder = valueBuilderFactory.newValueBuilder( AlarmCategory.class );
         builder.prototype().name().set( name );
         return builder.newInstance();
     }
@@ -967,7 +967,7 @@ public class ExtendedAlarmModelTest
 
     private AlarmStatus createStatus( String status )
     {
-        ValueBuilder<AlarmStatus> builder = module.newValueBuilder( AlarmStatus.class );
+        ValueBuilder<AlarmStatus> builder = valueBuilderFactory.newValueBuilder( AlarmStatus.class );
         AlarmStatus.State statePrototype = builder.prototypeFor( AlarmStatus.State.class );
         statePrototype.name().set( status );
         statePrototype.creationDate().set( new Date() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/alarm/src/test/java/org/apache/zest/library/alarm/SimpleAlarmModelTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/SimpleAlarmModelTest.java b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/SimpleAlarmModelTest.java
index 78ff217..9120110 100644
--- a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/SimpleAlarmModelTest.java
+++ b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/SimpleAlarmModelTest.java
@@ -113,7 +113,7 @@ public class SimpleAlarmModelTest
     public void testTriggers()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint underTest = createAlarm( "Test AlarmPoint" );
         List<String> triggers = provider.alarmTriggers();
         assertEquals( 2, triggers.size() );
@@ -157,7 +157,7 @@ public class SimpleAlarmModelTest
     public void testStateChangeFromNormal()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         AlarmEvent event1 = provider.evaluate( alarm, AlarmPoint.TRIGGER_ACTIVATE );
         assertEquals( AlarmPoint.EVENT_ACTIVATION, event1.systemName().get() );
@@ -183,7 +183,7 @@ public class SimpleAlarmModelTest
     public void testStateChangeFromActivated()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
 
@@ -202,7 +202,7 @@ public class SimpleAlarmModelTest
     {
         try
         {
-            AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+            AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
             AlarmPoint underTest = createAlarm( "Test AlarmPoint" );
             provider.evaluate( underTest, "my-trigger" );
             fail( "IllegalArgumentException not thrown." );
@@ -301,7 +301,7 @@ public class SimpleAlarmModelTest
     public void testComputeCondition()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus s1 = createStatus( AlarmPoint.STATUS_NORMAL );
         assertFalse( provider.computeCondition( s1 ) );
         AlarmStatus s2 = createStatus( AlarmPoint.STATUS_ACTIVATED );
@@ -312,7 +312,7 @@ public class SimpleAlarmModelTest
     public void testComputeTrigger()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus s1 = createStatus( AlarmPoint.STATUS_NORMAL );
         AlarmStatus s2 = createStatus( AlarmPoint.STATUS_ACTIVATED );
         String trigger1 = provider.computeTrigger( s1, true );
@@ -339,7 +339,7 @@ public class SimpleAlarmModelTest
 
     private AlarmCategory createCategory( String name )
     {
-        ValueBuilder<AlarmCategory> builder = module.newValueBuilder( AlarmCategory.class );
+        ValueBuilder<AlarmCategory> builder = valueBuilderFactory.newValueBuilder( AlarmCategory.class );
         builder.prototype().name().set( name );
         return builder.newInstance();
     }
@@ -352,7 +352,7 @@ public class SimpleAlarmModelTest
 
     private AlarmStatus createStatus( String status )
     {
-        ValueBuilder<AlarmStatus> builder = module.newValueBuilder( AlarmStatus.class );
+        ValueBuilder<AlarmStatus> builder = valueBuilderFactory.newValueBuilder( AlarmStatus.class );
         AlarmStatus.State statePrototype = builder.prototypeFor( AlarmStatus.State.class );
         statePrototype.name().set( status );
         statePrototype.creationDate().set( new Date() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/alarm/src/test/java/org/apache/zest/library/alarm/StandardAlarmModelTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/StandardAlarmModelTest.java b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/StandardAlarmModelTest.java
index 84d10b6..9a6539e 100644
--- a/libraries/alarm/src/test/java/org/apache/zest/library/alarm/StandardAlarmModelTest.java
+++ b/libraries/alarm/src/test/java/org/apache/zest/library/alarm/StandardAlarmModelTest.java
@@ -120,7 +120,7 @@ public class StandardAlarmModelTest
     public void testTriggers()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint underTest = createAlarm( "Test AlarmPoint" );
         List<String> triggers = provider.alarmTriggers();
         assertEquals( 3, triggers.size() );
@@ -164,7 +164,7 @@ public class StandardAlarmModelTest
     public void testStateChangeFromNormal()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         AlarmEvent event1 = provider.evaluate( alarm, AlarmPoint.TRIGGER_ACTIVATE );
         assertEquals( AlarmPoint.EVENT_ACTIVATION, event1.systemName().get() );
@@ -182,7 +182,7 @@ public class StandardAlarmModelTest
     public void testStateChangeFromActivated()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
 
@@ -204,7 +204,7 @@ public class StandardAlarmModelTest
     public void testStateChangeFromAcknowledged()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
         alarm.acknowledge();
@@ -229,7 +229,7 @@ public class StandardAlarmModelTest
     public void testStateChangeFromDeactivated()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
         alarm.deactivate();
@@ -255,7 +255,7 @@ public class StandardAlarmModelTest
     {
         try
         {
-            AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+            AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
             AlarmPoint underTest = createAlarm( "Test AlarmPoint" );
             provider.evaluate( underTest, "my-trigger" );
             fail( "IllegalArgumentException not thrown." );
@@ -413,7 +413,7 @@ public class StandardAlarmModelTest
     public void testComputeCondition()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus s1 = createStatus( AlarmPoint.STATUS_NORMAL );
         assertFalse( provider.computeCondition( s1 ) );
         AlarmStatus s2 = createStatus( AlarmPoint.STATUS_ACTIVATED );
@@ -428,7 +428,7 @@ public class StandardAlarmModelTest
     public void testComputeTrigger()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) module.findService( AlarmModel.class ).get();
+        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus s1 = createStatus( AlarmPoint.STATUS_NORMAL );
         AlarmStatus s2 = createStatus( AlarmPoint.STATUS_ACTIVATED );
         AlarmStatus s3 = createStatus( AlarmPoint.STATUS_DEACTIVATED );
@@ -465,7 +465,7 @@ public class StandardAlarmModelTest
 
     private AlarmCategory createCategory( String name )
     {
-        ValueBuilder<AlarmCategory> builder = module.newValueBuilder( AlarmCategory.class );
+        ValueBuilder<AlarmCategory> builder = valueBuilderFactory.newValueBuilder( AlarmCategory.class );
         builder.prototype().name().set( name );
         return builder.newInstance();
     }
@@ -478,7 +478,7 @@ public class StandardAlarmModelTest
 
     private AlarmStatus createStatus( String status )
     {
-        ValueBuilder<AlarmStatus> builder = module.newValueBuilder( AlarmStatus.class );
+        ValueBuilder<AlarmStatus> builder = valueBuilderFactory.newValueBuilder( AlarmStatus.class );
         AlarmStatus.State statePrototype = builder.prototypeFor( AlarmStatus.State.class );
         statePrototype.name().set( status );
         statePrototype.creationDate().set( new Date() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/circuitbreaker/src/test/java/org/apache/zest/library/circuitbreaker/BreaksCircuitOnThrowableTest.java
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/src/test/java/org/apache/zest/library/circuitbreaker/BreaksCircuitOnThrowableTest.java b/libraries/circuitbreaker/src/test/java/org/apache/zest/library/circuitbreaker/BreaksCircuitOnThrowableTest.java
index e08678c..df19cbf 100644
--- a/libraries/circuitbreaker/src/test/java/org/apache/zest/library/circuitbreaker/BreaksCircuitOnThrowableTest.java
+++ b/libraries/circuitbreaker/src/test/java/org/apache/zest/library/circuitbreaker/BreaksCircuitOnThrowableTest.java
@@ -45,7 +45,7 @@ public class BreaksCircuitOnThrowableTest
     @Test
     public void testSuccess()
     {
-        TestService service = ( TestService ) module.findService( TestService.class ).get();
+        TestService service = ( TestService ) serviceFinder.findService( TestService.class ).get();
         service.successfulMethod();
         service.successfulMethod();
         service.successfulMethod();
@@ -54,7 +54,7 @@ public class BreaksCircuitOnThrowableTest
     @Test
     public void testThrowable()
     {
-        ServiceReference<TestService> serviceReference = module.findService( TestService.class );
+        ServiceReference<TestService> serviceReference = serviceFinder.findService( TestService.class );
         TestService service = serviceReference.get();
         try {
             service.throwingMethod();

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/constraints/src/test/java/org/apache/zest/library/constraints/ConstraintTest.java
----------------------------------------------------------------------
diff --git a/libraries/constraints/src/test/java/org/apache/zest/library/constraints/ConstraintTest.java b/libraries/constraints/src/test/java/org/apache/zest/library/constraints/ConstraintTest.java
index 2072b06..e7dea60 100644
--- a/libraries/constraints/src/test/java/org/apache/zest/library/constraints/ConstraintTest.java
+++ b/libraries/constraints/src/test/java/org/apache/zest/library/constraints/ConstraintTest.java
@@ -38,7 +38,7 @@ public class ConstraintTest
     @Test( expected = ConstraintViolationException.class )
     public void testContainsFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().containsString().set( "bar" );
     }
@@ -46,7 +46,7 @@ public class ConstraintTest
     @Test
     public void testContainsOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().containsString().set( "foo" );
         cb.prototype().containsString().set( "xxxfooyyy" );
@@ -55,7 +55,7 @@ public class ConstraintTest
     @Test( expected = ConstraintViolationException.class )
     public void testEmailFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().email().set( "foo.com" );
     }
@@ -63,7 +63,7 @@ public class ConstraintTest
     @Test
     public void testEmailOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().email().set( "rickard@gmail.com" );
     }
@@ -71,35 +71,35 @@ public class ConstraintTest
     @Test( expected = ConstraintViolationException.class )
     public void testURLFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
         cb.prototype().url().set( "this is no url" );
     }
 
     @Test
     public void testURLOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
         cb.prototype().url().set( "http://zest.apache.org/path?query=string#fragment" );
     }
 
     @Test( expected = ConstraintViolationException.class )
     public void testURIFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
         cb.prototype().uri().set( "" );
     }
 
     @Test
     public void testURIOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
         cb.prototype().uri().set( "http://zest.apache.org/path?query=string#fragment" );
     }
 
     @Test( expected = ConstraintViolationException.class )
     public void testGreaterThanFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().greaterThan().set( 10 );
     }
@@ -107,7 +107,7 @@ public class ConstraintTest
     @Test
     public void testGreaterThanOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().greaterThan().set( 11 );
     }
@@ -115,7 +115,7 @@ public class ConstraintTest
     @Test( expected = ConstraintViolationException.class )
     public void testInstanceOfFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().instanceOf().set( new HashSet() );
     }
@@ -123,7 +123,7 @@ public class ConstraintTest
     @Test
     public void testInstanceOfOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().instanceOf().set( new ArrayList() );
     }
@@ -131,7 +131,7 @@ public class ConstraintTest
     @Test( expected = ConstraintViolationException.class )
     public void testLessThanFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().lessThan().set( 10 );
     }
@@ -139,7 +139,7 @@ public class ConstraintTest
     @Test
     public void testLessThanOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().lessThan().set( 9 );
     }
@@ -147,7 +147,7 @@ public class ConstraintTest
     @Test( expected = ConstraintViolationException.class )
     public void testMatchesFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().matches().set( "cba" );
     }
@@ -155,7 +155,7 @@ public class ConstraintTest
     @Test
     public void testMatchesOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().matches().set( "abbccc" );
     }
@@ -163,7 +163,7 @@ public class ConstraintTest
     @Test( expected = ConstraintViolationException.class )
     public void testMaxLengthFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().maxLength().set( "xxxxx" );
     }
@@ -171,7 +171,7 @@ public class ConstraintTest
     @Test
     public void testMaxLengthOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().maxLength().set( "xxx" );
     }
@@ -179,7 +179,7 @@ public class ConstraintTest
     @Test( expected = ConstraintViolationException.class )
     public void testMinLengthFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().minLength().set( "xx" );
     }
@@ -187,7 +187,7 @@ public class ConstraintTest
     @Test
     public void testMinLengthOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().minLength().set( "xxx" );
     }
@@ -195,7 +195,7 @@ public class ConstraintTest
     @Test
     public void testNotEmptyFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
         try
         {
             cb.prototype().notEmptyString().set( "" );
@@ -227,7 +227,7 @@ public class ConstraintTest
     @Test
     public void testNotEmptyOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
         cb.prototype().notEmptyString().set( "X" );
         cb.prototype().notEmptyCollection().set( Arrays.asList( "X" ) );
         cb.prototype().notEmptyList().set( Arrays.asList( "X" ) );
@@ -236,7 +236,7 @@ public class ConstraintTest
     @Test( expected = ConstraintViolationException.class )
     public void testOneOfFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().oneOf().set( "Foo" );
     }
@@ -244,7 +244,7 @@ public class ConstraintTest
     @Test
     public void testOneOfOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().oneOf().set( "Bar" );
     }
@@ -252,7 +252,7 @@ public class ConstraintTest
     @Test( expected = ConstraintViolationException.class )
     public void testRangeFail()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().range().set( 101 );
     }
@@ -260,7 +260,7 @@ public class ConstraintTest
     @Test
     public void testRangeOk()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
 
         cb.prototype().range().set( 0 );
         cb.prototype().range().set( 50 );
@@ -270,7 +270,7 @@ public class ConstraintTest
     @Test
     public void testMethodParameters()
     {
-        TransientBuilder<TestCaseComposite> cb = module.newTransientBuilder( TestCaseComposite.class );
+        TransientBuilder<TestCaseComposite> cb = transientBuilderFactory.newTransientBuilder( TestCaseComposite.class );
         cb.prototype().testParameters( 15 );
     }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/constraints/src/test/java/org/apache/zest/library/constraints/qi70/IssueTest.java
----------------------------------------------------------------------
diff --git a/libraries/constraints/src/test/java/org/apache/zest/library/constraints/qi70/IssueTest.java b/libraries/constraints/src/test/java/org/apache/zest/library/constraints/qi70/IssueTest.java
index 4f98467..60331c4 100644
--- a/libraries/constraints/src/test/java/org/apache/zest/library/constraints/qi70/IssueTest.java
+++ b/libraries/constraints/src/test/java/org/apache/zest/library/constraints/qi70/IssueTest.java
@@ -38,7 +38,7 @@ public class IssueTest
     @Test( expected = ConstraintViolationException.class )
     public void testNotEmpty()
     {
-        TransientBuilder<Sample> cb = module.newTransientBuilder( Sample.class );
+        TransientBuilder<Sample> cb = transientBuilderFactory.newTransientBuilder( Sample.class );
         cb.prototypeFor( Sample.class ).stuff().set( null );
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/conversion/src/main/java/org/apache/zest/library/conversion/values/EntityToValue.java
----------------------------------------------------------------------
diff --git a/libraries/conversion/src/main/java/org/apache/zest/library/conversion/values/EntityToValue.java b/libraries/conversion/src/main/java/org/apache/zest/library/conversion/values/EntityToValue.java
index 72dc033..530efe7 100644
--- a/libraries/conversion/src/main/java/org/apache/zest/library/conversion/values/EntityToValue.java
+++ b/libraries/conversion/src/main/java/org/apache/zest/library/conversion/values/EntityToValue.java
@@ -152,7 +152,7 @@ public interface EntityToValue
 
         private <T> ValueBuilder<?> doConversion( final Class<T> valueType, Object entity )
         {
-            ValueDescriptor valueDescriptor = module.valueDescriptor( valueType.getName() );
+            ValueDescriptor valueDescriptor = module.descriptor().valueDescriptor( valueType.getName() );
             if( valueDescriptor == null )
             {
                 throw new NoSuchValueException( valueType.getName(), module.name() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/conversion/src/main/java/org/apache/zest/library/conversion/values/ValueToEntityMixin.java
----------------------------------------------------------------------
diff --git a/libraries/conversion/src/main/java/org/apache/zest/library/conversion/values/ValueToEntityMixin.java b/libraries/conversion/src/main/java/org/apache/zest/library/conversion/values/ValueToEntityMixin.java
index 02eeb15..9ba478e 100644
--- a/libraries/conversion/src/main/java/org/apache/zest/library/conversion/values/ValueToEntityMixin.java
+++ b/libraries/conversion/src/main/java/org/apache/zest/library/conversion/values/ValueToEntityMixin.java
@@ -37,6 +37,7 @@ import org.apache.zest.api.entity.EntityReference;
 import org.apache.zest.api.entity.Identity;
 import org.apache.zest.api.injection.scope.Structure;
 import org.apache.zest.api.property.PropertyDescriptor;
+import org.apache.zest.api.structure.ModuleDescriptor;
 import org.apache.zest.api.unitofwork.EntityTypeNotFoundException;
 import org.apache.zest.api.unitofwork.NoSuchEntityException;
 import org.apache.zest.api.unitofwork.UnitOfWorkFactory;
@@ -44,8 +45,6 @@ import org.apache.zest.api.value.ValueComposite;
 import org.apache.zest.api.value.ValueDescriptor;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.spi.ZestSPI;
-import org.apache.zest.spi.structure.ModelModule;
-import org.apache.zest.spi.module.ModuleSpi;
 
 import static org.apache.zest.library.conversion.values.Shared.STRING_COLLECTION_TYPE_SPEC;
 import static org.apache.zest.library.conversion.values.Shared.STRING_MAP_TYPE_SPEC;
@@ -129,7 +128,7 @@ public class ValueToEntityMixin
     private UnitOfWorkFactory uowf;
 
     @Structure
-    private ModuleSpi module;
+    private ModuleDescriptor module;
 
     @Override
     public <T> T create( Class<T> entityType, Object value )
@@ -187,11 +186,7 @@ public class ValueToEntityMixin
         EntityDescriptor eDesc = module.entityDescriptor( entityType.getName() );
         if( eDesc == null )
         {
-            throw new EntityTypeNotFoundException( entityType.getName(),
-                                                   module.name(),
-                                                   module.findVisibleEntityTypes()
-                                                       .map( ModelModule.toStringFunction )
-            );
+            throw EntityTypeNotFoundException.create( entityType.getName(), module );
         }
 
         ValueComposite vComposite = (ValueComposite) value;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/EntityToValueTest.java
----------------------------------------------------------------------
diff --git a/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/EntityToValueTest.java b/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/EntityToValueTest.java
index b268a62..8fae092 100644
--- a/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/EntityToValueTest.java
+++ b/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/EntityToValueTest.java
@@ -68,7 +68,7 @@ public class EntityToValueTest
             PersonEntity entity = setupPersonEntities( uow );
 
             // START SNIPPET: conversion
-            EntityToValueService conversion = module.findService( EntityToValueService.class ).get();
+            EntityToValueService conversion = serviceFinder.findService( EntityToValueService.class ).get();
             PersonValue value = conversion.convert( PersonValue.class, entity );
             // END SNIPPET: conversion
             assertEquals( "Niclas", value.firstName().get() );
@@ -92,7 +92,7 @@ public class EntityToValueTest
         {
             PersonEntity niclas = setupPersonEntities( uow );
 
-            ServiceReference<EntityToValueService> reference = module.findService( EntityToValueService.class );
+            ServiceReference<EntityToValueService> reference = serviceFinder.findService( EntityToValueService.class );
             EntityToValueService service = reference.get();
 
             PersonValue2 niclasValue = service.convert( PersonValue2.class, niclas );
@@ -117,7 +117,7 @@ public class EntityToValueTest
         {
             PersonEntity niclas = setupPersonEntities( uow );
 
-            ServiceReference<EntityToValueService> reference = module.findService( EntityToValueService.class );
+            ServiceReference<EntityToValueService> reference = serviceFinder.findService( EntityToValueService.class );
             EntityToValueService service = reference.get();
 
             PersonValue3 niclasValue = service.convert( PersonValue3.class, niclas );
@@ -142,7 +142,7 @@ public class EntityToValueTest
         {
             PersonEntity niclas = setupPersonEntities( uow );
 
-            ServiceReference<EntityToValueService> reference = module.findService( EntityToValueService.class );
+            ServiceReference<EntityToValueService> reference = serviceFinder.findService( EntityToValueService.class );
             EntityToValueService service = reference.get();
 
             PersonValue4 niclasValue = service.convert( PersonValue4.class, niclas );
@@ -164,7 +164,7 @@ public class EntityToValueTest
             PersonEntity entity = setupPersonEntities( uow );
 
             // START SNIPPET: prototypeOpportunity
-            EntityToValueService conversion = module.findService( EntityToValueService.class ).get();
+            EntityToValueService conversion = serviceFinder.findService( EntityToValueService.class ).get();
             PersonValue value = conversion.convert( PersonValue.class, entity, new Function<PersonValue, PersonValue>()
             {
                 @Override

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/NestedValuesConversionTest.java
----------------------------------------------------------------------
diff --git a/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/NestedValuesConversionTest.java b/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/NestedValuesConversionTest.java
index 4e8a087..388450d 100644
--- a/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/NestedValuesConversionTest.java
+++ b/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/NestedValuesConversionTest.java
@@ -56,7 +56,7 @@ public class NestedValuesConversionTest
         try
         {
             FooEntity fooEntity = createFooEntity( uow, "Test nested values conversion" );
-            EntityToValueService conversion = module.findService( EntityToValueService.class ).get();
+            EntityToValueService conversion = serviceFinder.findService( EntityToValueService.class ).get();
             FooValue fooValue = conversion.convert( FooValue.class, fooEntity );
             assertThat( fooValue.name().get(), equalTo( "Test nested values conversion" ) );
             assertThat( fooValue.bar().get().bazar().get(), equalTo( "single" ) );
@@ -91,7 +91,7 @@ public class NestedValuesConversionTest
 
     private BarValue createBarValue( String bazar )
     {
-        ValueBuilder<BarValue> builder = module.newValueBuilder( BarValue.class );
+        ValueBuilder<BarValue> builder = valueBuilderFactory.newValueBuilder( BarValue.class );
         builder.prototype().bazar().set( bazar );
         return builder.newInstance();
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/ValueToEntityTest.java
----------------------------------------------------------------------
diff --git a/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/ValueToEntityTest.java b/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/ValueToEntityTest.java
index 0441b84..f4a3ba0 100644
--- a/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/ValueToEntityTest.java
+++ b/libraries/conversion/src/test/java/org/apache/zest/library/conversion/values/ValueToEntityTest.java
@@ -89,7 +89,7 @@ public class ValueToEntityTest
     public void givenQualifiedValueWhenCreatingEntityExpectCorrectEntity()
         throws UnitOfWorkCompletionException
     {
-        ValueBuilder<PersonValue> builder = module.newValueBuilder( PersonValue.class );
+        ValueBuilder<PersonValue> builder = valueBuilderFactory.newValueBuilder( PersonValue.class );
         builder.prototype().firstName().set( "Ed" );
         builder.prototype().lastName().set( "Flintstone" );
         builder.prototype().dateOfBirth().set( someBirthDate );
@@ -99,7 +99,7 @@ public class ValueToEntityTest
         try( UnitOfWork uow = uowf.newUnitOfWork( newUsecase( "CreatingEntityFromQualifiedValue" ) ) )
         {
             // START SNIPPET: creation
-            ValueToEntity conversion = module.findService( ValueToEntity.class ).get();
+            ValueToEntity conversion = serviceFinder.findService( ValueToEntity.class ).get();
             PersonEntity edEntity = conversion.create( PersonEntity.class, edValue );
             // END SNIPPET: creation
             assertThat( edEntity.firstName(), equalTo( "Ed" ) );
@@ -122,7 +122,7 @@ public class ValueToEntityTest
     public void givenUnqualifiedValueWhenCreatingEntityExpectCorrectEntity()
         throws UnitOfWorkCompletionException
     {
-        ValueBuilder<PersonValue2> builder = module.newValueBuilder( PersonValue2.class );
+        ValueBuilder<PersonValue2> builder = valueBuilderFactory.newValueBuilder( PersonValue2.class );
         builder.prototype().firstName().set( "Ed" );
         builder.prototype().lastName().set( "Flintstone" );
         builder.prototype().dateOfBirth().set( someBirthDate );
@@ -131,7 +131,7 @@ public class ValueToEntityTest
         PersonValue2 edValue = builder.newInstance();
         try( UnitOfWork uow = uowf.newUnitOfWork( newUsecase( "CreatingEntityFromUnqualifiedValue" ) ) )
         {
-            ValueToEntity conversion = module.findService( ValueToEntity.class ).get();
+            ValueToEntity conversion = serviceFinder.findService( ValueToEntity.class ).get();
 
             PersonEntity edEntity = conversion.create( PersonEntity.class, "id:Ed", edValue );
 
@@ -156,7 +156,7 @@ public class ValueToEntityTest
     public void givenUnqualifiedValue2WhenCreatingEntityExpectCorrectEntity()
         throws UnitOfWorkCompletionException
     {
-        ValueBuilder<PersonValue3> builder = module.newValueBuilder( PersonValue3.class );
+        ValueBuilder<PersonValue3> builder = valueBuilderFactory.newValueBuilder( PersonValue3.class );
         builder.prototype().firstName().set( "Ed" );
         builder.prototype().lastName().set( "Flintstone" );
         builder.prototype().dateOfBirth().set( someBirthDate );
@@ -165,7 +165,7 @@ public class ValueToEntityTest
         PersonValue3 edValue = builder.newInstance();
         try( UnitOfWork uow = uowf.newUnitOfWork( newUsecase( "CreatingEntityFromUnqualifiedValue" ) ) )
         {
-            ValueToEntity conversion = module.findService( ValueToEntity.class ).get();
+            ValueToEntity conversion = serviceFinder.findService( ValueToEntity.class ).get();
 
             PersonEntity edEntity = conversion.create( PersonEntity.class, "id:Ed", edValue );
 
@@ -190,7 +190,7 @@ public class ValueToEntityTest
     public void givenQualifiedValueNotFromSameInterfaceWhenCreatingEntityExpectNonOptionalException()
         throws UnitOfWorkCompletionException
     {
-        ValueBuilder<PersonValue4> builder = module.newValueBuilder( PersonValue4.class );
+        ValueBuilder<PersonValue4> builder = valueBuilderFactory.newValueBuilder( PersonValue4.class );
         builder.prototype().firstName().set( "Ed" );
         builder.prototype().lastName().set( "Flintstone" );
         builder.prototype().dateOfBirth().set( someBirthDate );
@@ -199,7 +199,7 @@ public class ValueToEntityTest
         PersonValue4 edValue = builder.newInstance();
         try( UnitOfWork uow = uowf.newUnitOfWork( newUsecase( "CreatingEntityFromUnqualifiedValue" ) ) )
         {
-            ValueToEntity conversion = module.findService( ValueToEntity.class ).get();
+            ValueToEntity conversion = serviceFinder.findService( ValueToEntity.class ).get();
 
             PersonEntity edEntity = conversion.create( PersonEntity.class, "id:Ed", edValue );
 
@@ -223,7 +223,7 @@ public class ValueToEntityTest
             assertThat( ricky.children().count(), is( 1 ) );
             uow.complete();
         }
-        ValueBuilder<PersonValue> builder = module.newValueBuilder( PersonValue.class );
+        ValueBuilder<PersonValue> builder = valueBuilderFactory.newValueBuilder( PersonValue.class );
         builder.prototype().firstName().set( "Ricky" );
         builder.prototype().lastName().set( "Slaghoople" );
         builder.prototype().dateOfBirth().set( someBirthDate );
@@ -232,7 +232,7 @@ public class ValueToEntityTest
         {
             PersonEntity rickyEntity = uow.get( PersonEntity.class, rickyIdentity );
             // START SNIPPET: update
-            ValueToEntity conversion = module.findService( ValueToEntity.class ).get();
+            ValueToEntity conversion = serviceFinder.findService( ValueToEntity.class ).get();
             conversion.update( rickyEntity, rickyNewStateValue );
             // END SNIPPET: update
 
@@ -259,7 +259,7 @@ public class ValueToEntityTest
             assertThat( ricky.children().count(), is( 1 ) );
             uow.complete();
         }
-        ValueBuilder<PersonValue2> builder = module.newValueBuilder( PersonValue2.class );
+        ValueBuilder<PersonValue2> builder = valueBuilderFactory.newValueBuilder( PersonValue2.class );
         builder.prototype().firstName().set( "Ricky" );
         builder.prototype().lastName().set( "Slaghoople" );
         builder.prototype().dateOfBirth().set( someBirthDate );
@@ -268,7 +268,7 @@ public class ValueToEntityTest
         {
             PersonEntity ricky = uow.get( PersonEntity.class, rickyIdentity );
 
-            ValueToEntity conversion = module.findService( ValueToEntity.class ).get();
+            ValueToEntity conversion = serviceFinder.findService( ValueToEntity.class ).get();
             conversion.update( ricky, newStateValue );
 
             assertThat( ricky.lastName(), equalTo( "Slaghoople" ) );
@@ -294,7 +294,7 @@ public class ValueToEntityTest
             assertThat( ricky.children().count(), is( 1 ) );
             uow.complete();
         }
-        ValueBuilder<PersonValue3> builder = module.newValueBuilder( PersonValue3.class );
+        ValueBuilder<PersonValue3> builder = valueBuilderFactory.newValueBuilder( PersonValue3.class );
         builder.prototype().firstName().set( "Ricky" );
         builder.prototype().lastName().set( "Slaghoople" );
         builder.prototype().dateOfBirth().set( someBirthDate );
@@ -303,7 +303,7 @@ public class ValueToEntityTest
         {
             PersonEntity ricky = uow.get( PersonEntity.class, rickyIdentity );
 
-            ValueToEntity conversion = module.findService( ValueToEntity.class ).get();
+            ValueToEntity conversion = serviceFinder.findService( ValueToEntity.class ).get();
             conversion.update( ricky, newStateValue );
 
             assertThat( ricky.lastName(), equalTo( "Slaghoople" ) );
@@ -329,7 +329,7 @@ public class ValueToEntityTest
             assertThat( ricky.children().count(), is( 1 ) );
             uow.complete();
         }
-        ValueBuilder<PersonValue4> builder = module.newValueBuilder( PersonValue4.class );
+        ValueBuilder<PersonValue4> builder = valueBuilderFactory.newValueBuilder( PersonValue4.class );
         builder.prototype().firstName().set( "Ricky" );
         builder.prototype().lastName().set( "Slaghoople" );
         builder.prototype().dateOfBirth().set( someBirthDate );
@@ -338,7 +338,7 @@ public class ValueToEntityTest
         {
             PersonEntity ricky = uow.get( PersonEntity.class, rickyIdentity );
 
-            ValueToEntity conversion = module.findService( ValueToEntity.class ).get();
+            ValueToEntity conversion = serviceFinder.findService( ValueToEntity.class ).get();
             conversion.update( ricky, newStateValue );
 
             assertThat( ricky.lastName(), equalTo( "Slaghople" ) );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/eventsourcing-jdbm/src/main/java/org/apache/zest/library/eventsourcing/domain/source/jdbm/JdbmEventStoreService.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing-jdbm/src/main/java/org/apache/zest/library/eventsourcing/domain/source/jdbm/JdbmEventStoreService.java b/libraries/eventsourcing-jdbm/src/main/java/org/apache/zest/library/eventsourcing/domain/source/jdbm/JdbmEventStoreService.java
index 0a13db2..270adec 100644
--- a/libraries/eventsourcing-jdbm/src/main/java/org/apache/zest/library/eventsourcing/domain/source/jdbm/JdbmEventStoreService.java
+++ b/libraries/eventsourcing-jdbm/src/main/java/org/apache/zest/library/eventsourcing/domain/source/jdbm/JdbmEventStoreService.java
@@ -125,7 +125,7 @@ public interface JdbmEventStoreService
                 @Override
                 public UnitOfWorkDomainEventsValue apply( String item )
                 {
-                    return valueSerialization.<UnitOfWorkDomainEventsValue>deserialize( eventsType, item );
+                    return valueSerialization.<UnitOfWorkDomainEventsValue>deserialize( module, eventsType, item );
                 }
             }, storeEvents0() ) );
 
@@ -251,7 +251,7 @@ public interface JdbmEventStoreService
         {
             byte[] eventData = (byte[]) tuple.getValue();
             String eventJson = new String( eventData, "UTF-8" );
-            return valueSerialization.<UnitOfWorkDomainEventsValue>deserialize( eventsType, eventJson );
+            return valueSerialization.<UnitOfWorkDomainEventsValue>deserialize( module, eventsType, eventJson );
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/eventsourcing-jdbm/src/test/java/org/apache/zest/library/eventsourcing/domain/source/jdbm/JdbmEventStoreServiceTest.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing-jdbm/src/test/java/org/apache/zest/library/eventsourcing/domain/source/jdbm/JdbmEventStoreServiceTest.java b/libraries/eventsourcing-jdbm/src/test/java/org/apache/zest/library/eventsourcing/domain/source/jdbm/JdbmEventStoreServiceTest.java
index f0a2e11..c2e55c1 100644
--- a/libraries/eventsourcing-jdbm/src/test/java/org/apache/zest/library/eventsourcing/domain/source/jdbm/JdbmEventStoreServiceTest.java
+++ b/libraries/eventsourcing-jdbm/src/test/java/org/apache/zest/library/eventsourcing/domain/source/jdbm/JdbmEventStoreServiceTest.java
@@ -87,7 +87,7 @@ public class JdbmEventStoreServiceTest
                 uow.complete();
             }
 
-            EventSource source = (EventSource) module.findService( EventSource.class ).get();
+            EventSource source = serviceFinder.findService( EventSource.class ).get();
 
             source.events( 0, Long.MAX_VALUE ).transferTo( Transforms.map( new Function<UnitOfWorkDomainEventsValue, String>()
                     {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/application/source/AbstractApplicationEventStoreMixin.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/application/source/AbstractApplicationEventStoreMixin.java b/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/application/source/AbstractApplicationEventStoreMixin.java
index df58e76..6e0de34 100644
--- a/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/application/source/AbstractApplicationEventStoreMixin.java
+++ b/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/application/source/AbstractApplicationEventStoreMixin.java
@@ -29,6 +29,7 @@ import org.apache.zest.api.entity.Identity;
 import org.apache.zest.api.injection.scope.Structure;
 import org.apache.zest.api.injection.scope.This;
 import org.apache.zest.api.structure.Module;
+import org.apache.zest.api.structure.ModuleDescriptor;
 import org.apache.zest.api.type.ValueType;
 import org.apache.zest.api.value.ValueBuilder;
 import org.apache.zest.api.value.ValueBuilderFactory;
@@ -59,7 +60,7 @@ public abstract class AbstractApplicationEventStoreMixin
     protected Lock lock = new ReentrantLock();
 
     @Structure
-    protected Module module;
+    protected ModuleDescriptor module;
 
     @Structure
     private ValueBuilderFactory vbf;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/domain/replay/DomainEventPlayerService.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/domain/replay/DomainEventPlayerService.java b/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/domain/replay/DomainEventPlayerService.java
index 8f63723..569f1d6 100644
--- a/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/domain/replay/DomainEventPlayerService.java
+++ b/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/domain/replay/DomainEventPlayerService.java
@@ -75,7 +75,7 @@ public interface DomainEventPlayerService
                 {
                     currentEventValue = domainEventValue;
                     // Get the entity
-                    Class entityType = module.classLoader().loadClass( domainEventValue.entityType().get() );
+                    Class entityType = module.descriptor().classLoader().loadClass( domainEventValue.entityType().get() );
                     String id = domainEventValue.entityId().get();
                     Object entity = null;
                     try

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/domain/source/AbstractEventStoreMixin.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/domain/source/AbstractEventStoreMixin.java b/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/domain/source/AbstractEventStoreMixin.java
index 52b0e19..58e4dbd 100644
--- a/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/domain/source/AbstractEventStoreMixin.java
+++ b/libraries/eventsourcing/src/main/java/org/apache/zest/library/eventsourcing/domain/source/AbstractEventStoreMixin.java
@@ -29,6 +29,7 @@ import org.apache.zest.api.entity.Identity;
 import org.apache.zest.api.injection.scope.Structure;
 import org.apache.zest.api.injection.scope.This;
 import org.apache.zest.api.structure.Module;
+import org.apache.zest.api.structure.ModuleDescriptor;
 import org.apache.zest.api.type.ValueType;
 import org.apache.zest.io.Output;
 import org.apache.zest.io.Receiver;
@@ -56,7 +57,7 @@ public abstract class AbstractEventStoreMixin
     protected Lock lock = new ReentrantLock();
 
     @Structure
-    protected Module module;
+    protected ModuleDescriptor module;
 
     private ExecutorService transactionNotifier;
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/eventsourcing/src/test/java/org/apache/zest/library/eventsourcing/application/ApplicationEventTest.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/test/java/org/apache/zest/library/eventsourcing/application/ApplicationEventTest.java b/libraries/eventsourcing/src/test/java/org/apache/zest/library/eventsourcing/application/ApplicationEventTest.java
index 911eeb7..dec362b 100644
--- a/libraries/eventsourcing/src/test/java/org/apache/zest/library/eventsourcing/application/ApplicationEventTest.java
+++ b/libraries/eventsourcing/src/test/java/org/apache/zest/library/eventsourcing/application/ApplicationEventTest.java
@@ -92,7 +92,7 @@ public class ApplicationEventTest
     @Test
     public void testApplicationEvent() throws Exception
     {
-        Users users = module.newTransient( Users.class );
+        Users users = transientBuilderFactory.newTransient( Users.class );
 
         Principal administratorPrincipal = new Principal()
         {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/eventsourcing/src/test/java/org/apache/zest/library/eventsourcing/domain/DomainEventTest.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/test/java/org/apache/zest/library/eventsourcing/domain/DomainEventTest.java b/libraries/eventsourcing/src/test/java/org/apache/zest/library/eventsourcing/domain/DomainEventTest.java
index c8fe3a6..bab1a8d 100644
--- a/libraries/eventsourcing/src/test/java/org/apache/zest/library/eventsourcing/domain/DomainEventTest.java
+++ b/libraries/eventsourcing/src/test/java/org/apache/zest/library/eventsourcing/domain/DomainEventTest.java
@@ -86,7 +86,7 @@ public class DomainEventTest
         uow.complete();
 
         // Print events
-        EventSource source = (EventSource) module.findService( EventSource.class ).get();
+        EventSource source = serviceFinder.findService( EventSource.class ).get();
 
         source.events( 0, Long.MAX_VALUE ).transferTo( Transforms.map( new Function<UnitOfWorkDomainEventsValue, String>()
                 {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/http/src/test/java/org/apache/zest/library/http/JettyServiceTest.java
----------------------------------------------------------------------
diff --git a/libraries/http/src/test/java/org/apache/zest/library/http/JettyServiceTest.java b/libraries/http/src/test/java/org/apache/zest/library/http/JettyServiceTest.java
index 1944179..3a3b36f 100644
--- a/libraries/http/src/test/java/org/apache/zest/library/http/JettyServiceTest.java
+++ b/libraries/http/src/test/java/org/apache/zest/library/http/JettyServiceTest.java
@@ -68,7 +68,7 @@ public final class JettyServiceTest
     public final void testInstantiation()
         throws Throwable
     {
-        Iterable<ServiceReference<JettyService>> services = module.findServices( JettyService.class );
+        Iterable<ServiceReference<JettyService>> services = serviceFinder.findServices( JettyService.class );
         assertNotNull( services );
 
         Iterator<ServiceReference<JettyService>> iterator = services.iterator();

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/jmx/src/main/java/org/apache/zest/library/jmx/ApplicationManagerService.java
----------------------------------------------------------------------
diff --git a/libraries/jmx/src/main/java/org/apache/zest/library/jmx/ApplicationManagerService.java b/libraries/jmx/src/main/java/org/apache/zest/library/jmx/ApplicationManagerService.java
index df007fe..e100c5d 100644
--- a/libraries/jmx/src/main/java/org/apache/zest/library/jmx/ApplicationManagerService.java
+++ b/libraries/jmx/src/main/java/org/apache/zest/library/jmx/ApplicationManagerService.java
@@ -17,6 +17,7 @@ package org.apache.zest.library.jmx;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Stack;
+import java.util.stream.Collectors;
 import javax.management.MBeanOperationInfo;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
@@ -242,11 +243,10 @@ public interface ApplicationManagerService
             this.layer = layer;
             this.layerDescriptor = layerDescriptor;
 
-            uses = "Uses: ";
-            for( LayerDescriptor usedLayer : layerDescriptor.usedLayers().layers() )
-            {
-                uses += usedLayer.name() + " ";
-            }
+            uses = layerDescriptor.usedLayers()
+                .layers()
+                .map( LayerDescriptor::name )
+                .collect( Collectors.joining(" ", "Uses: ", "") );
         }
 
         public String getUses()

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/jmx/src/main/java/org/apache/zest/library/jmx/ConfigurationManagerService.java
----------------------------------------------------------------------
diff --git a/libraries/jmx/src/main/java/org/apache/zest/library/jmx/ConfigurationManagerService.java b/libraries/jmx/src/main/java/org/apache/zest/library/jmx/ConfigurationManagerService.java
index e558a16..bd277d6 100644
--- a/libraries/jmx/src/main/java/org/apache/zest/library/jmx/ConfigurationManagerService.java
+++ b/libraries/jmx/src/main/java/org/apache/zest/library/jmx/ConfigurationManagerService.java
@@ -61,6 +61,7 @@ import org.apache.zest.api.service.ServiceDescriptor;
 import org.apache.zest.api.service.ServiceReference;
 import org.apache.zest.api.structure.Application;
 import org.apache.zest.api.structure.Module;
+import org.apache.zest.api.structure.ModuleDescriptor;
 import org.apache.zest.api.type.EnumType;
 import org.apache.zest.api.unitofwork.UnitOfWork;
 import org.apache.zest.api.unitofwork.UnitOfWorkCompletionException;
@@ -150,7 +151,7 @@ public interface ConfigurationManagerService
                 String serviceClass = compositeInstance.types().findFirst().get().getName();
                 String name = configurableService.identity();
                 ServiceDescriptor serviceDescriptor = spi.serviceDescriptorFor( configurableService );
-                Module module = spi.moduleOf( configurableService );
+                ModuleDescriptor module = spi.moduleOf( configurableService );
                 Class<Object> configurationClass = serviceDescriptor.configurationType();
                 if( configurationClass != null )
                 {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/lang-javascript/src/test/java/org/apache/zest/library/javascript/JavaScriptMixinTest.java
----------------------------------------------------------------------
diff --git a/libraries/lang-javascript/src/test/java/org/apache/zest/library/javascript/JavaScriptMixinTest.java b/libraries/lang-javascript/src/test/java/org/apache/zest/library/javascript/JavaScriptMixinTest.java
index acf218d..defc9f6 100644
--- a/libraries/lang-javascript/src/test/java/org/apache/zest/library/javascript/JavaScriptMixinTest.java
+++ b/libraries/lang-javascript/src/test/java/org/apache/zest/library/javascript/JavaScriptMixinTest.java
@@ -29,7 +29,7 @@ public class JavaScriptMixinTest
     @Test
     public void testInvoke() throws Throwable
     {
-        DomainType domain = module.newTransient( DomainType.class );
+        DomainType domain = transientBuilderFactory.newTransient( DomainType.class );
         Assert.assertEquals( "do1 script \" and ' for many cases is harder.", domain.do1() );
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/locking/src/test/java/org/apache/zest/library/locking/LockingTest.java
----------------------------------------------------------------------
diff --git a/libraries/locking/src/test/java/org/apache/zest/library/locking/LockingTest.java b/libraries/locking/src/test/java/org/apache/zest/library/locking/LockingTest.java
index 574007f..487a89f 100644
--- a/libraries/locking/src/test/java/org/apache/zest/library/locking/LockingTest.java
+++ b/libraries/locking/src/test/java/org/apache/zest/library/locking/LockingTest.java
@@ -42,7 +42,7 @@ public class LockingTest
     public void testLocking()
         throws InterruptedException
     {
-        final TestComposite composite = module.newTransient( TestComposite.class );
+        final TestComposite composite = transientBuilderFactory.newTransient( TestComposite.class );
 
         ExecutorService executor = Executors.newFixedThreadPool( 2 );
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/logging/src/test/java/org/apache/zest/library/logging/DebuggingTest.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/test/java/org/apache/zest/library/logging/DebuggingTest.java b/libraries/logging/src/test/java/org/apache/zest/library/logging/DebuggingTest.java
index b86ab71..745f9b3 100644
--- a/libraries/logging/src/test/java/org/apache/zest/library/logging/DebuggingTest.java
+++ b/libraries/logging/src/test/java/org/apache/zest/library/logging/DebuggingTest.java
@@ -70,10 +70,10 @@ public class DebuggingTest
 //            QueryBuilder<DebugRecord> builder = module.newQueryBuilder( DebugRecord.class );
 //            Query<DebugRecord> query = builder.newQuery( uow );
 //            assertEquals( 0, query.count() );
-            Some service = (Some) module.findService( Some.class ).get();
+            Some service = (Some) serviceFinder.findService( Some.class ).get();
             String message = service.doSomething( "World!", 10 );
             assertEquals( message, "Hello!" );
-            EntityStore es = (EntityStore) module.findService( EntityStore.class ).get();
+            EntityStore es = (EntityStore) serviceFinder.findService( EntityStore.class ).get();
             final String[] result = new String[1];
             es.entityStates( module ).transferTo( Transforms.map( new Function<EntityState, EntityState>()
                     {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/logging/src/test/java/org/apache/zest/library/logging/TracingTest.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/test/java/org/apache/zest/library/logging/TracingTest.java b/libraries/logging/src/test/java/org/apache/zest/library/logging/TracingTest.java
index 06dd6b9..5caf950 100644
--- a/libraries/logging/src/test/java/org/apache/zest/library/logging/TracingTest.java
+++ b/libraries/logging/src/test/java/org/apache/zest/library/logging/TracingTest.java
@@ -67,11 +67,11 @@ public class TracingTest
     public void whenTraceOnMixinTypeMethodExpectOneEntryInEntityStore()
         throws Exception
     {
-        SomeService sc = module.findService( SomeService.class ).get();
+        SomeService sc = serviceFinder.findService( SomeService.class ).get();
         assertEquals( 123, sc.doSomethingImportant() );
         assertEquals( 456, sc.doSomethingLessImportant() );
         UnitOfWork uow = uowf.newUnitOfWork();
-        QueryBuilder<TraceRecord> builder = module.newQueryBuilder( TraceRecord.class );
+        QueryBuilder<TraceRecord> builder = queryBuilderFactory.newQueryBuilder( TraceRecord.class );
         Query<TraceRecord> query = uow.newQuery( builder );
         // IS sorting needed??
 //        TraceRecord template = templateFor( TraceRecord.class );
@@ -88,11 +88,11 @@ public class TracingTest
     public void whenTraceAllOnCompositeTypeExpectTwoEntryInEntityStore()
         throws Exception
     {
-        SomeService2 sc = module.findService( SomeService2.class ).get();
+        SomeService2 sc = serviceFinder.findService( SomeService2.class ).get();
         assertEquals( 123, sc.doSomethingImportant() );
         assertEquals( 456, sc.doSomethingLessImportant() );
         UnitOfWork uow = uowf.newUnitOfWork();
-        QueryBuilder<TraceRecord> builder = module.newQueryBuilder( TraceRecord.class );
+        QueryBuilder<TraceRecord> builder = queryBuilderFactory.newQueryBuilder( TraceRecord.class );
         Query<TraceRecord> query = uow.newQuery( builder );
         // IS sorting needed??
 //        TraceRecord template = templateFor( TraceRecord.class );
@@ -112,13 +112,13 @@ public class TracingTest
     public void whenTraceOnMixinImplExpectTwoEntryInEntityStore()
         throws Exception
     {
-        SomeService sc = module.findService( SomeService.class ).get();
+        SomeService sc = serviceFinder.findService( SomeService.class ).get();
         assertEquals( 123, sc.doSomethingImportant() );
         assertEquals( 789, sc.doSomethingModeratelyImportant() );
         UnitOfWork uow = uowf.newUnitOfWork();
         try
         {
-            QueryBuilder<TraceRecord> builder = module.newQueryBuilder( TraceRecord.class );
+            QueryBuilder<TraceRecord> builder = queryBuilderFactory.newQueryBuilder( TraceRecord.class );
             Query<TraceRecord> query = uow.newQuery( builder );
             // IS sorting needed??
             TraceRecord template = templateFor( TraceRecord.class );
@@ -151,11 +151,11 @@ public class TracingTest
     {
         // It is not possible to put Annotation on Concern Methods, so it should only record one.
 
-        SomeService sc = module.findService( SomeService.class ).get();
+        SomeService sc = serviceFinder.findService( SomeService.class ).get();
         assertEquals( 123, sc.doSomethingImportant() );
         assertEquals( 753, sc.doSomethingInsanelyImportant() );
         UnitOfWork uow = uowf.newUnitOfWork();
-        QueryBuilder<TraceRecord> builder = module.newQueryBuilder( TraceRecord.class );
+        QueryBuilder<TraceRecord> builder = queryBuilderFactory.newQueryBuilder( TraceRecord.class );
         Query<TraceRecord> query = uow.newQuery( builder );
         // IS sorting needed??
 //        TraceRecord template = templateFor( TraceRecord.class );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/metrics/src/test/java/org/apache/zest/library/metrics/MetricsTest.java
----------------------------------------------------------------------
diff --git a/libraries/metrics/src/test/java/org/apache/zest/library/metrics/MetricsTest.java b/libraries/metrics/src/test/java/org/apache/zest/library/metrics/MetricsTest.java
index adf1f55..9a066c1 100644
--- a/libraries/metrics/src/test/java/org/apache/zest/library/metrics/MetricsTest.java
+++ b/libraries/metrics/src/test/java/org/apache/zest/library/metrics/MetricsTest.java
@@ -76,7 +76,7 @@ public class MetricsTest extends AbstractZestTest
     @Test
     public void givenNonInstrumentedCompositeWhenCallingUpdateNameExpectNoReport()
     {
-        Country underTest = module.newTransient( Country1.class );
+        Country underTest = transientBuilderFactory.newTransient( Country1.class );
         String result = runTest( underTest );
         result = result.replace( "\r", "" );
         assertTrue( lastLine( result, 1 ).contains( "=====================" ) );
@@ -86,7 +86,7 @@ public class MetricsTest extends AbstractZestTest
     @Test
     public void givenInstrumentedWithAllCompositeWhenCallingUpdateNameExpectReport()
     {
-        Country underTest = module.newTransient( Country2.class );
+        Country underTest = transientBuilderFactory.newTransient( Country2.class );
         String result = runTest( underTest );
         result = result.replace( "\r", "" );
         assertThat( lastLine( result, 34 ), equalTo( "org.apache.zest.library.metrics.Country.SomeApplication:" ) );
@@ -103,7 +103,7 @@ public class MetricsTest extends AbstractZestTest
     @Test
     public void givenOneMethodAnnotatedWhenCallingUpdateNameExpectReportForThatMethodOnly()
     {
-        Country underTest = module.newTransient( Country3.class );
+        Country underTest = transientBuilderFactory.newTransient( Country3.class );
         String result = runTest( underTest );
         result = result.replace( "\r", "" );
         assertThat( lastLine( result, 17 ), equalTo( "org.apache.zest.library.metrics.Country.SomeApplication:" ) );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/osgi/src/test/java/org/apache/zest/library/osgi/OSGiServiceTest.java
----------------------------------------------------------------------
diff --git a/libraries/osgi/src/test/java/org/apache/zest/library/osgi/OSGiServiceTest.java b/libraries/osgi/src/test/java/org/apache/zest/library/osgi/OSGiServiceTest.java
index c3a31be..b610d9f 100644
--- a/libraries/osgi/src/test/java/org/apache/zest/library/osgi/OSGiServiceTest.java
+++ b/libraries/osgi/src/test/java/org/apache/zest/library/osgi/OSGiServiceTest.java
@@ -51,7 +51,7 @@ public class OSGiServiceTest
     @Test
     public void givenFelixFrameworkWhenStartingZestApplicationExpectServiceToBeRegisteredToOsgiBundleContext()
     {
-        MyService service = module.findService( MyService.class ).get();
+        MyService service = serviceFinder.findService( MyService.class ).get();
         service.value().set( 15 );
         assertEquals( (Integer) 15, service.value().get() );
         String[] expectedClasses = new String[]

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/rdf/src/test/java/org/apache/zest/library/rdf/ApplicationXmlTest.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/test/java/org/apache/zest/library/rdf/ApplicationXmlTest.java b/libraries/rdf/src/test/java/org/apache/zest/library/rdf/ApplicationXmlTest.java
index 5d49305..5a5a847 100644
--- a/libraries/rdf/src/test/java/org/apache/zest/library/rdf/ApplicationXmlTest.java
+++ b/libraries/rdf/src/test/java/org/apache/zest/library/rdf/ApplicationXmlTest.java
@@ -59,7 +59,7 @@ public class ApplicationXmlTest extends AbstractZestTest
     public void testApplicationXml()
         throws Exception
     {
-        FileConfiguration fileConfig = (FileConfiguration) module.findService( FileConfiguration.class ).get();
+        FileConfiguration fileConfig = serviceFinder.findService( FileConfiguration.class ).get();
         ApplicationSerializer parser = new ApplicationSerializer();
         Iterable<Statement> graph = parser.serialize( application ); // TODO Fix this
         writeN3( graph );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/rdf/src/test/java/org/apache/zest/library/rdf/entity/EntitySerializerTest.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/test/java/org/apache/zest/library/rdf/entity/EntitySerializerTest.java b/libraries/rdf/src/test/java/org/apache/zest/library/rdf/entity/EntitySerializerTest.java
index 89054bb..8aa0594 100755
--- a/libraries/rdf/src/test/java/org/apache/zest/library/rdf/entity/EntitySerializerTest.java
+++ b/libraries/rdf/src/test/java/org/apache/zest/library/rdf/entity/EntitySerializerTest.java
@@ -68,10 +68,7 @@ public class EntitySerializerTest
         throws Exception
     {
         super.setUp();
-
         createDummyData();
-
-        module.injectTo( this );
     }
 
     @Test
@@ -81,7 +78,7 @@ public class EntitySerializerTest
         EntityReference entityReference = new EntityReference( "test2" );
         Usecase usecase = UsecaseBuilder.newUsecase( "Test" );
         long currentTime = System.currentTimeMillis();
-        EntityStoreUnitOfWork unitOfWork = entityStore.newUnitOfWork( usecase, currentTime );
+        EntityStoreUnitOfWork unitOfWork = entityStore.newUnitOfWork( module, usecase, currentTime );
         EntityState entityState = unitOfWork.entityStateOf( module, entityReference );
 
         Iterable<Statement> graph = serializer.serialize( entityState );
@@ -98,9 +95,9 @@ public class EntitySerializerTest
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
         try
         {
-            ValueBuilder<TestValue> valueBuilder = module.newValueBuilder( TestValue.class );
+            ValueBuilder<TestValue> valueBuilder = valueBuilderFactory.newValueBuilder( TestValue.class );
             valueBuilder.prototype().test1().set( 4L );
-            ValueBuilder<Test2Value> valueBuilder2 = module.newValueBuilder( Test2Value.class );
+            ValueBuilder<Test2Value> valueBuilder2 = valueBuilderFactory.newValueBuilder( Test2Value.class );
             valueBuilder2.prototype().data().set( "Habba" );
             valueBuilder.prototype().test3().set( valueBuilder2.newInstance() );
             TestValue testValue = valueBuilder.newInstance();
@@ -121,7 +118,7 @@ public class EntitySerializerTest
             niclasTemplate.group().add( 0, testEntity );
             niclasTemplate.group().add( 0, testEntity );
             niclasTemplate.group().add( 0, testEntity );
-            valueBuilder = module.newValueBuilderWithPrototype( testValue );
+            valueBuilder = valueBuilderFactory.newValueBuilderWithPrototype( testValue );
             valueBuilder.prototype().test1().set( 5L );
             testValue = valueBuilder.newInstance();
             niclasTemplate.value().set( testValue );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/libraries/rdf/src/test/java/org/apache/zest/library/rdf/entity/EntityTypeSerializerTest.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/test/java/org/apache/zest/library/rdf/entity/EntityTypeSerializerTest.java b/libraries/rdf/src/test/java/org/apache/zest/library/rdf/entity/EntityTypeSerializerTest.java
index dbdb77a..5504bd4 100644
--- a/libraries/rdf/src/test/java/org/apache/zest/library/rdf/entity/EntityTypeSerializerTest.java
+++ b/libraries/rdf/src/test/java/org/apache/zest/library/rdf/entity/EntityTypeSerializerTest.java
@@ -59,10 +59,7 @@ public class EntityTypeSerializerTest
     public void setUp() throws Exception
     {
         super.setUp();
-
         createDummyData();
-
-        module.injectTo( this );
     }
 
     @Test
@@ -84,10 +81,10 @@ public class EntityTypeSerializerTest
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
         try
         {
-            ValueBuilder<Test2Value> vb2 = module.newValueBuilder( Test2Value.class );
+            ValueBuilder<Test2Value> vb2 = valueBuilderFactory.newValueBuilder( Test2Value.class );
             vb2.prototype().data().set( "Zout" );
 
-            ValueBuilder<TestValue> valueBuilder = module.newValueBuilder( TestValue.class );
+            ValueBuilder<TestValue> valueBuilder = valueBuilderFactory.newValueBuilder( TestValue.class );
             valueBuilder.prototype().test1().set( 4L );
             valueBuilder.prototype().test3().set( vb2.newInstance() );
             TestValue testValue = valueBuilder.newInstance();
@@ -108,7 +105,7 @@ public class EntityTypeSerializerTest
             niclasTemplate.group().add( 0, testEntity );
             niclasTemplate.group().add( 0, testEntity );
             niclasTemplate.group().add( 0, testEntity );
-            valueBuilder = module.newValueBuilderWithPrototype( testValue );
+            valueBuilder = valueBuilderFactory.newValueBuilderWithPrototype( testValue );
             valueBuilder.prototype().test1().set( 5L );
             testValue = valueBuilder.newInstance();
             niclasTemplate.value().set( testValue );


Mime
View raw message