1 /* 2 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com 3 * The software in this package is published under the terms of the CPAL v1.0 4 * license, a copy of which has been included with this distribution in the 5 * LICENSE.txt file. 6 */ 7 package org.mule.api.retry; 8 9 import org.mule.api.context.WorkManager; 10 11 import java.util.Map; 12 13 14 /** 15 * A RetryPolicyTemplate creates a new {@link RetryPolicy} instance each time the retry goes into effect, 16 * thereby resetting any state the policy may have (counters, etc.) 17 * 18 * A {@link RetryNotifier} may be set in order to take action upon each retry attempt. 19 */ 20 public interface RetryPolicyTemplate 21 { 22 RetryPolicy createRetryInstance(); 23 24 Map<Object, Object> getMetaInfo(); 25 26 void setMetaInfo(Map<Object, Object> metaInfo); 27 28 RetryNotifier getNotifier(); 29 30 void setNotifier(RetryNotifier retryNotifier); 31 32 RetryContext execute(RetryCallback callback, WorkManager workManager) throws Exception; 33 }