[jbpm-commits] JBoss JBPM SVN: r3151 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Nov 28 11:08:07 EST 2008
Author: camunda
Date: 2008-11-28 11:08:06 -0500 (Fri, 28 Nov 2008)
New Revision: 3151
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java
Log:
https://jira.jboss.org/jira/browse/JBPM-1888
added "getLockOwner()" and "forceUnlock" to token
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java 2008-11-28 16:08:06 UTC (rev 3151)
@@ -787,6 +787,33 @@
lock = null;
}
+ /**
+ * force unlocking the token, even if the owner is not known. In some
+ * use cases (e.g. in the jbpm esb integration) the lock is persistent,
+ * so a state can be reached where the client needs a possibility to force
+ * unlock of a token without knowing the owner.
+ *
+ * See https://jira.jboss.org/jira/browse/JBPM-1888
+ */
+ public void foreUnlock()
+ {
+ if (lock == null)
+ {
+ log.warn("Unlock of token '" + id + "' forced, but it is not locked");
+ }
+ log.debug("Foce unlock of token[" + id + "] which was locked by " + lock);
+ lock = null;
+ }
+
+ /**
+ * return the current lock owner of the token
+ *
+ * See https://jira.jboss.org/jira/browse/JBPM-1888
+ */
+ public String getLockOwner() {
+ return lock;
+ }
+
public boolean isLocked()
{
return lock != null;
More information about the jbpm-commits
mailing list