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
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
23 ConfigTransactionControllerImplMXBean, AutoCloseable {
28 * 1, Copy already committed modules to current transaction.
29 * 2, Diff: compute added and removed factories from last run, then create new modules using
30 * {@link org.opendaylight.controller.config.spi.ModuleFactory#getDefaultModules(org.opendaylight.controller.config.api.DependencyResolverFactory)}
31 * and remove modules belonging to removed factories.
33 void copyExistingModulesAndProcessFactoryDiff(Collection<ModuleInternalInfo> entries, List<ModuleFactory> lastListOfFactories);
36 * Call {@link org.opendaylight.controller.config.spi.Module#validate()} on
37 * all beans in transaction. Lock transaction after successful validation.
38 * This method can be called multiple times if validation fails, but cannot
39 * be called after it did not throw exception.
41 * @throws {@link RuntimeException} if validation fails. It is safe to run
42 * this method in future
45 CommitInfo validateBeforeCommitAndLockTransaction()
46 throws ValidationException;
49 * Call {@link org.opendaylight.controller.config.spi.Module#getInstance()}
50 * on all beans in transaction. This method can be only called once.
52 * @throws {@link RuntimeException} commit fails, indicates bug in config
54 * @return ordered list of module identifiers that respects dependency
57 List<ModuleIdentifier> secondPhaseCommit();
60 * @return ObjectName of this transaction controller
62 ObjectName getControllerObjectName();
65 * @return true iif transaction was committed or aborted.
69 List<ModuleFactory> getCurrentlyRegisteredFactories();
71 BundleContext getModuleFactoryBundleContext(String factoryName);
73 SearchableServiceReferenceWritableRegistry getWritableRegistry();
75 TransactionIdentifier getTransactionIdentifier();