接口的定义的例子
package com.aliyun.openservices.ons.api;
/**
* 消息監聽器,Consumer注冊消息監聽器來訂閱消息
*/
public interface MessageListener {
/**
* 消費消息接口,由應用來實現<br>
*
* @param message
* 消息
* @param context
* 消費上下文
*
* @return 消費結果,如果應用拋出異常或者返回Null等價于返回Action.ReconsumeLater
*/
public Action consume(final Message message, final ConsumeContext context);
}
/**
* 消息監聽器,Consumer注冊消息監聽器來訂閱消息
*/
public interface MessageListener {
/**
* 消費消息接口,由應用來實現<br>
*
* @param message
* 消息
* @param context
* 消費上下文
*
* @return 消費結果,如果應用拋出異常或者返回Null等價于返回Action.ReconsumeLater
*/
public Action consume(final Message message, final ConsumeContext context);
}
轉載于:https://www.cnblogs.com/codething/p/8465878.html
總結
- 上一篇: hadoop之 参数调优
- 下一篇: 如何处理日志文件丢失