2 * Copyright (c) 2013, 2017 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.manager.impl;
10 import java.util.Collection;
11 import java.util.List;
12 import javax.management.ObjectName;
13 import org.opendaylight.controller.config.api.ModuleIdentifier;
14 import org.opendaylight.controller.config.api.ValidationException;
15 import org.opendaylight.controller.config.spi.ModuleFactory;
16 import org.osgi.framework.BundleContext;
19 * Defines contract between {@link ConfigTransactionControllerImpl} (producer)
20 * and {@link ConfigRegistryImpl} (consumer).
22 interface ConfigTransactionControllerInternal extends ConfigTransactionControllerImplMXBean, AutoCloseable {
25 * 1, Copy already committed modules to current transaction. 2, Diff: compute
26 * added and removed factories from last run, then create new modules using
27 * {@link org.opendaylight.controller.config.spi
28 * .ModuleFactory#getDefaultModules(org.opendaylight.controller
29 * .config .api.DependencyResolverFactory, BundleContext)}
30 * and remove modules belonging to removed factories.
34 * @param lastListOfFactories
37 void copyExistingModulesAndProcessFactoryDiff(Collection<ModuleInternalInfo> entries,
38 List<ModuleFactory> lastListOfFactories);
41 * Call {@link org.opendaylight.controller.config.spi.Module#validate()} on all
42 * beans in transaction. Lock transaction after successful validation. This
43 * method can be called multiple times if validation fails, but cannot be called
44 * after it did not throw exception.
46 * @return CommitInfo commit info
48 CommitInfo validateBeforeCommitAndLockTransaction() throws ValidationException;
51 * Call {@link org.opendaylight.controller.config.spi.Module#getInstance()} on
52 * all beans in transaction. This method can be only called once.
54 * @return ordered list of module identifiers that respects dependency order
56 List<ModuleIdentifier> secondPhaseCommit();
59 * Gets the objectName of this transaction controller.
63 ObjectName getControllerObjectName();
66 * Check if the transaction was committed or aborted.
68 * @return result of transaction
72 List<ModuleFactory> getCurrentlyRegisteredFactories();
74 BundleContext getModuleFactoryBundleContext(String factoryName);
76 SearchableServiceReferenceWritableRegistry getWritableRegistry();
78 TransactionIdentifier getTransactionIdentifier();