Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Memory EntityStore: assembly and documentation

  • Loading branch information...
commit f2b9c3e620e5eaf1043b64580cc0564302b28f72 1 parent f1483cd
@eskatos eskatos authored
View
13 extensions/entitystore-memory/build.gradle
@@ -0,0 +1,13 @@
+jar { manifest { name = "Qi4j Extension - EntityStore - Memory" }}
+
+dependencies {
+
+ compile(project(":org.qi4j.core:org.qi4j.core.bootstrap"))
+
+ testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport"))
+ testCompile(project(":org.qi4j.extensions:org.qi4j.extension.valueserialization-orgjson"))
+
+ testRuntime(project(":org.qi4j.core:org.qi4j.core.runtime"))
+ testRuntime(libraries.logback)
+
+}
View
17 extensions/entitystore-memory/dev-status.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<module xmlns="http://www.qi4j.org/schemas/2008/dev-status/1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.qi4j.org/schemas/2008/dev-status/1
+ http://www.qi4j.org/schemas/2008/dev-status/1/dev-status.xsd">
+ <status>
+ <codebase>stable</codebase>
+ <!--none,early,beta,stable,mature-->
+ <documentation>good</documentation>
+ <!-- none, brief, good, complete -->
+ <unittests>good</unittests>
+ <!-- none, some, good, complete -->
+ </status>
+ <licenses>
+ <license>ALv2</license>
+ </licenses>
+</module>
View
23 extensions/entitystore-memory/src/docs/es-memory.txt
@@ -0,0 +1,23 @@
+[[extension-es-memoryl, Memory EntityStore]]
+= Memory EntityStore =
+
+[devstatus]
+--------------
+source=extensions/entitystore-memory/dev-status.xml
+--------------
+
+EntityStore service backed by an in-memory +Map+.
+
+include::../../build/docs/buildinfo/artifact.txt[]
+
+== Assembly ==
+
+Assembly is done as follows:
+
+[snippet,java]
+----
+source=extensions/entitystore-memory/src/test/java/org/qi4j/entitystore/memory/MemoryEntityStoreTest.java
+tag=assembly
+----
+
+This EntityStore has no configuration.
View
49 ...itystore-memory/src/main/java/org/qi4j/entitystore/memory/MemoryEntityStoreAssembler.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2013 Paul Merlin.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.qi4j.entitystore.memory;
+
+import org.qi4j.api.common.Visibility;
+import org.qi4j.bootstrap.Assembler;
+import org.qi4j.bootstrap.AssemblyException;
+import org.qi4j.bootstrap.ModuleAssembly;
+import org.qi4j.spi.uuid.UuidIdentityGeneratorService;
+
+/**
+ * Assemble an in-memory EntityStore.
+ */
+public class MemoryEntityStoreAssembler
+ implements Assembler
+{
+
+ private Visibility visibility = Visibility.module;
+
+ public MemoryEntityStoreAssembler visibleIn( Visibility visibility )
+ {
+ this.visibility = visibility;
+ return this;
+ }
+
+ @Override
+ public void assemble( ModuleAssembly module )
+ throws AssemblyException
+ {
+ module.services( MemoryEntityStoreService.class,
+ UuidIdentityGeneratorService.class ).
+ visibleIn( visibility );
+ }
+}
View
5 extensions/entitystore-memory/src/main/java/org/qi4j/entitystore/memory/package.html
@@ -0,0 +1,5 @@
+<html>
+ <body>
+ <h2>In-Memory EntityStore.</h2>
+ </body>
+</html>
View
41 ...s/entitystore-memory/src/test/java/org/qi4j/entitystore/memory/MemoryEntityStoreTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2013 Paul Merlin.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.qi4j.entitystore.memory;
+
+import org.qi4j.bootstrap.AssemblyException;
+import org.qi4j.bootstrap.ModuleAssembly;
+import org.qi4j.test.entity.AbstractEntityStoreTest;
+import org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler;
+
+public class MemoryEntityStoreTest
+ extends AbstractEntityStoreTest
+{
+
+ // START SNIPPET: assembly
+ @Override
+ public void assemble( ModuleAssembly module )
+ throws AssemblyException
+ {
+ new MemoryEntityStoreAssembler().assemble( module );
+ // END SNIPPET: assembly
+ new OrgJsonValueSerializationAssembler().assemble( module );
+ super.assemble( module );
+ // START SNIPPET: assembly
+ }
+ // END SNIPPET: assembly
+}
View
4 manual/src/docs/userguide/extensions.txt
@@ -42,6 +42,10 @@ include::../../../../extensions/cache-ehcache/src/docs/ehcache.txt[]
:leveloffset: 2
+include::../../../../extensions/entitystore-memory/src/docs/es-memory.txt[]
+
+:leveloffset: 2
+
include::../../../../extensions/entitystore-file/src/docs/es-file.txt[]
:leveloffset: 2
View
1  settings.gradle
@@ -49,6 +49,7 @@ include "core:functional",
'libraries:uid',
'libraries:uowfile',
'extensions:cache-ehcache',
+ 'extensions:entitystore-memory',
'extensions:entitystore-file',
'extensions:entitystore-gae',
'extensions:entitystore-hazelcast',
Please sign in to comment.
Something went wrong with that request. Please try again.