diff --git a/src/org/redkale/util/AsyncHandler.java b/src/org/redkale/util/AsyncHandler.java deleted file mode 100644 index 03c2483c1..000000000 --- a/src/org/redkale/util/AsyncHandler.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.redkale.util; - -import java.util.function.BiConsumer; -import java.nio.channels.CompletionHandler; -import java.util.function.*; - -/** - * 异步回调函数 - * - * - *

- * 详情见: https://redkale.org - * - * @deprecated 使用 java.nio.channels.CompletionHandler 代替 - * @author zhangjx - * @param 结果对象的泛型 - * @param 附件对象的泛型 - */ -@Deprecated -public interface AsyncHandler extends CompletionHandler { - - /** - * 创建 AsyncHandler 对象 - * - * @param 结果对象的泛型 - * @param 附件对象的泛型 - * @param success 成功的回调函数 - * @param fail 失败的回调函数 - * - * @return AsyncHandler - */ - public static AsyncHandler create(final BiConsumer success, final BiConsumer fail) { - return new AsyncHandler() { - @Override - public void completed(V result, A attachment) { - if (success != null) success.accept(result, attachment); - } - - @Override - public void failed(Throwable exc, A attachment) { - if (fail != null) fail.accept(exc, attachment); - } - }; - } - - /** - * 创建没有返回结果的 AsyncHandler 对象 - * - * @param 附件对象的泛型 - * @param success 成功的回调函数 - * @param fail 失败的回调函数 - * - * @return AsyncHandler - */ - public static AsyncHandler create(final Consumer success, final BiConsumer fail) { - return new AsyncHandler() { - @Override - public void completed(Void result, A attachment) { - if (success != null) success.accept(attachment); - } - - @Override - public void failed(Throwable exc, A attachment) { - if (fail != null) fail.accept(exc, attachment); - } - }; - } - - /** - * 创建没有附件对象的 AsyncNoResultHandler 对象 - * - * @param 结果对象的泛型 - * @param success 成功的回调函数 - * @param fail 失败的回调函数 - * - * @return AsyncHandler - */ - public static AsyncHandler create(final Consumer success, final Consumer fail) { - return new AsyncHandler() { - @Override - public void completed(V result, Void attachment) { - if (success != null) success.accept(result); - } - - @Override - public void failed(Throwable exc, Void attachment) { - if (fail != null) fail.accept(exc); - } - }; - } - -} diff --git a/src/org/redkale/util/ObjectPool.java b/src/org/redkale/util/ObjectPool.java index da6d94bd4..d94f32d02 100644 --- a/src/org/redkale/util/ObjectPool.java +++ b/src/org/redkale/util/ObjectPool.java @@ -98,11 +98,6 @@ public final class ObjectPool implements Supplier, Consumer { } } - @Deprecated - public void offer(final T e) { - accept(e); - } - public long getCreatCount() { return creatCounter.longValue(); }