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;
20 * Defines contract between {@link ConfigTransactionControllerImpl} (producer)
21 * and {@link ConfigRegistryImpl} (consumer).
23 interface ConfigTransactionControllerInternal extends
24 ConfigTransactionControllerImplMXBean {
29 * 1, Copy already committed modules to current transaction.
30 * 2, Diff: compute added and removed factories from last run, then create new modules using
31 * {@link org.opendaylight.controller.config.spi.ModuleFactory#getDefaultModules(org.opendaylight.controller.config.api.DependencyResolverFactory)}
32 * and remove modules belonging to removed factories.
34 void copyExistingModulesAndProcessFactoryDiff(Collection<ModuleInternalInfo> entries, List<ModuleFactory> lastListOfFactories);
37 * Call {@link org.opendaylight.controller.config.spi.Module#validate()} on
38 * all beans in transaction. Lock transaction after successful validation.
39 * This method can be called multiple times if validation fails, but cannot
40 * be called after it did not throw exception.
42 * @throws {@link RuntimeException} if validation fails. It is safe to run
43 * this method in future
46 CommitInfo validateBeforeCommitAndLockTransaction()
47 throws ValidationException;
50 * Call {@link org.opendaylight.controller.config.spi.Module#getInstance()}
51 * on all beans in transaction. This method can be only called once.
53 * @throws {@link RuntimeException} commit fails, indicates bug in config
55 * @return ordered list of module identifiers that respects dependency
58 List<ModuleIdentifier> secondPhaseCommit();
61 * @return ObjectName of this transaction controller
63 ObjectName getControllerObjectName();
66 * @return true iif transaction was committed or aborted.
70 List<ModuleFactory> getCurrentlyRegisteredFactories();