polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [1/2] zest-qi4j git commit: Introduced a layered EntityStoreUnitOfWork, just like the ordinary UnitOfWork, that has a wrapper which contains the current Module. To make this work, quite a lot of SPI level interfaces needed to be changed, and SPI compatib
Date Thu, 25 Jun 2015 12:41:32 GMT
Repository: zest-qi4j
Updated Branches:
  refs/heads/develop 0189ec78f -> c8c3286cb


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/c8c3286c/extensions/reindexer/src/main/java/org/qi4j/index/reindexer/internal/ReindexerMixin.java
----------------------------------------------------------------------
diff --git a/extensions/reindexer/src/main/java/org/qi4j/index/reindexer/internal/ReindexerMixin.java
b/extensions/reindexer/src/main/java/org/qi4j/index/reindexer/internal/ReindexerMixin.java
index 211206b..40f52d9 100644
--- a/extensions/reindexer/src/main/java/org/qi4j/index/reindexer/internal/ReindexerMixin.java
+++ b/extensions/reindexer/src/main/java/org/qi4j/index/reindexer/internal/ReindexerMixin.java
@@ -26,7 +26,6 @@ import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.api.structure.Module;
 import org.qi4j.index.reindexer.Reindexer;
 import org.qi4j.index.reindexer.ReindexerConfiguration;
 import org.qi4j.io.Output;
@@ -35,99 +34,104 @@ import org.qi4j.io.Sender;
 import org.qi4j.spi.entity.EntityState;
 import org.qi4j.spi.entitystore.EntityStore;
 import org.qi4j.spi.entitystore.StateChangeListener;
+import org.qi4j.spi.module.ModuleSpi;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class ReindexerMixin
-        implements Reindexer
+    implements Reindexer
 {
-   private static QualifiedName identityQN;
-
-   static
-   {
-      try
-      {
-         identityQN = QualifiedName.fromAccessor( Identity.class.getMethod( "identity" )
);
-      } catch (NoSuchMethodException e)
-      {
-         throw new InternalError("Qi4j Core Runtime codebase is corrupted. Contact Qi4j team:
ReindexerMixin");
-      }
-   }
-
-   @This
-   private Configuration<ReindexerConfiguration> configuration;
-
-   @Service
-   private EntityStore store;
-   @Service
-   private Iterable<ServiceReference<StateChangeListener>> listeners;
-   @Structure
-   private Module module;
-
-   private Logger logger = LoggerFactory.getLogger(Reindexer.class);
+    private static QualifiedName identityQN;
+
+    static
+    {
+        try
+        {
+            identityQN = QualifiedName.fromAccessor( Identity.class.getMethod( "identity"
) );
+        }
+        catch( NoSuchMethodException e )
+        {
+            throw new InternalError( "Qi4j Core Runtime codebase is corrupted. Contact Qi4j
team: ReindexerMixin" );
+        }
+    }
+
+    @This
+    private Configuration<ReindexerConfiguration> configuration;
+
+    @Service
+    private EntityStore store;
+
+    @Service
+    private Iterable<ServiceReference<StateChangeListener>> listeners;
+
+    @Structure
+    private ModuleSpi module;
+
+    private Logger logger = LoggerFactory.getLogger( Reindexer.class );
 
     @Override
-   public void reindex()
-   {
-      configuration.refresh();
-      ReindexerConfiguration conf = configuration.get();
-      Integer loadValue = conf.loadValue().get();
-      if (loadValue == null)
-      {
-         loadValue = 50;
-      }
-      new ReindexerOutput(loadValue).reindex(store);
-   }
-
-   private class ReindexerOutput
-           implements Output<EntityState, RuntimeException>, Receiver<EntityState,
RuntimeException>
-   {
-      private int count;
-      private int loadValue;
-      private ArrayList<EntityState> states;
-
-      public ReindexerOutput(Integer loadValue)
-      {
-         this.loadValue = loadValue;
-         states = new ArrayList<EntityState>();
-      }
-
-      public void reindex(EntityStore store)
-      {
-
-         store.entityStates(module).transferTo(this);
-         reindexState();
-      }
-
-      @Override
-      public <SenderThrowableType extends Throwable> void receiveFrom(Sender<? extends
EntityState, SenderThrowableType> sender) throws RuntimeException, SenderThrowableType
-      {
-         sender.sendTo(this);
-         reindexState();
-      }
-
-       @Override
-      public void receive(EntityState item)
-              throws RuntimeException
-      {
-         count++;
-         item.setPropertyValue( identityQN, item.identity().identity() );
-         states.add(item);
-
-         if (states.size() >= loadValue)
-         {
+    public void reindex()
+    {
+        configuration.refresh();
+        ReindexerConfiguration conf = configuration.get();
+        Integer loadValue = conf.loadValue().get();
+        if( loadValue == null )
+        {
+            loadValue = 50;
+        }
+        new ReindexerOutput( loadValue ).reindex( store );
+    }
+
+    private class ReindexerOutput
+        implements Output<EntityState, RuntimeException>, Receiver<EntityState,
RuntimeException>
+    {
+        private int count;
+        private int loadValue;
+        private ArrayList<EntityState> states;
+
+        public ReindexerOutput( Integer loadValue )
+        {
+            this.loadValue = loadValue;
+            states = new ArrayList<>();
+        }
+
+        public void reindex( EntityStore store )
+        {
+
+            store.entityStates( module ).transferTo( this );
+            reindexState();
+        }
+
+        @Override
+        public <SenderThrowableType extends Throwable> void receiveFrom( Sender<?
extends EntityState, SenderThrowableType> sender )
+            throws RuntimeException, SenderThrowableType
+        {
+            sender.sendTo( this );
             reindexState();
-         }
-      }
-
-      public void reindexState()
-      {
-         for (ServiceReference<StateChangeListener> listener : listeners)
-         {
-            listener.get().notifyChanges(states);
-         }
-         states.clear();
-         logger.debug("Reindexed " + count + " entities");
-      }
-   }
+        }
+
+        @Override
+        public void receive( EntityState item )
+            throws RuntimeException
+        {
+            count++;
+            item.setPropertyValue( identityQN, item.identity().identity() );
+            states.add( item );
+
+            if( states.size() >= loadValue )
+            {
+                reindexState();
+            }
+        }
+
+        public void reindexState()
+        {
+            for( ServiceReference<StateChangeListener> listener : listeners )
+            {
+                listener.get().notifyChanges( states );
+            }
+            states.clear();
+            logger.debug( "Reindexed " + count + " entities" );
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/c8c3286c/extensions/reindexer/src/test/java/org/qi4j/index/reindexer/ReindexerTest.java
----------------------------------------------------------------------
diff --git a/extensions/reindexer/src/test/java/org/qi4j/index/reindexer/ReindexerTest.java
b/extensions/reindexer/src/test/java/org/qi4j/index/reindexer/ReindexerTest.java
index d656b6f..923151d 100644
--- a/extensions/reindexer/src/test/java/org/qi4j/index/reindexer/ReindexerTest.java
+++ b/extensions/reindexer/src/test/java/org/qi4j/index/reindexer/ReindexerTest.java
@@ -39,7 +39,9 @@ import org.qi4j.library.rdf.repository.NativeConfiguration;
 import org.qi4j.test.AbstractQi4jTest;
 import org.qi4j.test.EntityTestAssembler;
 
+import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
 import static org.qi4j.api.query.QueryExpressions.eq;
 import static org.qi4j.api.query.QueryExpressions.templateFor;
 
@@ -85,6 +87,10 @@ public class ReindexerTest
     public void createDataWipeIndexReindexAndAssertData()
             throws UnitOfWorkCompletionException
     {
+        File rdfDir = new File( System.getProperty( "user.dir" ), "build/testdata/qi4j-index"
).getAbsoluteFile();
+        rdfDir.mkdirs();
+        assertThat( rdfDir.exists(), is(true) );
+
         // ----> Create data and wipe index
 
         UnitOfWork uow = module.newUnitOfWork();
@@ -97,6 +103,7 @@ public class ReindexerTest
         uow.complete();
 
         deleteIndexData(); // Wipe the index data on disk
+        rdfDir.mkdirs();
 
 
         // ----> Reindex and assert data
@@ -132,7 +139,7 @@ public class ReindexerTest
     private static boolean deleteEntitiesData()
     {
         boolean success = true;
-        File esDir = new File( "build/testdata/qi4j-entities" );
+        File esDir = new File( System.getProperty( "user.dir" ), "build/testdata/qi4j-entities"
).getAbsoluteFile();
         if ( esDir.exists() ) {
             success = FileUtil.deltree( esDir );
         }
@@ -142,7 +149,7 @@ public class ReindexerTest
     private static boolean deleteIndexData()
     {
         boolean success = true;
-        File rdfDir = new File( "build/testdata/qi4j-index" );
+        File rdfDir = new File( System.getProperty( "user.dir" ), "build/testdata/qi4j-index"
).getAbsoluteFile();
         if ( rdfDir.exists() ) {
             FileUtils.delete( rdfDir );
             success = FileUtil.deltree( rdfDir );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/c8c3286c/libraries/rdf/src/main/java/org/qi4j/library/rdf/repository/NativeRepositoryService.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/main/java/org/qi4j/library/rdf/repository/NativeRepositoryService.java
b/libraries/rdf/src/main/java/org/qi4j/library/rdf/repository/NativeRepositoryService.java
index c098fb8..94e6486 100644
--- a/libraries/rdf/src/main/java/org/qi4j/library/rdf/repository/NativeRepositoryService.java
+++ b/libraries/rdf/src/main/java/org/qi4j/library/rdf/repository/NativeRepositoryService.java
@@ -32,183 +32,190 @@ import org.qi4j.api.service.ServiceComposite;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.library.fileconfig.FileConfiguration;
 
-@Mixins({NativeRepositoryService.NativeRepositoryMixin.class})
+@Mixins( { NativeRepositoryService.NativeRepositoryMixin.class } )
 @Activators( NativeRepositoryService.Activator.class )
 public interface NativeRepositoryService extends Repository, ServiceComposite, Availability
 {
     @Override
     void initialize()
-            throws RepositoryException;
+        throws RepositoryException;
 
     @Override
     void shutDown()
-            throws RepositoryException;
+        throws RepositoryException;
 
     public static class Activator
-            extends ActivatorAdapter<ServiceReference<NativeRepositoryService>>
+        extends ActivatorAdapter<ServiceReference<NativeRepositoryService>>
     {
 
         @Override
         public void afterActivation( ServiceReference<NativeRepositoryService> activated
)
-                throws Exception
+            throws Exception
         {
             activated.get().initialize();
         }
 
         @Override
         public void beforePassivation( ServiceReference<NativeRepositoryService> passivating
)
-                throws Exception
+            throws Exception
         {
             passivating.get().shutDown();
         }
-
     }
 
-
     public static abstract class NativeRepositoryMixin
-           implements NativeRepositoryService, ResetableRepository
-   {
-      @Optional
-      @Service
-      FileConfiguration fileConfiguration;
-
-      @This
-      private Configuration<NativeConfiguration> configuration;
-
-      private SailRepository repo;
-      private boolean isNotInitialized;
-
-      public NativeRepositoryMixin()
-      {
-         isNotInitialized = true;
-         repo = new SailRepository(new NativeStore());
-      }
-
-      @Override
-      public void setDataDir(File dataDir)
-      {
-         repo.setDataDir(dataDir);
-      }
-
-      @Override
-      public File getDataDir()
-      {
-         return repo.getDataDir();
-      }
-
-      @Override
-      public void initialize()
-              throws RepositoryException
-      {
-         String dataDir = configuration.get().dataDirectory().get();
-         if (dataDir == null || "".equals(dataDir))
-         {
-            if (fileConfiguration != null)
+        implements NativeRepositoryService, ResetableRepository
+    {
+        @Optional
+        @Service
+        FileConfiguration fileConfiguration;
+
+        @This
+        private Configuration<NativeConfiguration> configuration;
+
+        private SailRepository repo;
+        private boolean isNotInitialized;
+
+        public NativeRepositoryMixin()
+        {
+            isNotInitialized = true;
+            repo = new SailRepository( new NativeStore() );
+        }
+
+        @Override
+        public void setDataDir( File dataDir )
+        {
+            repo.setDataDir( dataDir );
+        }
+
+        @Override
+        public File getDataDir()
+        {
+            return repo.getDataDir();
+        }
+
+        @Override
+        public void initialize()
+            throws RepositoryException
+        {
+            String dataDir = configuration.get().dataDirectory().get();
+            File dataDirectory;
+            if( dataDir == null || "".equals( dataDir ) )
             {
-               dataDir = new File(fileConfiguration.dataDirectory(), configuration.get().identity().get()).getAbsolutePath();
-            } else
+                String serviceIdentity = configuration.get().identity().get();
+                if( fileConfiguration != null )
+                {
+                    dataDir = new File( fileConfiguration.dataDirectory(), serviceIdentity
).getAbsolutePath();
+                }
+                else
+                {
+                    if( serviceIdentity == null || "".equals( serviceIdentity ) )
+                    {
+                        dataDir = "./rdf/repositories/qi4j";
+                    }
+                    else
+                    {
+                        dataDir = "./rdf/repositories/" + serviceIdentity;
+                    }
+                }
+                configuration.get().dataDirectory().set( dataDir );
+                configuration.save();
+                dataDirectory = new File( dataDir );
+            }
+            else
             {
-               String id = configuration.get().identity().get();
-               if (id == null || "".equals(id))
-               {
-                  dataDir = "./rdf/repositories/qi4j";
-               } else
-               {
-                  dataDir = "./rdf/repositories/" + id;
-               }
+                dataDirectory = new File( dataDir ).getAbsoluteFile();
             }
-            configuration.get().dataDirectory().set(dataDir);
-            configuration.save();
-         }
-         initializeRepository(new File(dataDir));
-      }
-
-      @Override
-      public boolean isInitialized()
-      {
-         return !isNotInitialized;
-      }
-
-      @Override
-      public void shutDown()
-              throws RepositoryException
-      {
-          repo.shutDown();
-      }
-
-      @Override
-      public boolean isWritable()
-              throws RepositoryException
-      {
-         return repo.isWritable();
-      }
-
-      @Override
-      public RepositoryConnection getConnection()
-              throws RepositoryException
-      {
-         if (isNotInitialized)
-         {
-            return null;
-         }
-         return repo.getConnection();
-      }
-
-      @Override
-      public ValueFactory getValueFactory()
-      {
-         return repo.getValueFactory();
-      }
-
-      @Override
-      public void discardEntireRepository()
-              throws RepositoryException
-      {
-         File dataDir = repo.getDataDir();
-         repo.shutDown();
-         delete(dataDir);
-         initializeRepository(dataDir);
-      }
-
-      private void delete(File dataDir)
-      {
-         File[] children = dataDir.listFiles();
-         for (File child : children)
-         {
-            if (child.isDirectory())
+            initializeRepository( dataDirectory );
+        }
+
+        @Override
+        public boolean isInitialized()
+        {
+            return !isNotInitialized;
+        }
+
+        @Override
+        public void shutDown()
+            throws RepositoryException
+        {
+            repo.shutDown();
+        }
+
+        @Override
+        public boolean isWritable()
+            throws RepositoryException
+        {
+            return repo.isWritable();
+        }
+
+        @Override
+        public RepositoryConnection getConnection()
+            throws RepositoryException
+        {
+            if( isNotInitialized )
             {
-               delete(child);
-            } else
+                return null;
+            }
+            return repo.getConnection();
+        }
+
+        @Override
+        public ValueFactory getValueFactory()
+        {
+            return repo.getValueFactory();
+        }
+
+        @Override
+        public void discardEntireRepository()
+            throws RepositoryException
+        {
+            File dataDir = repo.getDataDir();
+            repo.shutDown();
+            delete( dataDir );
+            initializeRepository( dataDir );
+        }
+
+        private void delete( File dataDir )
+        {
+            File[] children = dataDir.listFiles();
+            for( File child : children )
+            {
+                if( child.isDirectory() )
+                {
+                    delete( child );
+                }
+                else
+                {
+                    //noinspection ResultOfMethodCallIgnored
+                    child.delete();
+                }
+            }
+        }
+
+        private void initializeRepository( File dataDir )
+            throws RepositoryException
+        {
+            String tripleIndexes = configuration.get().tripleIndexes().get();
+            if( tripleIndexes == null )
             {
-               //noinspection ResultOfMethodCallIgnored
-               child.delete();
+                tripleIndexes = "";
+                configuration.get().tripleIndexes().set( tripleIndexes );
             }
-         }
-      }
-
-      private void initializeRepository(File dataDir)
-              throws RepositoryException
-      {
-         String tripleIndexes = configuration.get().tripleIndexes().get();
-         if (tripleIndexes == null)
-         {
-            tripleIndexes = "";
-            configuration.get().tripleIndexes().set(tripleIndexes);
-         }
-         boolean forceSync = configuration.get().forceSync().get();
-
-         NativeStore store = (NativeStore) repo.getSail();
-         store.setDataDir(dataDir);
-         store.setTripleIndexes(tripleIndexes);
-         store.setForceSync(forceSync);
-         repo.initialize();
-         isNotInitialized = false;
-      }
-
-       @Override
-       public boolean isAvailable()
-       {
-           return !isNotInitialized;
-       }
-   }
+            boolean forceSync = configuration.get().forceSync().get();
+
+            NativeStore store = (NativeStore) repo.getSail();
+            store.setDataDir( dataDir );
+            store.setTripleIndexes( tripleIndexes );
+            store.setForceSync( forceSync );
+            repo.initialize();
+            isNotInitialized = false;
+        }
+
+        @Override
+        public boolean isAvailable()
+        {
+            return !isNotInitialized;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/c8c3286c/libraries/rdf/src/test/java/org/qi4j/library/rdf/entity/EntitySerializerTest.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/test/java/org/qi4j/library/rdf/entity/EntitySerializerTest.java
b/libraries/rdf/src/test/java/org/qi4j/library/rdf/entity/EntitySerializerTest.java
index d41466d..a89f518 100644
--- a/libraries/rdf/src/test/java/org/qi4j/library/rdf/entity/EntitySerializerTest.java
+++ b/libraries/rdf/src/test/java/org/qi4j/library/rdf/entity/EntitySerializerTest.java
@@ -25,16 +25,17 @@ import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Uses;
 import org.qi4j.api.unitofwork.UnitOfWork;
 import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
+import org.qi4j.api.usecase.Usecase;
 import org.qi4j.api.usecase.UsecaseBuilder;
 import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.memory.MemoryEntityStoreService;
 import org.qi4j.library.rdf.DcRdf;
 import org.qi4j.library.rdf.Rdfs;
 import org.qi4j.library.rdf.serializer.RdfXmlSerializer;
 import org.qi4j.spi.entity.EntityState;
 import org.qi4j.spi.entitystore.EntityStore;
+import org.qi4j.spi.entitystore.EntityStoreUnitOfWork;
 import org.qi4j.test.AbstractQi4jTest;
 import org.qi4j.test.EntityTestAssembler;
 import org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler;
@@ -45,10 +46,13 @@ import org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler;
 public class EntitySerializerTest
     extends AbstractQi4jTest
 {
-    @Service EntityStore entityStore;
-    @Uses EntityStateSerializer serializer;
+    @Service
+    EntityStore entityStore;
+    @Uses
+    EntityStateSerializer serializer;
 
-    public void assemble( ModuleAssembly module ) throws AssemblyException
+    public void assemble( ModuleAssembly module )
+        throws AssemblyException
     {
         new EntityTestAssembler().assemble( module );
         new OrgJsonValueSerializationAssembler().assemble( module );
@@ -58,8 +62,10 @@ public class EntitySerializerTest
         module.objects( EntityStateSerializer.class, EntitySerializerTest.class );
     }
 
-    @Override @Before
-    public void setUp() throws Exception
+    @Override
+    @Before
+    public void setUp()
+        throws Exception
     {
         super.setUp();
 
@@ -69,21 +75,25 @@ public class EntitySerializerTest
     }
 
     @Test
-    public void testEntitySerializer() throws RDFHandlerException
+    public void testEntitySerializer()
+        throws RDFHandlerException
     {
         EntityReference entityReference = new EntityReference( "test2" );
-        EntityState entityState = entityStore.newUnitOfWork( UsecaseBuilder.newUsecase( "Test"
), module, System.currentTimeMillis() ).entityStateOf( entityReference );
+        Usecase usecase = UsecaseBuilder.newUsecase( "Test" );
+        long currentTime = System.currentTimeMillis();
+        EntityStoreUnitOfWork unitOfWork = entityStore.newUnitOfWork( usecase, module, currentTime
);
+        EntityState entityState = unitOfWork.entityStateOf( module, entityReference );
 
         Iterable<Statement> graph = serializer.serialize( entityState );
 
         String[] prefixes = new String[]{ "rdf", "dc", " vc" };
         String[] namespaces = new String[]{ Rdfs.RDF, DcRdf.NAMESPACE, "http://www.w3.org/2001/vcard-rdf/3.0#"
};
 
-
         new RdfXmlSerializer().serialize( graph, new PrintWriter( System.out ), prefixes,
namespaces );
     }
 
-    void createDummyData() throws UnitOfWorkCompletionException
+    void createDummyData()
+        throws UnitOfWorkCompletionException
     {
         UnitOfWork unitOfWork = module.newUnitOfWork();
         try

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/c8c3286c/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntityResource.java
----------------------------------------------------------------------
diff --git a/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntityResource.java
b/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntityResource.java
index 3474970..328d2c0 100644
--- a/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntityResource.java
+++ b/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntityResource.java
@@ -37,7 +37,6 @@ import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.Uses;
 import org.qi4j.api.property.PropertyDescriptor;
-import org.qi4j.api.structure.Module;
 import org.qi4j.api.usecase.Usecase;
 import org.qi4j.api.usecase.UsecaseBuilder;
 import org.qi4j.api.value.ValueSerialization;
@@ -53,6 +52,7 @@ import org.qi4j.spi.entitystore.EntityNotFoundException;
 import org.qi4j.spi.entitystore.EntityStore;
 import org.qi4j.spi.entitystore.EntityStoreUnitOfWork;
 import org.qi4j.spi.entitystore.helpers.JSONEntityState;
+import org.qi4j.spi.module.ModuleSpi;
 import org.restlet.data.CharacterSet;
 import org.restlet.data.Form;
 import org.restlet.data.Language;
@@ -74,10 +74,13 @@ public class EntityResource
 
     @Service
     private EntityStore entityStore;
+
     @Service
     private ValueSerialization valueSerialization;
+
     @Structure
-    private Module module;
+    private ModuleSpi module;
+
     @Uses
     private EntityStateSerializer entitySerializer;
     private String identity;
@@ -111,7 +114,7 @@ public class EntityResource
         try
         {
             EntityReference identityRef = EntityReference.parseEntityReference( identity
);
-            uow.entityStateOf( identityRef ).remove();
+            uow.entityStateOf( module, identityRef ).remove();
             uow.applyChanges().commit();
             getResponse().setStatus( Status.SUCCESS_NO_CONTENT );
         }
@@ -176,7 +179,7 @@ public class EntityResource
         try
         {
             EntityReference entityReference = EntityReference.parseEntityReference( identity
);
-            entityState = unitOfWork.entityStateOf( entityReference );
+            entityState = unitOfWork.entityStateOf( module, entityReference );
         }
         catch( EntityNotFoundException e )
         {
@@ -339,7 +342,6 @@ public class EntityResource
         };
         representation.setCharacterSet( CharacterSet.UTF_8 );
         return representation;
-
     }
 
     @Override
@@ -427,7 +429,7 @@ public class EntityResource
 
                         try
                         {
-                            unitOfWork.entityStateOf( reference );
+                            unitOfWork.entityStateOf( module, reference );
 
                             manyAssociation.remove( reference );
                             manyAssociation.add( index++, reference );
@@ -479,7 +481,7 @@ public class EntityResource
                         EntityReference reference = new EntityReference( identity );
                         try
                         {
-                            unitOfWork.entityStateOf( reference );
+                            unitOfWork.entityStateOf( module, reference );
 
                             namedAssociation.remove( name );
                             namedAssociation.put( name, reference );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/c8c3286c/libraries/scheduler/src/docs/scheduler.txt
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/docs/scheduler.txt b/libraries/scheduler/src/docs/scheduler.txt
index f45d07f..8b4b5ac 100644
--- a/libraries/scheduler/src/docs/scheduler.txt
+++ b/libraries/scheduler/src/docs/scheduler.txt
@@ -137,6 +137,11 @@ To sum up, cron expressions used here have a precision of one second.
The follow
 - @annualy or @yearly
 
 
+== Durability ==
+Schedules can either be ethereal or durable, passed as an argument to the +Scheduler+. If
it is a durable
+schedule, then the Task must be an Entity Composite.
+
+When the
 == Observing the Timeline ==
 
 Timeline allow to browse in past and future Task runs. This feature is available only if
you activate


Mime
View raw message