2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.config.yang.config.remote_rpc_connector;
11 import akka.actor.ActorSystem;
12 import org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig;
13 import org.opendaylight.controller.remote.rpc.RemoteRpcProviderFactory;
14 import org.opendaylight.controller.sal.core.api.Broker;
15 import org.osgi.framework.BundleContext;
17 public class RemoteRPCBrokerModule extends org.opendaylight.controller.config.yang.config.remote_rpc_connector.AbstractRemoteRPCBrokerModule {
18 private BundleContext bundleContext;
19 public RemoteRPCBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
20 super(identifier, dependencyResolver);
23 public RemoteRPCBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.remote_rpc_connector.RemoteRPCBrokerModule oldModule, java.lang.AutoCloseable oldInstance) {
24 super(identifier, dependencyResolver, oldModule, oldInstance);
28 public void customValidation() {
29 // add custom validation form module attributes here.
33 public boolean canReuseInstance(AbstractRemoteRPCBrokerModule oldModule) {
38 public java.lang.AutoCloseable createInstance() {
39 Broker broker = getDomBrokerDependency();
41 ActorSystem actorSystem = getActorSystemProviderDependency().getActorSystem();
42 RemoteRpcProviderConfig config = new RemoteRpcProviderConfig.Builder(actorSystem.name())
43 .metricCaptureEnabled(getEnableMetricCapture())
44 .mailboxCapacity(getBoundedMailboxCapacity())
47 return RemoteRpcProviderFactory.createInstance(broker, bundleContext, actorSystem, config);
50 public void setBundleContext(BundleContext bundleContext) {
51 this.bundleContext = bundleContext;