<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Yes, exactly. Thanks Manik!<br>
<br>
On 12-09-21 2:34 PM, Manik Surtani wrote:<br>
</div>
<blockquote
cite="mid:6450D5DA-3286-40C0-BC2B-B6A54C33183A@jboss.org"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Looks good, except that the pseudocode for dealing with a
CancellableCommand (on the recipient node) should look like:
<div><br>
</div>
<div>* Receive command</div>
<div>* if CancellableCommand, register with CancellationService</div>
<div>* Perform command</div>
<div>* If CancellableCommand, un-register from CancellationService</div>
<div><br>
</div>
<div>That last step was missing from your detail below. I presume
that would require a CancellationService#unregisterThread(UUID
u) ?</div>
<div><br>
</div>
<div>- Manik</div>
<div><br>
<div>
<div>On 21 Sep 2012, at 11:42, Vladimir Blagojevic <<a
moz-do-not-send="true" href="mailto:vblagoje@redhat.com">vblagoje@redhat.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">Hi,<br>
<br>
I wanted to run by you guys design of command cancellation
Manik and I <br>
talked about recently. For more background regarding this
task read <br>
<a moz-do-not-send="true"
href="https://issues.jboss.org/browse/ISPN-1042">https://issues.jboss.org/browse/ISPN-1042</a><br>
<br>
At originating node I would have each Cancellable command
create its <br>
UUID as part of constructor. After that command gets sent
away to remote <br>
VMs but just before it gets executed there we associated
thread with <br>
UUID by calling CancellationService.registerThread (as a
first line of <br>
code in Command#perform). After registration has been setup
Cancellable <br>
command goes into potentially lengthy (in seconds)
execution. If needed <br>
we would be able to send CancelCommand which would call <br>
CancellationService#cancelTask with UUID. CancelTask would
interrupt the <br>
associated thread.<br>
<br>
WDYT?<br>
<br>
Regards,<br>
Vladimir<br>
<br>
Cancellation of tasks:<br>
<br>
class CancellationService {<br>
UUID registerThread(Thread t, UUID uuid) {<br>
// put thread in map, associate with newly give UUID<br>
}<br>
void cancelTask(UUID uuid) {<br>
// look up thread, interrupt if exists.<br>
}<br>
}<br>
<br>
interface CancellableCommand {<br>
UUID getCommandUUID();<br>
}<br>
<br>
command CancelCommand {<br>
Object perform() {<br>
// Calls CancellationService.cancelTask with UUID. The
UUID is a <br>
parameter of this command.<br>
}<br>
}<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/infinispan-dev">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</blockquote>
</div>
<br>
<div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse:
separate; color: rgb(0, 0, 0); font-family: Helvetica;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; border-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; font-size: medium; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space; "><span
class="Apple-style-span" style="border-collapse:
separate; color: rgb(0, 0, 0); font-family: Helvetica;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; border-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; font-size: medium; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space; "><span
class="Apple-style-span" style="border-collapse:
separate; color: rgb(0, 0, 0); font-family:
Helvetica; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-indent: 0px;
text-transform: none; white-space: normal; widows:
2; word-spacing: 0px; border-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; font-size: medium; ">
<div style="word-wrap: break-word;
-webkit-nbsp-mode: space; -webkit-line-break:
after-white-space; ">
<div>--</div>
<div>Manik Surtani</div>
<div><a moz-do-not-send="true"
href="mailto:manik@jboss.org">manik@jboss.org</a></div>
<div><a moz-do-not-send="true"
href="http://twitter.com/maniksurtani">twitter.com/maniksurtani</a></div>
<div><br>
</div>
<div>
<div>Platform Architect, JBoss Data Grid</div>
<div><a moz-do-not-send="true"
href="http://red.ht/data-grid">http://red.ht/data-grid</a></div>
</div>
</div>
</span></div>
</span></div>
</span>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
infinispan-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/infinispan-dev">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></pre>
</blockquote>
<br>
</body>
</html>