X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fdom%2Fbroker%2FBrokerImpl.xtend;h=0ed14c1027905f22fff667201d5a3294ed6afc56;hp=64de8683d1d1a8a5c3854aa5f55e6b907852c448;hb=26da3c2a206a753356b507b018052cbb9cccca7d;hpb=5b16b5aa030d26cbf2c6dc17b3f7a530fbdb987f diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.xtend b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.xtend index 64de8683d1..0ed14c1027 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.xtend +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.xtend @@ -7,13 +7,11 @@ */ package org.opendaylight.controller.sal.dom.broker; +import com.google.common.util.concurrent.ListenableFuture import java.util.Collections import java.util.HashSet import java.util.Set -import java.util.concurrent.Callable -import java.util.concurrent.ExecutorService -import java.util.concurrent.Executors -import java.util.concurrent.Future +import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener import org.opendaylight.controller.sal.core.api.Broker import org.opendaylight.controller.sal.core.api.Consumer import org.opendaylight.controller.sal.core.api.Provider @@ -26,7 +24,6 @@ import org.opendaylight.controller.sal.dom.broker.spi.RpcRouter import org.opendaylight.controller.sal.core.api.RpcRegistrationListener import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry import org.opendaylight.controller.sal.core.api.RpcImplementation -import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener import org.opendaylight.controller.sal.core.api.RpcRoutingContext import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier import org.opendaylight.controller.sal.core.api.RoutedRpcDefaultImplementation @@ -39,12 +36,9 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable { private val Set providerSessions = Collections.synchronizedSet( new HashSet()); - // Implementation specific - @Property - private var ExecutorService executor = Executors.newFixedThreadPool(5); @Property private var BundleContext bundleContext; - + @Property private var AutoCloseable deactivator; @@ -69,9 +63,8 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable { return session; } - protected def Future> invokeRpcAsync(QName rpc, CompositeNode input) { - val result = executor.submit([|router.invokeRpc(rpc, input)] as Callable>); - return result; + protected def ListenableFuture> invokeRpcAsync(QName rpc, CompositeNode input) { + return router.invokeRpc(rpc, input); } // Validation @@ -111,15 +104,15 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable { sessions.remove(consumerContextImpl); providerSessions.remove(consumerContextImpl); } - + override close() throws Exception { deactivator?.close(); } - + override addRpcImplementation(QName rpcType, RpcImplementation implementation) throws IllegalArgumentException { router.addRpcImplementation(rpcType,implementation); } - + override addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation) { router.addRoutedRpcImplementation(rpcType,implementation); } @@ -131,17 +124,17 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable { override addRpcRegistrationListener(RpcRegistrationListener listener) { return router.addRpcRegistrationListener(listener); } - + override > registerRouteChangeListener(L listener) { return router.registerRouteChangeListener(listener); } - override invokeRpc(QName rpc,CompositeNode input){ - return router.invokeRpc(rpc,input) - } - override getSupportedRpcs() { return router.getSupportedRpcs(); } - + + override invokeRpc(QName rpc, CompositeNode input) { + return router.invokeRpc(rpc,input) + } + }