You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by pa...@apache.org on 2016/06/12 14:37:14 UTC
[1/3] zest-java git commit: Uniform naming formatting code style in
Fragment/Transient class loaders
Repository: zest-java
Updated Branches:
refs/heads/develop 21baf180e -> eb9ec0db0
Uniform naming formatting code style in Fragment/Transient class loaders
No code change
So they can easily be diff'ed
Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/5f261098
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/5f261098
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/5f261098
Branch: refs/heads/develop
Commit: 5f26109842e0e5cceb6219c0b005e81b99d45ed2
Parents: 21baf18
Author: Paul Merlin <pa...@apache.org>
Authored: Sun Jun 12 15:29:48 2016 +0200
Committer: Paul Merlin <pa...@apache.org>
Committed: Sun Jun 12 15:29:48 2016 +0200
----------------------------------------------------------------------
.../runtime/composite/FragmentClassLoader.java | 28 +++++++++-----------
.../runtime/composite/TransientClassLoader.java | 26 +++++++-----------
2 files changed, 22 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5f261098/core/runtime/src/main/java/org/apache/zest/runtime/composite/FragmentClassLoader.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/composite/FragmentClassLoader.java b/core/runtime/src/main/java/org/apache/zest/runtime/composite/FragmentClassLoader.java
index a5215fc..7e54ed1 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/composite/FragmentClassLoader.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/composite/FragmentClassLoader.java
@@ -144,7 +144,7 @@ public class FragmentClassLoader
}
}
}
-// To Allow JDK classes to be composed.
+ // To Allow JDK classes to be composed.
if( name.startsWith( "java." ) )
{
name = "zest." + name;
@@ -183,8 +183,8 @@ public class FragmentClassLoader
{
if( isOverridden( method, baseClass ) )
{
- cw.visitField( ACC_PRIVATE + ACC_STATIC, "m" + idx++, "Ljava/lang/reflect/Method;", null,
- null ).visitEnd();
+ cw.visitField( ACC_PRIVATE + ACC_STATIC, "m" + idx++, "Ljava/lang/reflect/Method;", null, null )
+ .visitEnd();
hasProxyMethods = true;
}
}
@@ -196,9 +196,9 @@ public class FragmentClassLoader
if( Modifier.isPublic( constructor.getModifiers() ) || Modifier.isProtected( constructor.getModifiers() ) )
{
String desc = org.objectweb.asm.commons.Method.getMethod( constructor ).getDescriptor();
- MethodVisitor cmv = cw.visitMethod( ACC_PUBLIC, "<init>", desc, null, null );
- cmv.visitCode();
- cmv.visitVarInsn( ALOAD, 0 );
+ MethodVisitor mv = cw.visitMethod( ACC_PUBLIC, "<init>", desc, null, null );
+ mv.visitCode();
+ mv.visitVarInsn( ALOAD, 0 );
int idx = 1;
for( Class aClass : constructor.getParameterTypes() )
@@ -224,13 +224,13 @@ public class FragmentClassLoader
{
opcode = ALOAD;
}
- cmv.visitVarInsn( opcode, idx++ );
+ mv.visitVarInsn( opcode, idx++ );
}
- cmv.visitMethodInsn( INVOKESPECIAL, baseClassSlash, "<init>", desc, false );
- cmv.visitInsn( RETURN );
- cmv.visitMaxs( idx, idx );
- cmv.visitEnd();
+ mv.visitMethodInsn( INVOKESPECIAL, baseClassSlash, "<init>", desc, false );
+ mv.visitInsn( RETURN );
+ mv.visitMaxs( idx, idx );
+ mv.visitEnd();
}
}
@@ -374,8 +374,7 @@ public class FragmentClassLoader
if( !Modifier.isAbstract( method.getModifiers() ) )
{
// Add method with _ as prefix
- MethodVisitor mv;
- mv = cw.visitMethod( ACC_PUBLIC, "_" + method.getName(), desc, null, exceptions );
+ MethodVisitor mv = cw.visitMethod( ACC_PUBLIC, "_" + method.getName(), desc, null, exceptions );
mv.visitCode();
mv.visitVarInsn( ALOAD, 0 );
@@ -407,8 +406,7 @@ public class FragmentClassLoader
// Class initializer
{
- MethodVisitor mv;
- mv = cw.visitMethod( ACC_STATIC, "<clinit>", "()V", null, null );
+ MethodVisitor mv = cw.visitMethod( ACC_STATIC, "<clinit>", "()V", null, null );
mv.visitCode();
Label l0 = new Label();
Label l1 = new Label();
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5f261098/core/runtime/src/main/java/org/apache/zest/runtime/composite/TransientClassLoader.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/composite/TransientClassLoader.java b/core/runtime/src/main/java/org/apache/zest/runtime/composite/TransientClassLoader.java
index cfd698a..503349b 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/composite/TransientClassLoader.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/composite/TransientClassLoader.java
@@ -25,7 +25,6 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
-import org.apache.zest.api.composite.Composite;
import org.apache.zest.api.entity.Lifecycle;
import org.apache.zest.api.mixin.Initializable;
import org.apache.zest.api.util.Methods;
@@ -162,17 +161,14 @@ import static org.objectweb.asm.Type.getInternalName;
String baseClassSlash = getInternalName( baseClass );
ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS );
- FieldVisitor fv;
- MethodVisitor mv;
- AnnotationVisitor av0;
// Class definition start
cw.visit( JDK_VERSION, ACC_PUBLIC + ACC_SUPER, classSlash, null, baseClassSlash, new String[] { "org/apache/zest/api/composite/Composite" } );
// Composite reference
{
- fv = cw.visitField( ACC_PUBLIC, "_instance", "Lorg/apache/zest/api/composite/CompositeInvoker;", null, null );
- fv.visitEnd();
+ cw.visitField( ACC_PUBLIC, "_instance", "Lorg/apache/zest/api/composite/CompositeInvoker;", null, null )
+ .visitEnd();
}
// Static Method references
@@ -182,9 +178,8 @@ import static org.objectweb.asm.Type.getInternalName;
{
if( isOverloaded( method, baseClass ) )
{
- fv = cw.visitField( ACC_PRIVATE + ACC_STATIC, "m" + idx++, "Ljava/lang/reflect/Method;", null,
- null );
- fv.visitEnd();
+ cw.visitField( ACC_PRIVATE + ACC_STATIC, "m" + idx++, "Ljava/lang/reflect/Method;", null, null )
+ .visitEnd();
}
}
}
@@ -195,7 +190,7 @@ import static org.objectweb.asm.Type.getInternalName;
if( Modifier.isPublic( constructor.getModifiers() ) || Modifier.isProtected( constructor.getModifiers() ) )
{
String desc = org.objectweb.asm.commons.Method.getMethod( constructor ).getDescriptor();
- mv = cw.visitMethod( ACC_PUBLIC, "<init>", desc, null, null );
+ MethodVisitor mv = cw.visitMethod( ACC_PUBLIC, "<init>", desc, null, null );
mv.visitCode();
mv.visitVarInsn( ALOAD, 0 );
@@ -227,7 +222,7 @@ import static org.objectweb.asm.Type.getInternalName;
String[] exceptions = null;
{
- mv = cw.visitMethod( ACC_PUBLIC, methodName, desc, null, exceptions );
+ MethodVisitor mv = cw.visitMethod( ACC_PUBLIC, methodName, desc, null, exceptions );
if( isInternalZestMethod( method, baseClass ) )
{
// generate a NoOp method...
@@ -351,7 +346,7 @@ import static org.objectweb.asm.Type.getInternalName;
if( !Modifier.isAbstract( method.getModifiers() ) )
{
// Add method with _ as prefix
- mv = cw.visitMethod( ACC_PUBLIC, "_" + method.getName(), desc, null, exceptions );
+ MethodVisitor mv = cw.visitMethod( ACC_PUBLIC, "_" + method.getName(), desc, null, exceptions );
mv.visitCode();
mv.visitVarInsn( ALOAD, 0 );
@@ -383,7 +378,7 @@ import static org.objectweb.asm.Type.getInternalName;
// Class initializer
{
- mv = cw.visitMethod( ACC_STATIC, "<clinit>", "()V", null, null );
+ MethodVisitor mv = cw.visitMethod( ACC_STATIC, "<clinit>", "()V", null, null );
mv.visitCode();
Label l0 = new Label();
Label l1 = new Label();
@@ -398,8 +393,7 @@ import static org.objectweb.asm.Type.getInternalName;
if( isOverloaded( method, baseClass ) )
{
method.setAccessible( true );
- Class methodClass;
- methodClass = method.getDeclaringClass();
+ Class methodClass = method.getDeclaringClass();
midx++;
@@ -437,9 +431,7 @@ import static org.objectweb.asm.Type.getInternalName;
mv.visitMaxs( 6, 1 );
mv.visitEnd();
}
-
cw.visitEnd();
-
return cw.toByteArray();
}
[2/3] zest-java git commit: ZEST-151 Remove conversion library
include in website
Posted by pa...@apache.org.
ZEST-151 Remove conversion library include in website
Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/3f209237
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/3f209237
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/3f209237
Branch: refs/heads/develop
Commit: 3f209237f212907c176aa96d23b4145b86c6b1db
Parents: 5f26109
Author: Paul Merlin <pa...@apache.org>
Authored: Sun Jun 12 16:34:37 2016 +0200
Committer: Paul Merlin <pa...@apache.org>
Committed: Sun Jun 12 16:34:37 2016 +0200
----------------------------------------------------------------------
manual/src/docs/userguide/libraries.txt | 4 ----
1 file changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zest-java/blob/3f209237/manual/src/docs/userguide/libraries.txt
----------------------------------------------------------------------
diff --git a/manual/src/docs/userguide/libraries.txt b/manual/src/docs/userguide/libraries.txt
index 8615c48..fcbace9 100644
--- a/manual/src/docs/userguide/libraries.txt
+++ b/manual/src/docs/userguide/libraries.txt
@@ -55,10 +55,6 @@ include::../../../../libraries/constraints/src/docs/constraints.txt[]
:leveloffset: 2
-include::../../../../libraries/conversion/src/docs/conversion.txt[]
-
-:leveloffset: 2
-
include::../../../../libraries/eventsourcing/src/docs/eventsourcing.txt[]
:leveloffset: 2
[3/3] zest-java git commit: Transform some words from the mailing
list into a bit of doc for the Reindexer extension
Posted by pa...@apache.org.
Transform some words from the mailing list into a bit of doc for the Reindexer extension
Better than nothing :)
Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/eb9ec0db
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/eb9ec0db
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/eb9ec0db
Branch: refs/heads/develop
Commit: eb9ec0db0aa12f672f451b285b607d3b2aba4d17
Parents: 3f20923
Author: Paul Merlin <pa...@apache.org>
Authored: Sun Jun 12 16:36:33 2016 +0200
Committer: Paul Merlin <pa...@apache.org>
Committed: Sun Jun 12 16:36:33 2016 +0200
----------------------------------------------------------------------
extensions/reindexer/dev-status.xml | 2 +-
extensions/reindexer/src/docs/reindexer.txt | 38 ++++++++++++++++++--
.../zest/index/reindexer/ReindexerTest.java | 7 +++-
3 files changed, 42 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zest-java/blob/eb9ec0db/extensions/reindexer/dev-status.xml
----------------------------------------------------------------------
diff --git a/extensions/reindexer/dev-status.xml b/extensions/reindexer/dev-status.xml
index c5d4441..259bfcf 100644
--- a/extensions/reindexer/dev-status.xml
+++ b/extensions/reindexer/dev-status.xml
@@ -27,7 +27,7 @@
<codebase>stable</codebase>
<!-- none, brief, good, complete -->
- <documentation>none</documentation>
+ <documentation>brief</documentation>
<!-- none, some, good, complete -->
<unittests>some</unittests>
http://git-wip-us.apache.org/repos/asf/zest-java/blob/eb9ec0db/extensions/reindexer/src/docs/reindexer.txt
----------------------------------------------------------------------
diff --git a/extensions/reindexer/src/docs/reindexer.txt b/extensions/reindexer/src/docs/reindexer.txt
index 7e8a73b..924eaae 100644
--- a/extensions/reindexer/src/docs/reindexer.txt
+++ b/extensions/reindexer/src/docs/reindexer.txt
@@ -25,8 +25,40 @@
source=extensions/reindexer/dev-status.xml
--------------
-Reindexer
-
-NOTE: This Extension has no documentation yet. Learn how to contribute in <<community-docs>>.
+This extension allows you to trigger a complete indexing of EntityStores into Index/Query systems.
include::../../build/docs/buildinfo/artifact.txt[]
+
+The `Reindexer` is totally under your control and doesn't kick in automatically in any way or form.
+
+[snippet,java]
+----
+source=extensions/reindexer/src/test/java/org/apache/zest/index/reindexer/ReindexerTest.java
+tag=assembly
+----
+
+It will be bound to the `EntityStore` that is Visible, ask for all Entities, by calling
+`entityStates()` and forward those to all `StateChangeListeners` that are Visible.
+
+[snippet,java]
+----
+source=extensions/reindexer/src/test/java/org/apache/zest/index/reindexer/ReindexerTest.java
+tag=usage
+----
+
+So, you call `reindex()` on the `Reindexer`. If you have many reindexers, you could call
+`reindexAll()` which will locate all reindexers and call `reindex()`
+on each. This is useful when there are many modules of entity stores.
+
+There are two general issues that you need to keep in mind;
+
+1. Not all entity stores implements `entityStates()`, mostly because the
+ underlying store doesn't provide a convenient mechanism to iterate
+ everything.
+
+2. Unless you first clear all in the Index, deletions will not be
+ detected, and therefor the index might contain to many entity references in
+ that case.
+
+Additionally, reindexing is not really thread safe, so need to bring the
+system down while reindexing is happening.
http://git-wip-us.apache.org/repos/asf/zest-java/blob/eb9ec0db/extensions/reindexer/src/test/java/org/apache/zest/index/reindexer/ReindexerTest.java
----------------------------------------------------------------------
diff --git a/extensions/reindexer/src/test/java/org/apache/zest/index/reindexer/ReindexerTest.java b/extensions/reindexer/src/test/java/org/apache/zest/index/reindexer/ReindexerTest.java
index 5d082bc..9feead5 100644
--- a/extensions/reindexer/src/test/java/org/apache/zest/index/reindexer/ReindexerTest.java
+++ b/extensions/reindexer/src/test/java/org/apache/zest/index/reindexer/ReindexerTest.java
@@ -63,7 +63,9 @@ public class ReindexerTest
new RdfNativeSesameStoreAssembler().assemble( module );
// Reindexer
+ // START SNIPPET: assembly
module.services( ReindexerService.class );
+ // END SNIPPET: assembly
// Configuration
ModuleAssembly config = module.layer().module( "config" );
@@ -110,7 +112,10 @@ public class ReindexerTest
// ----> Reindex and assert data
- serviceFinder.findService( ReindexerService.class ).get().reindex(); // Reindex
+ // START SNIPPET: usage
+ Reindexer reindexer = serviceFinder.findService( Reindexer.class ).get();
+ reindexer.reindex();
+ // END SNIPPET: usage
uow = unitOfWorkFactory.newUnitOfWork();