<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 1 Jun 2012, at 16:21, Vladimir Blagojevic wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div bgcolor="#FFFFFF" text="#000000">
On 12-06-01 4:49 AM, Manik Surtani wrote:
<blockquote cite="mid:4BB3C73F-61A4-459E-96DF-5A86783CAC0B@jboss.org" type="cite">
<pre wrap="">We should update the interface then to indicate how you intend to make the ExecutorService made available to implementations. :)
</pre>
</blockquote>
<br>
We can provide
setDistributedExecutorService(DistributedExecutorService service)
method on DistributedTaskFailoverPolicy interface? However, users
can rather easily construct their own impl of
DistributedTaskFailoverPolicy by passing instance of readily
available DistributedExecutorService through a
DistributedTaskFailoverPolicy constructor for example. The downside
is that only programmatic configuration would work in this case. If
we have set method contract then we can setup custom task failover
through xml configuration. WDYT?<br></div></blockquote><div><br></div><div>+1 to having a policy that can be configured via XML.</div><br><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000">
<blockquote cite="mid:4BB3C73F-61A4-459E-96DF-5A86783CAC0B@jboss.org" type="cite">
<pre wrap=""></pre>
<blockquote type="cite">
<pre wrap=""></pre>
<blockquote type="cite">
<pre wrap="">* Do you plan to include any canned failover policies? If so, what are these?
</pre>
</blockquote>
<pre wrap="">Yes, at least random and never failover policy.
</pre>
<blockquote type="cite">
<pre wrap="">* Shouldn't DistributedTaskFailoverPolicy be parameterised to return the same type as DistributedFuture.get() rather than an untyped Object?
</pre>
</blockquote>
<pre wrap="">I would love to make it but how can we do it? DefaultExecutorService is not typed and method of DistributedTaskFailoverPolicy is not either.
</pre>
</blockquote>
<pre wrap="">Can DTFP not be typed? And even our sub-interface of ExecutorService?
</pre>
</blockquote>
I am not sure if we should type our sub interface of
ExecutorService. Although I do not know how to argue against it, all
sub interfaces and impls I have seen use generic methods. Probably
because generic methods give you more flexibility. So yes DTFP can
by typed albeit not a very useful thing as DTFP should deal with
generic type T rather than particular type. I think there is no need
to type the interface when we can type method in DTFP.
<meta charset="utf-8">
<span style="color: rgb(0, 0, 0); font-family: 'Myriad Pro',
Verdana, Tahoma, Arial; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: left; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); font-size: medium; display:
inline !important; float: none; ">Also up until today I thought
that generic method can infer its parameter type from its argument
type only. However, even this works</span><span style="color:
rgb(0, 0, 0); font-family: 'Myriad Pro', Verdana, Tahoma, Arial;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); font-size: medium; ">:<br>
<br>
<T> T foo(){...}<br>
<br>
Pretty cool! <br></span></div></blockquote><div><br></div><div>Do you have an example of what you are proposing by inferring its type?</div></div><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: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div><br></div><div>--</div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div><a href="http://twitter.com/maniksurtani">twitter.com/maniksurtani</a></div><div><br></div><div>Lead, Infinispan</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline">
</div>
<br></body></html>