diff src/org/dancres/blitz/VisitorBaulkedPartyFactory.java @ 0:3dc0c5604566

Initial checkin of blitz 2.0 fcs - no installer yet.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 21 Mar 2009 11:00:06 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/dancres/blitz/VisitorBaulkedPartyFactory.java	Sat Mar 21 11:00:06 2009 +0000
@@ -0,0 +1,49 @@
+package org.dancres.blitz;
+
+import org.dancres.blitz.txnlock.BaulkedParty;
+import org.dancres.blitz.mangler.MangledEntry;
+import org.dancres.blitz.oid.OID;
+
+/**
+ * <code>SearchVisitor</code>s must supply a conflict resolution implementation
+ * to <code>TxnLock</code>s however they have insufficient context to determine
+ * what that implementation is and we need the code using
+ * <code>SearchVisitor</code>s to be able to interact with the conflict
+ * resolution code.  To handle both these issues, we have
+ * <code>SearchVisitor</code>s accept an instance of the below and use it
+ * to generate conflict handlers for the transaction code.
+ */
+public interface VisitorBaulkedPartyFactory {
+    public BaulkedParty newParty(SingleMatchTask aMatchTask);
+    public BaulkedParty newParty(BulkTakeVisitor aMatchTask);
+    public void enableResolutionSignal();
+
+    /**
+     * Common class to be used as handbacks for the instances of
+     * <code>BaulkedParty</code> returned by the underlying factory
+     * implementation.
+     */
+    static class Handback {
+        private String theType;
+        private OID theOID;
+        private MangledEntry theEntry;
+
+        Handback(String aType, OID anOID, MangledEntry anEntry) {
+            theType = aType;
+            theOID = anOID;
+            theEntry = anEntry;
+        }
+
+        String getType() {
+            return theType;
+        }
+
+        OID getOID() {
+            return theOID;
+        }
+
+        MangledEntry getEntry() {
+            return theEntry;
+        }
+    }
+}