Remove common.actor.ExplicitAsk 81/114281/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 31 Oct 2024 10:33:11 +0000 (11:33 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 31 Oct 2024 10:33:11 +0000 (11:33 +0100)
This class is completely unused, remove it.

Change-Id: Ie67d7757c3500a3c9351e4acc7bec39307222b58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/ExplicitAsk.java [deleted file]

diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/ExplicitAsk.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/ExplicitAsk.java
deleted file mode 100644 (file)
index 97e3c24..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.common.actor;
-
-import java.util.function.Function;
-import org.apache.pekko.actor.ActorRef;
-import org.apache.pekko.actor.ActorSelection;
-import org.apache.pekko.pattern.ExplicitAskSupport;
-import org.apache.pekko.util.Timeout;
-import scala.Function1;
-import scala.concurrent.Future;
-import scala.runtime.AbstractFunction1;
-
-/**
- * Unfortunately Akka's explicit ask pattern does not work with its Java API, as it fails to invoke passed message.
- * In order to make this work for now, we tap directly into ExplicitAskSupport and use a Scala function instead
- * of akka.japi.Function.
- */
-@Deprecated(since = "10.0.5", forRemoval = true)
-public final class ExplicitAsk {
-    private static final ExplicitAskSupport ASK_SUPPORT = org.apache.pekko.pattern.extended.package$.MODULE$;
-
-    private ExplicitAsk() {
-        throw new UnsupportedOperationException();
-    }
-
-    public static <T> Function1<ActorRef, T> toScala(final Function<ActorRef, T> function) {
-        return new AbstractFunction1<>() {
-            @Override
-            public T apply(final ActorRef askSender) {
-                return function.apply(askSender);
-            }
-        };
-    }
-
-    @SuppressWarnings("unchecked")
-    public static Future<Object> ask(final ActorRef actor, final Function1<ActorRef, ?> function,
-            final Timeout timeout) {
-        return ASK_SUPPORT.ask(actor, (Function1<ActorRef, Object>)function, timeout);
-    }
-
-    @SuppressWarnings("unchecked")
-    public static Future<Object> ask(final ActorSelection actor, final Function1<ActorRef, ?> function,
-            final Timeout timeout) {
-        return ASK_SUPPORT.ask(actor, (Function1<ActorRef, Object>)function, timeout);
-    }
-
-    public static Future<Object> ask(final ActorRef actor, final Function<ActorRef, ?> function,
-            final Timeout timeout) {
-        return ask(actor, toScala(function), timeout);
-    }
-
-    public static Future<Object> ask(final ActorSelection actor, final Function<ActorRef, ?> function,
-            final Timeout timeout) {
-        return ask(actor, toScala(function), timeout);
-    }
-}