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;
23 import java.util.concurrent.Executors;
25 import org.opendaylight.bgpcep.programming.impl.ProgrammingServiceImpl;
26 import org.opendaylight.bgpcep.programming.spi.Instruction;
27 import org.opendaylight.bgpcep.programming.spi.InstructionScheduler;
28 import org.opendaylight.bgpcep.programming.spi.SchedulerException;
29 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev130930.ProgrammingService;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev130930.SubmitInstructionInput;
36 public final class InstructionSchedulerImplModule extends
37 org.opendaylight.controller.config.yang.programming.impl.AbstractInstructionSchedulerImplModule {
39 public InstructionSchedulerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
40 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
41 super(identifier, dependencyResolver);
44 public InstructionSchedulerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
45 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
46 final InstructionSchedulerImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
47 super(identifier, dependencyResolver, oldModule, oldInstance);
51 protected void customValidation() {
52 // Add custom validation for module attributes here.
56 public java.lang.AutoCloseable createInstance() {
57 final ListeningExecutorService exec = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
59 final ProgrammingServiceImpl inst = new ProgrammingServiceImpl(getDataProviderDependency(), getNotificationServiceDependency(), exec, getTimerDependency());
61 final RpcRegistration<ProgrammingService> reg = getRpcRegistryDependency().addRpcImplementation(ProgrammingService.class, inst);
63 final class ProgrammingServiceImplCloseable implements InstructionScheduler, AutoCloseable {
65 public void close() throws Exception {
78 public ListenableFuture<Instruction> scheduleInstruction(final SubmitInstructionInput input) throws SchedulerException {
79 return inst.scheduleInstruction(input);
83 return new ProgrammingServiceImplCloseable();