2 * Copyright (c) 2014 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
8 package org.opendaylight.controller.config.yang.md.sal.remote.rpc;
10 import org.opendaylight.controller.sal.connector.remoterpc.*;
11 import org.opendaylight.controller.sal.core.api.Broker;
12 import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry;
13 import org.osgi.framework.BundleContext;
18 public final class ZeroMQServerModule extends org.opendaylight.controller.config.yang.md.sal.remote.rpc.AbstractZeroMQServerModule
21 private static final Integer ZEROMQ_ROUTER_PORT = 5554;
22 private BundleContext bundleContext;
24 public ZeroMQServerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
25 super(identifier, dependencyResolver);
28 public ZeroMQServerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
29 ZeroMQServerModule oldModule, java.lang.AutoCloseable oldInstance) {
31 super(identifier, dependencyResolver, oldModule, oldInstance);
35 protected void customValidation(){
36 // Add custom validation for module attributes here.
40 public java.lang.AutoCloseable createInstance() {
42 Broker broker = getDomBrokerDependency();
44 final int port = getPort() != null ? getPort() : ZEROMQ_ROUTER_PORT;
46 ServerImpl serverImpl = new ServerImpl(port);
48 ClientImpl clientImpl = new ClientImpl();
50 RoutingTableProvider provider = new RoutingTableProvider(bundleContext);//,serverImpl);
53 facade.setRoutingTableProvider(provider );
54 facade.setContext(bundleContext);
55 facade.setRpcProvisionRegistry((RpcProvisionRegistry) broker);
57 broker.registerProvider(facade, bundleContext);
61 public void setBundleContext(BundleContext bundleContext) {
62 this.bundleContext = bundleContext;