class RetryStrategy implements Serializable {

    public void errorOccured() throws Exception {
        numberOfTriesLeft--;
        if (!shouldRetry()) {
            throw new Exception("Retry Failed: Total " + numberOfRetries
                    + " attempts made at interval " + getTimeToWait()
                    + "ms");
        }
        waitUntilNextTry();
    }

    public  RetryStrategy();
    public  RetryStrategy(int numberOfRetries, long timeToWait);

}