[concurrency-interest] Fwd: ScheduledThreadPoolExecutor woes

Hanson Char hanson.char at gmail.com
Tue Feb 13 15:43:35 EST 2007


AbstractRetryPolicy has no problem compiling in Java 5 and 6, it's the
RetryPolicies that is having problem.  See below my reversed engineered
version of AbstractRetryPolicy.

I also put it under package net.jcip.retry , instead of the default
namespace.

H

package net.jcip.retry;

/**
 * @author Josh Bloch
 * @author Hanson Char - fill in the missing pieces
 */
// https://dev.priorartisans.com/repos/jcip/trunk/src/main/jcip/retry/
public abstract class AbstractRetryPolicy implements RetryPolicy
{
    private final Class<? extends Exception>[] recoverableExceptions;

    public AbstractRetryPolicy(Class<? extends Exception>[]
recoverableExceptions)
    {
        this.recoverableExceptions = recoverableExceptions;
    }

    public abstract long nextDelay(long startTime, int retries);

    public boolean isFailureRecoverable(Exception e)
    {
        for (Class<? extends Exception> c : recoverableExceptions)
            if (c.isAssignableFrom(e.getClass()))
                return true;
        return false;
    }
}


On 2/13/07, Tim Peierls <tim at peierls.net> wrote:
>
> I can do this
>
>    1. when I have time and
>    2. if Brian thinks it's reasonable and
>    3. if no one thinks of a better place and
>    4. if someone can provide an AbstractRetryPolicy that compiles under
>    both Java 5 and 6 (which might involve modifications to RetryPolicy and/or
>    RetryPolicies).
>
> --tim
>
> On 2/12/07, Hanson Char <hanson.char at gmail.com> wrote:
> >
> > Also, it would be really nice if the javadoc of the retry related
> > classes can be published somewhere at jcip similar to the one for the
> > annotations:
> >
> >   http://jcip.net/annotations/doc/
> >
> > Hanson
> >
> > On 2/7/07, Hanson Char < hanson.char at gmail.com> wrote:
> > >
> > > Excellent!  The existing RetryPolicies compiles only under Java 5 (not
> > > Java 6).  I've fixed up a version that preserves all the generics but
> > > compiles only under Java 6.  Can send you a copy if interested.
> > >
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20070213/115f9c2f/attachment.html 


More information about the Concurrency-interest mailing list