Author: degenaro
Date: Sun Nov 2 12:30:48 2014
New Revision: 1636118
URL: http://svn.apache.org/r1636118
Log:
UIMA-4069 Redesign of JD toward the main goal of classpath separation for
container (system) code.
Update message handler interfaces.
Modified:
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/dispatch/RemoteWorkerIdentity.java
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/dispatch/WorkItem.java
Modified:
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/dispatch/RemoteWorkerIdentity.java
URL:
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/dispatch/RemoteWorkerIdentity.java?rev=1636118&r1=1636117&r2=1636118&view=diff
==============================================================================
---
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/dispatch/RemoteWorkerIdentity.java
(original)
+++
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/dispatch/RemoteWorkerIdentity.java
Sun Nov 2 12:30:48 2014
@@ -21,6 +21,9 @@ package org.apache.uima.ducc.container.j
import org.apache.uima.ducc.container.common.ContainerLogger;
import org.apache.uima.ducc.container.common.IEntityId;
import org.apache.uima.ducc.container.common.IContainerLogger;
+import org.apache.uima.ducc.container.jd.dispatch.iface.IRemoteNode;
+import org.apache.uima.ducc.container.jd.dispatch.iface.IRemotePid;
+import org.apache.uima.ducc.container.jd.dispatch.iface.IRemoteWorkerIdentity;
import org.apache.uima.ducc.container.net.iface.IMetaCasRequester;
public class RemoteWorkerIdentity implements IRemoteWorkerIdentity,
Comparable<Object> {
@@ -173,4 +176,50 @@ public class RemoteWorkerIdentity implem
}
return retVal;
}
+
+ /////
+
+ private int compareToNode(IRemoteNode that) {
+ int retVal = 0;
+ String thisNode = this.getNode();
+ String thatNode = that.getNode();
+ if(thisNode != null) {
+ if(thatNode != null) {
+ retVal = thisNode.compareTo(thatNode);
+ }
+ }
+ return retVal;
+ }
+
+ private int compareToPid(IRemotePid that) {
+ int retVal = 0;
+ Integer thisPid = new Integer(this.getPid());
+ Integer thatPid = new Integer(that.getPid());
+ retVal = thisPid.compareTo(thatPid);
+ return retVal;
+ }
+
+ @Override
+ public boolean comprises(IRemoteNode that) {
+ boolean retVal = false;
+ if(that != null) {
+ if(this.compareToNode(that) == 0) {
+ retVal = true;
+ }
+ }
+ return retVal;
+ }
+
+ @Override
+ public boolean comprises(IRemotePid that) {
+ boolean retVal = false;
+ if(that != null) {
+ if(this.compareToNode(that) == 0) {
+ if(this.compareToPid(that) == 0) {
+ retVal = true;
+ }
+ }
+ }
+ return retVal;
+ }
}
Modified:
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/dispatch/WorkItem.java
URL:
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/dispatch/WorkItem.java?rev=1636118&r1=1636117&r2=1636118&view=diff
==============================================================================
---
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/dispatch/WorkItem.java
(original)
+++
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/dispatch/WorkItem.java
Sun Nov 2 12:30:48 2014
@@ -19,6 +19,7 @@
package org.apache.uima.ducc.container.jd.dispatch;
import org.apache.uima.ducc.container.common.fsm.iface.IFsm;
+import org.apache.uima.ducc.container.jd.dispatch.iface.IWorkItem;
import org.apache.uima.ducc.container.net.iface.IMetaCas;
public class WorkItem implements IWorkItem {