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;
13 import javax.management.ObjectName;
15 import org.opendaylight.controller.config.api.ModuleIdentifier;
16 import org.opendaylight.controller.config.api.ValidationException;
17 import org.opendaylight.controller.config.spi.ModuleFactory;
18 import org.osgi.framework.BundleContext;
21 * Defines contract between {@link ConfigTransactionControllerImpl} (producer)
22 * and {@link ConfigRegistryImpl} (consumer).
24 interface ConfigTransactionControllerInternal extends
25 ConfigTransactionControllerImplMXBean {
30 * 1, Copy already committed modules to current transaction.
31 * 2, Diff: compute added and removed factories from last run, then create new modules using
32 * {@link org.opendaylight.controller.config.spi.ModuleFactory#getDefaultModules(org.opendaylight.controller.config.api.DependencyResolverFactory)}
33 * and remove modules belonging to removed factories.
35 void copyExistingModulesAndProcessFactoryDiff(Collection<ModuleInternalInfo> entries, List<ModuleFactory> lastListOfFactories);
38 * Call {@link org.opendaylight.controller.config.spi.Module#validate()} on
39 * all beans in transaction. Lock transaction after successful validation.
40 * This method can be called multiple times if validation fails, but cannot
41 * be called after it did not throw exception.
43 * @throws {@link RuntimeException} if validation fails. It is safe to run
44 * this method in future
47 CommitInfo validateBeforeCommitAndLockTransaction()
48 throws ValidationException;
51 * Call {@link org.opendaylight.controller.config.spi.Module#getInstance()}
52 * on all beans in transaction. This method can be only called once.
54 * @throws {@link RuntimeException} commit fails, indicates bug in config
56 * @return ordered list of module identifiers that respects dependency
59 List<ModuleIdentifier> secondPhaseCommit();
62 * @return ObjectName of this transaction controller
64 ObjectName getControllerObjectName();
67 * @return true iif transaction was committed or aborted.
71 List<ModuleFactory> getCurrentlyRegisteredFactories();
73 BundleContext getModuleFactoryBundleContext(String factoryName);