2 * Copyright (c) 2015 Cisco Systems. 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.groupbasedpolicy.renderer.iovisor;
11 import java.util.concurrent.Executors;
12 import java.util.concurrent.ScheduledExecutorService;
14 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
15 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
16 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
21 * Renderer that converts GBP services to IOVisor Agents
23 public class IovisorRenderer implements AutoCloseable {
25 private static final Logger LOG = LoggerFactory.getLogger(IovisorRenderer.class);
27 private final DataBroker dataBroker;
28 private final ScheduledExecutorService executor;
31 public IovisorRenderer(final DataBroker dataProvider, RpcProviderRegistry rpcRegistry,
32 NotificationService notificationService) {
34 this.dataBroker = dataProvider;
36 int numCPU = Runtime.getRuntime().availableProcessors();
37 executor = Executors.newScheduledThreadPool(numCPU * 2);
39 LOG.info("IOVisor Renderer has Started");
43 public void close() throws Exception {
44 executor.shutdownNow();