BUG-2299: allow PCEP extensions to be reconfigured
[bgpcep.git] / pcep / spi / src / main / java / org / opendaylight / controller / config / yang / pcep / spi / SimplePCEPExtensionProviderContextModule.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 /**
9  * Generated file
10
11  * Generated from: yang module name: config-pcep-spi  yang module local name: pcep-extensions-impl
12  * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
13  * Generated at: Mon Nov 18 14:32:53 CET 2013
14  *
15  * Do not modify this file unless it is present under src/main directory
16  */
17 package org.opendaylight.controller.config.yang.pcep.spi;
18
19
20 /**
21  *
22  */
23 public final class SimplePCEPExtensionProviderContextModule extends
24         org.opendaylight.controller.config.yang.pcep.spi.AbstractSimplePCEPExtensionProviderContextModule {
25
26     public SimplePCEPExtensionProviderContextModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
27             final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
28         super(identifier, dependencyResolver);
29     }
30
31     public SimplePCEPExtensionProviderContextModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
32             final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
33             final SimplePCEPExtensionProviderContextModule oldModule, final java.lang.AutoCloseable oldInstance) {
34         super(identifier, dependencyResolver, oldModule, oldInstance);
35     }
36
37     @Override
38     public boolean canReuseInstance(final AbstractSimplePCEPExtensionProviderContextModule oldModule) {
39         return oldModule.getInstance().getClass().equals(ReusablePCEPExtensionProviderContext.class);
40     };
41
42     @Override
43     public java.lang.AutoCloseable reuseInstance(final java.lang.AutoCloseable oldInstance) {
44         final ReusablePCEPExtensionProviderContext ctx = (ReusablePCEPExtensionProviderContext) oldInstance;
45         ctx.reconfigure(getExtensionDependency());
46         return ctx;
47     }
48
49     @Override
50     public java.lang.AutoCloseable createInstance() {
51         final ReusablePCEPExtensionProviderContext ctx = new ReusablePCEPExtensionProviderContext();
52         ctx.start(getExtensionDependency());
53         return ctx;
54     }
55 }