You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mnemonic.apache.org by ga...@apache.org on 2018/03/07 05:35:22 UTC
mnemonic git commit: MNEMONIC-467: Simplify the example code of
ShowOrder by using FactoryProxyHelper
Repository: mnemonic
Updated Branches:
refs/heads/master 1866b1e61 -> bed9ba4c9
MNEMONIC-467: Simplify the example code of ShowOrder by using FactoryProxyHelper
Project: http://git-wip-us.apache.org/repos/asf/mnemonic/repo
Commit: http://git-wip-us.apache.org/repos/asf/mnemonic/commit/bed9ba4c
Tree: http://git-wip-us.apache.org/repos/asf/mnemonic/tree/bed9ba4c
Diff: http://git-wip-us.apache.org/repos/asf/mnemonic/diff/bed9ba4c
Branch: refs/heads/master
Commit: bed9ba4c962461055ecccb342adc7ef2ffe05bfe
Parents: 1866b1e
Author: Yanhui Zhao <yz...@apache.org>
Authored: Mon Mar 5 09:47:13 2018 -0800
Committer: Yanhui Zhao <yz...@apache.org>
Committed: Mon Mar 5 09:47:13 2018 -0800
----------------------------------------------------------------------
.../org/apache/mnemonic/examples/ShowOrder.java | 30 ++------------------
1 file changed, 2 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mnemonic/blob/bed9ba4c/mnemonic-examples/src/main/java/org/apache/mnemonic/examples/ShowOrder.java
----------------------------------------------------------------------
diff --git a/mnemonic-examples/src/main/java/org/apache/mnemonic/examples/ShowOrder.java b/mnemonic-examples/src/main/java/org/apache/mnemonic/examples/ShowOrder.java
index 235bead..a22c4af 100644
--- a/mnemonic-examples/src/main/java/org/apache/mnemonic/examples/ShowOrder.java
+++ b/mnemonic-examples/src/main/java/org/apache/mnemonic/examples/ShowOrder.java
@@ -19,9 +19,8 @@ package org.apache.mnemonic.examples;
import org.apache.mnemonic.DurableType;
import org.apache.mnemonic.EntityFactoryProxy;
+import org.apache.mnemonic.EntityFactoryProxyHelper;
import org.apache.mnemonic.NonVolatileMemAllocator;
-import org.apache.mnemonic.ParameterHolder;
-import org.apache.mnemonic.RestorableAllocator;
import org.apache.mnemonic.Utils;
public class ShowOrder {
@@ -34,32 +33,7 @@ public class ShowOrder {
DurableType listgftypes[] = {DurableType.DURABLE};
- EntityFactoryProxy listefproxies[] = {
- new EntityFactoryProxy() {
- @Override
- public <A extends RestorableAllocator<A>> Product restore(
- A allocator, EntityFactoryProxy[] factoryproxys,
- DurableType[] gfields, long phandler, boolean autoreclaim) {
- return ProductFactory.restore(allocator, factoryproxys, gfields, phandler, autoreclaim);
- }
- @Override
- public <A extends RestorableAllocator<A>> Product restore(ParameterHolder<A> ph) {
- return ProductFactory.restore(ph.getAllocator(),
- ph.getEntityFactoryProxies(), ph.getGenericTypes(), ph.getHandler(), ph.getAutoReclaim());
- }
- @Override
- public <A extends RestorableAllocator<A>> Product create(
- A allocator, EntityFactoryProxy[] factoryproxys,
- DurableType[] gfields, boolean autoreclaim) {
- return ProductFactory.create(allocator, factoryproxys, gfields, autoreclaim);
- }
- @Override
- public <A extends RestorableAllocator<A>> Product create(ParameterHolder<A> ph) {
- return ProductFactory.create(ph.getAllocator(),
- ph.getEntityFactoryProxies(), ph.getGenericTypes(), ph.getAutoReclaim());
- }
- }
- };
+ EntityFactoryProxy listefproxies[] = {new EntityFactoryProxyHelper<Product>(Product.class) };
long hdl = 0L;
for (long keyid = 1; keyid <= 3; keyid++) {