本文整理汇总了Java中org.springframework.retry.annotation.Recover类的典型用法代码示例。如果您正苦于以下问题:Java Recover类的具体用法?Java Recover怎么用?Java Recover使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Recover类属于org.springframework.retry.annotation包,在下文中一共展示了Recover类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: logNotificationFailure
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
@Recover
public void logNotificationFailure(
NotificationException exception,
String targetEmail,
String emailTemplateId,
Map<String, String> parameters,
String reference
) {
String errorMessage = String.format(
"Failure: failed to send notification (%s to %s) due to %s",
reference,
targetEmail,
exception.getMessage()
);
logger.info(errorMessage, exception);
}
示例2: logNotificationFailure
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
@Recover
public void logNotificationFailure(
NotificationException exception,
Claim claim,
String targetEmail,
String pin,
String emailTemplateId,
String reference,
String submitterName
) {
String errorMessage = "Failure: "
+ " failed to send notification (" + reference
+ " to " + targetEmail + ") "
+ " due to " + exception.getMessage();
logger.info(errorMessage, exception);
}
示例3: logNotificationFailure
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
@Recover
public void logNotificationFailure(
NotificationException exception,
String targetEmail,
String emailTemplate,
Map<String, String> parameters,
String reference
) {
String errorMessage = String.format(
"Failure: failed to send notification ( %s to %s ) due to %s",
reference, targetEmail, exception.getMessage()
);
logger.info(errorMessage, exception);
}
示例4: logNotificationFailure
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
@Recover
public void logNotificationFailure(
NotificationException exception,
Claim claim,
String targetEmail,
String emailTemplate,
String reference
) {
String errorMessage = String.format(
"Failure: failed to send notification ( %s to %s ) due to %s",
reference, targetEmail, exception.getMessage()
);
logger.info(errorMessage, exception);
}
示例5: logSendMessageWithAttachmentFailure
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
@Recover
public void logSendMessageWithAttachmentFailure(RuntimeException exception, EmailData emailData) {
String errorMessage = String.format(
"sendEmail failure: failed to send email with details: %s due to %s",
emailData.toString(), exception.getMessage()
);
logger.error(errorMessage, exception);
}
示例6: revocer
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
@Recover
public void revocer(RemoteAccessException e) {
System.err.println("------ 最终处理 ------:" + e.getMessage());
}
示例7: fallbackForCall
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
/**
* The recover method needs to have same return type and parameters.
*
* @return
*/
@Recover
private boolean fallbackForCall() {
logger.error("Fallback for mail service call invoked, mail service is NOT reachable");
return false;
}
示例8: recover
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
@Recover
public void recover(TccCoordinatorException e) {
System.out.println(e.getMessage());
}
示例9: recover1
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
@Recover
public void recover1(RemoteAccessException e) {
System.out.println(e.getMessage());
System.out.println("do recover operation1");
}
示例10: recover2
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
@Recover
public void recover2(RuntimeException e) {
System.out.println(e.getMessage());
System.out.println("do recover operation2");
}
示例11: recover3
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
@Recover
public void recover3(RemoteAccessException e) {
System.out.println(e.getMessage());
System.out.println("do recover operation3");
}
示例12: logException
import org.springframework.retry.annotation.Recover; //导入依赖的package包/类
/**
* 重试继续失败
* @param e e
* @param <T> T
* @return error
* @throws ValidateException exception
*/
@Recover
public <T> T logException(ValidateException e) throws ValidateException {
LOGGER.error(e.getMessage(), e);
throw e;
}