2 * Copyright (c) 2013 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
11 * Generated from: yang module name: config-programming-impl yang module local name: instruction-scheduler-impl
12 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
13 * Generated at: Mon Nov 18 16:50:17 CET 2013
15 * Do not modify this file unless it is present under src/main directory
17 package org.opendaylight.controller.config.yang.programming.impl;
19 import com.google.common.util.concurrent.ListenableFuture;
20 import com.google.common.util.concurrent.ListeningExecutorService;
21 import com.google.common.util.concurrent.MoreExecutors;
22 import java.util.concurrent.Executors;
23 import org.opendaylight.bgpcep.programming.impl.ProgrammingServiceImpl;
24 import org.opendaylight.bgpcep.programming.spi.Instruction;
25 import org.opendaylight.bgpcep.programming.spi.InstructionScheduler;
26 import org.opendaylight.bgpcep.programming.spi.SchedulerException;
27 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev130930.ProgrammingService;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev130930.SubmitInstructionInput;
34 public final class InstructionSchedulerImplModule extends
35 org.opendaylight.controller.config.yang.programming.impl.AbstractInstructionSchedulerImplModule {
37 public InstructionSchedulerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
38 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
39 super(identifier, dependencyResolver);
42 public InstructionSchedulerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
43 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
44 final InstructionSchedulerImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
45 super(identifier, dependencyResolver, oldModule, oldInstance);
49 protected void customValidation() {
50 // Add custom validation for module attributes here.
54 public java.lang.AutoCloseable createInstance() {
55 final ListeningExecutorService exec = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
57 final ProgrammingServiceImpl inst = new ProgrammingServiceImpl(getDataProviderDependency(), getNotificationServiceDependency(), exec, getTimerDependency());
59 final RpcRegistration<ProgrammingService> reg = getRpcRegistryDependency().addRpcImplementation(ProgrammingService.class, inst);
61 final class ProgrammingServiceImplCloseable implements InstructionScheduler, AutoCloseable {
76 public ListenableFuture<Instruction> scheduleInstruction(final SubmitInstructionInput input) throws SchedulerException {
77 return inst.scheduleInstruction(input);
81 return new ProgrammingServiceImplCloseable();