]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedRequest.java
Completely refactor the way the execution server looks for steps
[gpl/argeo-slc.git] / runtime / org.argeo.slc.detached / src / main / java / org / argeo / slc / detached / DetachedRequest.java
index 8a1976817ae803bfd20cb9f87cf8b531e09039c5..af625acd37c714014894b5b40115fc77d6aa37e5 100644 (file)
@@ -11,6 +11,8 @@ public class DetachedRequest implements DetachedCommunication {
        private String ref;
        private String path = "";
 
+       private Object cachedObject = null;
+
        public DetachedRequest() {
 
        }
@@ -59,11 +61,26 @@ public class DetachedRequest implements DetachedCommunication {
        }
 
        public String toString() {
-               StringBuffer buf = new StringBuffer(getClass().getName());
-               buf.append('#').append(uuid);
-               buf.append(" ref=").append(ref);
+               StringBuffer buf = new StringBuffer("detached request for ref ");
+               buf.append(ref);
+               buf.append(" #").append(uuid);
+               buf.append(" cachedObject=").append((cachedObject != null));
                buf.append(" path=").append(path);
                buf.append(" properties=").append(properties);
                return buf.toString();
        }
+
+       /**
+        * Optimization. Allows the driver to eagerly cache the object in the
+        * request, in order to relieve the detached server of the task to look for
+        * it. No implementation should rely on this to be set.
+        */
+       public Object getCachedObject() {
+               return cachedObject;
+       }
+
+       public void setCachedObject(Object cachedObject) {
+               this.cachedObject = cachedObject;
+       }
+
 }