Merge "Bug 615: Removed xtend from Topology Manager"
authorEd Warnicke <eaw@cisco.com>
Wed, 16 Apr 2014 16:55:24 +0000 (16:55 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 16 Apr 2014 16:55:24 +0000 (16:55 +0000)
392 files changed:
.gitignore
opendaylight/clustering/services_implementation/pom.xml
opendaylight/clustering/services_implementation/src/main/java/org/infinispan/interceptors/distribution/BaseDistributionInterceptor.java [deleted file]
opendaylight/clustering/services_implementation/src/main/resources/config/infinispan-config.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/commons/protocol-framework/pom.xml
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java
opendaylight/config/config-module-archetype/src/main/resources/archetype-resources/pom.xml
opendaylight/config/config-persister-directory-xml-adapter/pom.xml
opendaylight/config/config-persister-directory-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/directory/xml/DirectoryStorageAdapterTest.java
opendaylight/config/config-persister-file-xml-adapter/pom.xml
opendaylight/config/config-persister-file-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/file/xml/FileStorageAdapterTest.java
opendaylight/config/config-plugin-parent/pom.xml
opendaylight/config/logback-config/pom.xml
opendaylight/config/netty-threadgroup-config/pom.xml
opendaylight/config/pom.xml
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/async/AsyncEventBusConfigBeanTest.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/eventbus/TestingEventBusModule.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/FixedThreadPoolConfigBeanTest.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/TestingFixedThreadPoolModule.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/flexible/FlexibleThreadPoolConfigBeanTest.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/NamingThreadPoolFactoryConfigBeanTest.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/TestingNamingThreadPoolFactoryModule.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/ScheduledThreadPoolConfigBeanTest.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/TestingScheduledThreadPoolModule.java
opendaylight/config/yang-jmx-generator-plugin/pom.xml
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/CodeWriter.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/FreeMarkerCodeWriterImpl.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGenerator.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFactoryTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFtlTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractModuleTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersister.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubFactoryTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubModuleTemplate.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/TemplateFactory.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/AnnotationsDirective.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/ConstructorsDirective.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/FieldsDirectiveProg.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/FieldsDirectiveTemplate.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/HeaderDirective.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/JavadocDirective.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/MethodsDirective.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/ModuleFieldsDirective.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/TypeDeclarationDirective.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/UnimplementedExceptionDirective.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Annotation.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/AnnotationSerializer.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Constructor.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ConstructorSerializer.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Field.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/FieldSerializer.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Header.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/HeaderSerializer.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDeclaration.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDefinition.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodSerializer.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleField.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleFieldSerializer.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/TypeDeclaration.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/AbsFactoryGeneratedObjectFactory.groovy [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/AbsModuleGeneratedObjectFactory.groovy [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/ConcreteModuleGeneratedObjectFactory.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/GenericGeneratedObjectFactory.groovy [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/FullyQualifiedName.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObject.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObjectBuilder.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInput.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInputBuilder.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/TypeName.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtil.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/resources/copyright.txt [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/abstract_ftl_file.ftl [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/factory_abs_template.ftl [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/module_abs_template_new.ftl [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/main/resources/freeMarker/module_stub_template.ftl [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ModuleMXBeanEntryTemplatesTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/RuntimeRegistratorFtlFileTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersisterTest.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/AbstractGeneratedObjectTest.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/abs/AbsModuleGeneratedObjectFactoryTest.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/concrete/ConcreteModuleGeneratedObjectFactoryTest.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/FormattingUtil.java [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtilTest.java [new file with mode: 0644]
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/AbstractYangTest.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryTest.java
opendaylight/config/yang-test-plugin/pom.xml
opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/ProcessSources.java
opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/Util.java
opendaylight/config/yang-test-plugin/src/main/resources/Header.txt [deleted file]
opendaylight/config/yang-test/pom.xml
opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/DepTestImplModule.java
opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/DepTestImplModuleFactory.java
opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/IdentityTestModule.java
opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/IdentityTestModuleFactory.java
opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModule.java
opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModuleFactory.java
opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/TestImplModule.java
opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/impl/TestImplModuleFactory.java
opendaylight/distribution/opendaylight/pom.xml
opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
opendaylight/distribution/opendaylight/src/main/resources/run.bat
opendaylight/distribution/opendaylight/src/main/resources/run.sh
opendaylight/forwardingrulesmanager/api/pom.xml
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManager.java
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java
opendaylight/md-sal/compatibility/flow-management-compatibility/pom.xml
opendaylight/md-sal/compatibility/inventory-topology-compatibility/pom.xml
opendaylight/md-sal/forwardingrules-manager/pom.xml
opendaylight/md-sal/inventory-manager/pom.xml
opendaylight/md-sal/model/pom.xml
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-binding-broker/pom.xml
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/AbstractForwardedDataBroker.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/AbstractForwardedTransaction.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingToNormalizedNodeCodec.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ForwardedBackwardsCompatibleDataBroker.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LegacyDataChangeEvent.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.xtend [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/YangtoolsMappingHelper.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/YangtoolsMappingHelper.xtend [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.xtend [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataBrokerImpl.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/MountPointManagerImpl.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationBrokerImpl.xtend
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProxyContext.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProxyContext.xtend [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/BindingIndependentConnector.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/BindingAwareDataReaderRouter.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/BindingAwareDataReaderRouter.xtend [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/MapUtils.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/util/MapUtils.xtend [deleted file]
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/RuntimeCodeGeneratorTest.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/mock/ReferencableObject.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java
opendaylight/md-sal/sal-binding-config/pom.xml
opendaylight/md-sal/sal-binding-dom-it/pom.xml
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/WildcardedDataChangeListenerTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java
opendaylight/md-sal/sal-binding-it/pom.xml
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizationException.java [new file with mode: 0644]
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizationOperation.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizer.java
opendaylight/md-sal/sal-dom-api/pom.xml
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/RoutedRpcDefaultImplementation.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/RpcImplementation.java
opendaylight/md-sal/sal-dom-broker/pom.xml
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/compat/BackwardsCompatibleTransaction.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DOMImmutableDataChangeEvent.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataChangeEventResolver.java [deleted file]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/MutableDataTree.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ResolveDataChangeEventsTask.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/StoreUtils.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/ListenerRegistrationNode.java [deleted file]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/ListenerTree.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/NodeModification.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.xtend
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareRpcBroker.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/RpcProvisionRegistryProxy.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RoutedRpcProcessor.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RpcRouter.java
opendaylight/md-sal/sal-netconf-connector/pom.xml
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/InventoryUtils.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.xtend
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceListener.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfInventoryUtils.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfMapping.xtend
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfRemoteSchemaSourceProvider.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/UncancellableFuture.java [new file with mode: 0644]
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/YangModelInputStreamAdapter.java [deleted file]
opendaylight/md-sal/sal-remote/pom.xml
opendaylight/md-sal/sal-remoterpc-connector/implementation/pom.xml
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImpl.java
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ServerImpl.java
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImplTest.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend
opendaylight/md-sal/sal-restconf-broker/pom.xml
opendaylight/md-sal/samples/l2switch/model/pom.xml
opendaylight/md-sal/samples/toaster-consumer/pom.xml
opendaylight/md-sal/samples/toaster-it/pom.xml
opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java
opendaylight/md-sal/samples/toaster-provider/pom.xml
opendaylight/md-sal/samples/toaster/pom.xml
opendaylight/md-sal/statistics-manager/pom.xml
opendaylight/md-sal/topology-lldp-discovery/pom.xml
opendaylight/md-sal/topology-manager/pom.xml
opendaylight/netconf/config-netconf-connector/pom.xml
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/CompositeAttributeWritingStrategy.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/ObjectNameAttributeWritingStrategy.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/RuntimeBeanEntryWritingStrategy.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleAttributeWritingStrategy.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleIdentityRefAttributeWritingStrategy.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/Config.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/ModuleConfig.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/config/Services.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/runtime/InstanceRuntime.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/runtime/Runtime.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/Commit.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/DiscardChanges.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/Validate.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/editconfig/EditConfig.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpc.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java
opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java
opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterTest.java
opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/MockedBundleContext.java
opendaylight/netconf/ietf-netconf-monitoring-extension/pom.xml
opendaylight/netconf/ietf-netconf-monitoring/pom.xml
opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/AbstractNetconfSession.java [deleted file]
opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfClientSessionPreferences.java [new file with mode: 0644]
opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfServerSessionPreferences.java
opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java
opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSessionPreferences.java
opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfTerminationReason.java
opendaylight/netconf/netconf-client/pom.xml
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/AbstractNetconfClientNotifySessionListener.java [deleted file]
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClient.java [deleted file]
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcher.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiator.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListener.java
opendaylight/netconf/netconf-client/src/main/resources/client_hello.xml [deleted file]
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SSHNetconfClientLiveTest.java [deleted file]
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/test/TestingNetconfClient.java [new file with mode: 0644]
opendaylight/netconf/netconf-impl/pom.xml
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/CapabilityProviderImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerDispatcher.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListener.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListenerFactory.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorFactory.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultGetSchema.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultNetconfOperation.java [moved from opendaylight/sal/yang-prototype/concepts-lang/src/main/java/org/opendaylight/controller/concepts/lang/Acceptor.java with 55% similarity]
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfMonitoringServiceImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouter.java [moved from opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfOperationRouter.java with 62% similarity]
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListener.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListenerImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceSnapshotImpl.java [moved from opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceSnapshot.java with 51% similarity]
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java
opendaylight/netconf/netconf-impl/src/main/resources/server_hello.xml [deleted file]
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ConcurrentClientsTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageParserTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java
opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/input.json
opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/input.xml
opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputList.xml
opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputMap.xml
opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputMultiple.xml
opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetter.xml
opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetterList.xml
opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/inputSetterMap.xml
opendaylight/netconf/netconf-impl/src/test/resources/testConfigs/map.json
opendaylight/netconf/netconf-it/pom.xml
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/AbstractNetconfConfigTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfConfigPersisterITTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java
opendaylight/netconf/netconf-it/src/test/resources/controller.xml
opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperationProvider.java [new file with mode: 0644]
opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/NetconfOperationServiceSnapshot.java [moved from opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/DefaultNetconfOperation.java with 65% similarity]
opendaylight/netconf/netconf-util/pom.xml
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSession.java [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSessionNegotiator.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/CloseableUtil.java [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/NetconfExiSession.java [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToEXIEncoder.java [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToXMLEncoder.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfHelloMessage.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfMessageUtil.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfStartExiMessage.java [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/EXIParameters.java [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlUtil.java
opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/EXILibTest.java [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/test/XmlUnitUtil.java [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/rpc-reply_ok.xml [new file with mode: 0644]
opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/startExi.xml
opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/stopExi.xml
opendaylight/netconf/pom.xml
opendaylight/northbound/java-client/pom.xml
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java
opendaylight/sal/yang-prototype/concepts-lang/pom.xml [deleted file]
opendaylight/sal/yang-prototype/concepts-lang/src/main/java/org/opendaylight/controller/concepts/lang/AggregateTransformer.java [deleted file]
opendaylight/sal/yang-prototype/concepts-lang/src/main/java/org/opendaylight/controller/concepts/lang/CompositeClassBasedTransformer.java [deleted file]
opendaylight/sal/yang-prototype/concepts-lang/src/main/java/org/opendaylight/controller/concepts/lang/CompositeConditionalTransformer.java [deleted file]
opendaylight/sal/yang-prototype/concepts-lang/src/main/java/org/opendaylight/controller/concepts/lang/InputClassBasedTransformer.java [deleted file]
opendaylight/sal/yang-prototype/concepts-lang/src/main/java/org/opendaylight/controller/concepts/lang/RuleBasedTransformer.java [deleted file]
opendaylight/sal/yang-prototype/concepts-lang/src/main/java/org/opendaylight/controller/concepts/lang/SimpleConditionalTransformer.java [deleted file]
opendaylight/sal/yang-prototype/concepts-lang/src/main/java/org/opendaylight/controller/concepts/lang/Transformer.java [deleted file]
opendaylight/sal/yang-prototype/concepts-lang/src/site/site.xml [deleted file]
opendaylight/sal/yang-prototype/sal/.gitignore [deleted file]
opendaylight/sal/yang-prototype/src/site/markdown/readme.md [deleted file]
opendaylight/sal/yang-prototype/src/site/resources/stylesheet.css [deleted file]
opendaylight/sal/yang-prototype/src/site/site.xml [deleted file]
opendaylight/web/root/src/main/resources/WEB-INF/spring/servlet/security.xml
opendaylight/web/root/src/main/resources/WEB-INF/web.xml
third-party/org.openexi/nagasena-rta/nagasena-rta-0000.0002.0035.0.jar [new file with mode: 0644]
third-party/org.openexi/nagasena-rta/pom.xml [new file with mode: 0644]
third-party/org.openexi/nagasena/nagasena-0000.0002.0035.0.jar [new file with mode: 0644]
third-party/org.openexi/nagasena/pom.xml [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-frame.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-noframe.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/constant-values.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/deprecated-list.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/help-doc.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/index-all.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/index.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXIDecoder.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXISchemaResolver.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/HeaderOptionsOutputType.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/AlignmentType.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/BinaryDataSource.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EXIOptions.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventDescription.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventType.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/GrammarOptions.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/QName.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-frame.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-summary.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-tree.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/GrammarCache.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-frame.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-summary.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-tree.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/BinaryDataSink.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/CharacterBuffer.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/Scanner.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-frame.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-summary.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-tree.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-frame.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-summary.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-tree.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/BinaryDataHandler.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/EXIReader.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/ReaderSupport.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/SAXTransmogrifier.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/Transmogrifier.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/TransmogrifierException.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-frame.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-summary.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-tree.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/Characters.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EXISchema.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EmptySchema.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-frame.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-summary.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-tree.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactory.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryErrorHandler.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryException.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaReader.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EntityResolverEx.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-frame.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-summary.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-tree.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/overview-frame.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/overview-summary.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/overview-tree.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/package-list [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/resources/inherit.gif [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/serialized-form.html [new file with mode: 0644]
third-party/org.openexi/nagasena/src/main/resources/doc/stylesheet.css [new file with mode: 0644]
third-party/org.openexi/pom.xml [new file with mode: 0644]

index 175ab5f..6fc003b 100644 (file)
@@ -19,6 +19,8 @@ opendaylight/northbound/integrationtest/logs/*
 *.iws
 .idea
 xtend-gen
+yang-gen-config
+yang-gen-sal
 classes
 out/
 .externalToolBuilders
index d7a3db3..1b72630 100644 (file)
@@ -15,7 +15,7 @@
   </scm>
 
   <artifactId>clustering.services-implementation</artifactId>
-  <version>0.4.2-SNAPSHOT</version>
+  <version>0.4.3-SNAPSHOT</version>
   <packaging>bundle</packaging>
   <properties>
     <!-- Sonar properties using jacoco to retrieve integration test results -->
@@ -68,7 +68,7 @@
               *
             </DynamicImport-Package>
             <Embed-Dependency>
-              infinispan-core,jgroups,jboss-marshalling-river,jboss-marshalling,jboss-logging,staxmapper,narayana-jta;type=!pom;inline=false
+              infinispan-core,infinispan-commons,jgroups,jboss-marshalling-river,jboss-marshalling,jboss-logging,staxmapper,narayana-jta;type=!pom;inline=false
             </Embed-Dependency>
             <Embed-Transitive>
               true
                     <exclude>org.infinispan:infinispan-core:*</exclude>
                   </excludes>
                   <includes>
-                    <include>org.infinispan:infinispan-core:[5.3.0.Final]</include>
+                    <include>org.infinispan:infinispan-core:[6.0.2.Final]</include>
                   </includes>
                 </bannedDependencies>
               </rules>
     <dependency>
       <groupId>org.infinispan</groupId>
       <artifactId>infinispan-core</artifactId>
-      <version>5.3.0.Final</version>
+      <version>6.0.2.Final</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
diff --git a/opendaylight/clustering/services_implementation/src/main/java/org/infinispan/interceptors/distribution/BaseDistributionInterceptor.java b/opendaylight/clustering/services_implementation/src/main/java/org/infinispan/interceptors/distribution/BaseDistributionInterceptor.java
deleted file mode 100644 (file)
index d495e45..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009 Red Hat Inc. and/or its affiliates and other
- * contributors as indicated by the @author tags. All rights reserved.
- * See the copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.interceptors.distribution;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.infinispan.CacheException;
-import org.infinispan.commands.FlagAffectedCommand;
-import org.infinispan.commands.remote.ClusteredGetCommand;
-import org.infinispan.commands.write.DataWriteCommand;
-import org.infinispan.commands.write.WriteCommand;
-import org.infinispan.container.entries.InternalCacheEntry;
-import org.infinispan.container.entries.InternalCacheValue;
-import org.infinispan.context.InvocationContext;
-import org.infinispan.context.impl.TxInvocationContext;
-import org.infinispan.distribution.DistributionManager;
-import org.infinispan.factories.annotations.Inject;
-import org.infinispan.interceptors.ClusteringInterceptor;
-import org.infinispan.interceptors.locking.ClusteringDependentLogic;
-import org.infinispan.remoting.responses.ClusteredGetResponseValidityFilter;
-import org.infinispan.remoting.responses.ExceptionResponse;
-import org.infinispan.remoting.responses.Response;
-import org.infinispan.remoting.responses.SuccessfulResponse;
-import org.infinispan.remoting.rpc.ResponseFilter;
-import org.infinispan.remoting.rpc.ResponseMode;
-import org.infinispan.remoting.rpc.RpcOptions;
-import org.infinispan.remoting.transport.Address;
-import org.infinispan.transaction.xa.GlobalTransaction;
-import org.infinispan.util.logging.Log;
-import org.infinispan.util.logging.LogFactory;
-
-
-/**
- * Base class for distribution of entries across a cluster.
- *
- * @author Manik Surtani
- * @author Mircea.Markus@jboss.com
- * @author Pete Muir
- * @author Dan Berindei <dan@infinispan.org>
- * @since 4.0
- */
-public abstract class BaseDistributionInterceptor extends ClusteringInterceptor {
-
-   protected DistributionManager dm;
-
-   protected ClusteringDependentLogic cdl;
-
-   private static final Log log = LogFactory.getLog(BaseDistributionInterceptor.class);
-
-   @Override
-   protected Log getLog() {
-      return log;
-   }
-
-   @Inject
-   public void injectDependencies(DistributionManager distributionManager, ClusteringDependentLogic cdl) {
-      this.dm = distributionManager;
-      this.cdl = cdl;
-   }
-
-   @Override
-   protected final InternalCacheEntry retrieveFromRemoteSource(Object key, InvocationContext ctx, boolean acquireRemoteLock, FlagAffectedCommand command) throws Exception {
-      GlobalTransaction gtx = acquireRemoteLock ? ((TxInvocationContext)ctx).getGlobalTransaction() : null;
-      ClusteredGetCommand get = cf.buildClusteredGetCommand(key, command.getFlags(), acquireRemoteLock, gtx);
-
-      List<Address> targets = new ArrayList<Address>(stateTransferManager.getCacheTopology().getReadConsistentHash().locateOwners(key));
-      // if any of the recipients has left the cluster since the command was issued, just don't wait for its response
-      targets.retainAll(rpcManager.getTransport().getMembers());
-      ResponseFilter filter = new ClusteredGetResponseValidityFilter(targets, rpcManager.getAddress());
-      RpcOptions options = rpcManager.getRpcOptionsBuilder(ResponseMode.WAIT_FOR_VALID_RESPONSE, false)
-            .responseFilter(filter).build();
-      Map<Address, Response> responses = rpcManager.invokeRemotely(targets, get, options);
-
-      if (!responses.isEmpty()) {
-         for (Response r : responses.values()) {
-            if (r instanceof SuccessfulResponse) {
-               InternalCacheValue cacheValue = (InternalCacheValue) ((SuccessfulResponse) r).getResponseValue();
-               return cacheValue.toInternalCacheEntry(key);
-            }
-         }
-      }
-
-      // TODO If everyone returned null, and the read CH has changed, retry the remote get.
-      // Otherwise our get command might be processed by the old owners after they have invalidated their data
-      // and we'd return a null even though the key exists on
-      return null;
-   }
-
-   protected final Object handleNonTxWriteCommand(InvocationContext ctx, DataWriteCommand command) throws Throwable {
-      if (ctx.isInTxScope()) {
-         throw new CacheException("Attempted execution of non-transactional write command in a transactional invocation context");
-      }
-
-      RecipientGenerator recipientGenerator = new SingleKeyRecipientGenerator(command.getKey());
-
-      // see if we need to load values from remote sources first
-      remoteGetBeforeWrite(ctx, command, recipientGenerator);
-
-      // if this is local mode then skip distributing
-      if (isLocalModeForced(command)) {
-         return invokeNextInterceptor(ctx, command);
-      }
-
-      boolean isSync = isSynchronous(command);
-      if (!ctx.isOriginLocal()) {
-         Object returnValue = invokeNextInterceptor(ctx, command);
-         Address primaryOwner = cdl.getPrimaryOwner(command.getKey());
-            if (primaryOwner.equals(rpcManager.getAddress())) {
-                if (command.isConditional() && !command.isSuccessful()) {
-                    log.tracef(
-                            "Skipping the replication of the conditional command as it did not succeed on primary owner (%s).",
-                            command);
-                    return returnValue;
-                }
-                rpcManager.invokeRemotely(recipientGenerator.generateRecipients(), command,
-                        rpcManager.getDefaultRpcOptions(isSync));
-            } else {
-                log.tracef("Didn't invoke RPC because primaryOwner (%s) didn't match this node (%s)", primaryOwner,
-                           rpcManager.getAddress());
-                log.tracef("Hashcode is (%s) for Key (%s)",
-                           command.getKey().hashCode(), command.getKey());
-            }
-         return returnValue;
-      } else {
-         Address primaryOwner = cdl.getPrimaryOwner(command.getKey());
-         if (primaryOwner.equals(rpcManager.getAddress())) {
-            Object result = invokeNextInterceptor(ctx, command);
-            if (command.isConditional() && !command.isSuccessful()) {
-               log.tracef("Skipping the replication of the conditional command as it did not succeed on primary owner (%s).", command);
-               return result;
-            }
-            List<Address> recipients = recipientGenerator.generateRecipients();
-            log.tracef("I'm the primary owner, sending the command to all (%s) the recipients in order to be applied.", recipients);
-            // check if a single owner has been configured and the target for the key is the local address
-            boolean isSingleOwnerAndLocal = cacheConfiguration.clustering().hash().numOwners() == 1
-                  && recipients != null
-                  && recipients.size() == 1
-                  && recipients.get(0).equals(rpcManager.getTransport().getAddress());
-            if (!isSingleOwnerAndLocal) {
-               rpcManager.invokeRemotely(recipients, command, rpcManager.getDefaultRpcOptions(isSync));
-            }
-            return result;
-         } else {
-            log.tracef("I'm not the primary owner, so sending the command to the primary owner(%s) in order to be forwarded", primaryOwner);
-            log.tracef("Hashcode is (%s) for Key (%s)", command.getKey().hashCode(), command.getKey());
-
-            Object localResult = invokeNextInterceptor(ctx, command);
-            boolean isSyncForwarding = isSync || isNeedReliableReturnValues(command);
-            Map<Address, Response> addressResponseMap = rpcManager.invokeRemotely(Collections.singletonList(primaryOwner), command,
-                  rpcManager.getDefaultRpcOptions(isSyncForwarding));
-            if (!isSyncForwarding) return localResult;
-
-            return getResponseFromPrimaryOwner(primaryOwner, addressResponseMap);
-         }
-      }
-   }
-
-   private Object getResponseFromPrimaryOwner(Address primaryOwner, Map<Address, Response> addressResponseMap) {
-      Response fromPrimaryOwner = addressResponseMap.get(primaryOwner);
-      if (fromPrimaryOwner == null) {
-         log.tracef("Primary owner %s returned null", primaryOwner);
-         return null;
-      }
-      if (!fromPrimaryOwner.isSuccessful()) {
-         Throwable cause = fromPrimaryOwner instanceof ExceptionResponse ? ((ExceptionResponse)fromPrimaryOwner).getException() : null;
-         throw new CacheException("Got unsuccessful response from primary owner: " + fromPrimaryOwner, cause);
-      } else {
-         return ((SuccessfulResponse) fromPrimaryOwner).getResponseValue();
-      }
-   }
-
-   protected abstract void remoteGetBeforeWrite(InvocationContext ctx, WriteCommand command, RecipientGenerator keygen) throws Throwable;
-
-   interface RecipientGenerator {
-
-      Collection<Object> getKeys();
-
-      List<Address> generateRecipients();
-   }
-
-   class SingleKeyRecipientGenerator implements RecipientGenerator {
-      private final Object key;
-      private final Set<Object> keys;
-      private List<Address> recipients = null;
-
-      SingleKeyRecipientGenerator(Object key) {
-         this.key = key;
-         keys = Collections.singleton(key);
-      }
-
-      @Override
-      public List<Address> generateRecipients() {
-         if (recipients == null) {
-            recipients = cdl.getOwners(key);
-         }
-         return recipients;
-      }
-
-      @Override
-      public Collection<Object> getKeys() {
-         return keys;
-      }
-   }
-
-   class MultipleKeysRecipientGenerator implements RecipientGenerator {
-
-      private final Collection<Object> keys;
-      private List<Address> recipients = null;
-
-      MultipleKeysRecipientGenerator(Collection<Object> keys) {
-         this.keys = keys;
-      }
-
-      @Override
-      public List<Address> generateRecipients() {
-         if (recipients == null) {
-            recipients = cdl.getOwners(keys);
-         }
-         return recipients;
-      }
-
-      @Override
-      public Collection<Object> getKeys() {
-         return keys;
-      }
-   }
-}
index 5ec4325..5fb0ddf 100644 (file)
@@ -1,4 +1,4 @@
-<infinispan xsi:schemaLocation="urn:infinispan:config:5.3 http://www.infinispan.org/schemas/infinispan-config-5.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:infinispan:config:5.3">
+<infinispan>
   <global>
     <transport>
       <properties>
         jmxDomain="org.infinispan"
         cacheManagerName="SampleCacheManager"/>
   </global>
-  <default>
-    <!-- Configure a synchronous replication cache -->
-    <clustering mode="replication">
-      <sync/>
-    </clustering>
-    <!--
-        Used to register JMX statistics in any available MBean server
-    -->
+
+ <default>
     <jmxStatistics enabled="true"/>
-  </default>
-  <!-- transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup" -->
-  <namedCache name="transactional-type">
+        <clustering mode="replication">
+        <sync/>
+        </clustering>
+        </default>
+ <namedCache name="transactional-type">
     <transaction
         transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"
         syncRollbackPhase="true"
         use1PcForAutoCommitTransactions="true"
         autoCommit="true"
         lockingMode="OPTIMISTIC"
+        useEagerLocking="true"
         useSynchronization="true"
         transactionMode="TRANSACTIONAL"
         />
+        <clustering mode="replication">
+        <sync/>
+        </clustering>
   </namedCache>
+
 </infinispan>
index 3690b85..f4b2dee 100644 (file)
     <commons.io.version>2.4</commons.io.version>
     <bundlescanner.version>0.4.2-SNAPSHOT</bundlescanner.version>
     <usermanager.version>0.4.2-SNAPSHOT</usermanager.version>
-    <forwardingrulesmanager.version>0.5.1-SNAPSHOT</forwardingrulesmanager.version>
+    <forwardingrulesmanager.version>0.6.0-SNAPSHOT</forwardingrulesmanager.version>
     <statisticsmanager.version>0.5.1-SNAPSHOT</statisticsmanager.version>
     <clustering.services.version>0.5.1-SNAPSHOT</clustering.services.version>
     <configuration.version>0.4.3-SNAPSHOT</configuration.version>
     <topologymanager.version>0.4.2-SNAPSHOT</topologymanager.version>
     <protocol_plugin.stub.version>0.4.2-SNAPSHOT</protocol_plugin.stub.version>
     <clustering.stub.version>0.4.2-SNAPSHOT</clustering.stub.version>
+    <clustering.services_implementation.version>0.4.3-SNAPSHOT</clustering.services_implementation.version>
     <!-- Third party version -->
     <jersey-servlet.version>1.17</jersey-servlet.version>
     <corsfilter.version>7.0.42</corsfilter.version>
     <!-- enforcer version -->
     <enforcer.version>1.3.1</enforcer.version>
     <xtend.version>2.4.3</xtend.version>
-    <xtend.dstdir>${project.build.directory}/generated-sources/xtend-gen</xtend.dstdir>
+    <xtend.dstdir>src/main/xtend-gen</xtend.dstdir>
+    <jmxGeneratorPath>src/main/yang-gen-config</jmxGeneratorPath>
+    <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath>
+
+    <!-- OpenEXI third party lib for netconf-->
+    <exi.nagasena.version>0000.0002.0035.0-SNAPSHOT</exi.nagasena.version>
   </properties>
 
   <dependencyManagement>
         <artifactId>org.eclipse.equinox.launcher</artifactId>
         <version>1.3.0.v20120522-1813</version>
       </dependency>
+      <dependency>
+        <groupId>xmlunit</groupId>
+        <artifactId>xmlunit</artifactId>
+        <version>1.5</version>
+        <scope>test</scope>
+      </dependency>
       <!-- Gemini Web -->
       <dependency>
         <groupId>geminiweb</groupId>
         <artifactId>ganymed</artifactId>
         <version>1.1-SNAPSHOT</version>
       </dependency>
+      <dependency>
+        <groupId>org.opendaylight.controller.thirdparty</groupId>
+        <artifactId>nagasena</artifactId>
+        <version>${exi.nagasena.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.controller.thirdparty</groupId>
+        <artifactId>nagasena-rta</artifactId>
+        <version>${exi.nagasena.version}</version>
+      </dependency>
       <dependency>
         <groupId>com.google.code.findbugs</groupId>
         <artifactId>jsr305</artifactId>
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>clustering.services-implementation</artifactId>
-        <version>${controller.version}</version>
+        <version>${clustering.services_implementation.version}</version>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
           <includeTestSourceDirectory>true</includeTestSourceDirectory>
           <sourceDirectory>${project.basedir}</sourceDirectory>
           <includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat</includes>
-          <excludes>**\/target\/,**\/bin\/,**\/target-ide\/</excludes>
+          <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/${jmxGeneratorPath}\/,**\/${salGeneratorPath}\/</excludes>
         </configuration>
       </plugin>
       <plugin>
           </execution>
         </executions>
       </plugin>
+      <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>build-helper-maven-plugin</artifactId>
+      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>
                   </execution>
               </executions>
           </plugin>
+          <plugin>
+              <artifactId>maven-clean-plugin</artifactId>
+              <configuration>
+                  <filesets>
+                      <fileset>
+                          <directory>${xtend.dstdir}</directory>
+                          <includes>
+                              <include>**</include>
+                          </includes>
+                      </fileset>
+                      <fileset>
+                          <directory>${jmxGeneratorPath}</directory>
+                          <includes>
+                              <include>**</include>
+                          </includes>
+                      </fileset>
+                      <fileset>
+                          <directory>${salGeneratorPath}</directory>
+                          <includes>
+                              <include>**</include>
+                          </includes>
+                      </fileset>
+                  </filesets>
+              </configuration>
+            </plugin>
+          <plugin>
+             <groupId>org.codehaus.mojo</groupId>
+             <artifactId>build-helper-maven-plugin</artifactId>
+             <version>1.8</version>
+             <executions>
+                <execution>
+                   <id>add-source</id>
+                   <phase>generate-sources</phase>
+                   <goals>
+                      <goal>add-source</goal>
+                   </goals>
+                   <configuration>
+                      <sources>
+                         <source>${jmxGeneratorPath}</source>
+                         <source>${salGeneratorPath}</source>
+                         <source>${xtend.dstdir}</source>
+                      </sources>
+                   </configuration>
+                </execution>
+             </executions>
+            </plugin>
       </plugins>
     </pluginManagement>
   </build>
index 650d2dd..1a1a256 100644 (file)
         <maven>3.0.4</maven>
     </prerequisites>
 
-    <properties>
-        <jmxGeneratorPath>${project.build.directory}/generated-sources/config</jmxGeneratorPath>
-        <salGeneratorPath>${project.build.directory}/generated-sources/sal</salGeneratorPath>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>io.netty</groupId>
index fb0718a..e914162 100644 (file)
@@ -283,6 +283,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
 
         int orderingIdx = 0;
         for (ModuleIdentifier moduleIdentifier : orderedModuleIdentifiers) {
+            logger.trace("Registering {}", moduleIdentifier);
             ModuleInternalTransactionalInfo entry = commitInfo.getCommitted()
                     .get(moduleIdentifier);
             if (entry == null) {
index 6b7251c..bc4de5c 100644 (file)
@@ -44,6 +44,7 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import static com.google.common.base.Preconditions.checkNotNull;
 import static java.lang.String.format;
 
 /**
@@ -380,7 +381,8 @@ class ConfigTransactionControllerImpl implements
             try {
                 logger.debug("About to commit {} in transaction {}",
                         name, getTransactionIdentifier());
-                module.getInstance();
+                AutoCloseable instance = module.getInstance();
+                checkNotNull(instance, "Instance is null:{} in transaction {}", name, getTransactionIdentifier());
             } catch (Exception e) {
                 logger.error("Commit failed on {} in transaction {}", name,
                         getTransactionIdentifier(), e);
index 21b1a55..80abd87 100644 (file)
@@ -8,8 +8,6 @@
   <packaging>bundle</packaging>
 
     <properties>
-        <jmxGeneratorPath>${project.build.directory}/generated-sources/config</jmxGeneratorPath>
-        <salGeneratorPath>${project.build.directory}/generated-sources/sal</salGeneratorPath>
         <config.version>${config-api-version}</config.version>
         <yangtools.version>${yang-maven-plugin-version}</yangtools.version>
         <maven.bundle.version>${maven-bundle-plugin-version}</maven.bundle.version>
                 </dependencies>
             </plugin>
 
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <version>1.8</version>
-                <executions>
-                    <execution>
-                        <id>add-source</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>add-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <source>${jmxGeneratorPath}</source>
-                            </sources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
index 75188fe..2b98f41 100644 (file)
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+        </dependency>
 
     </dependencies>
 
     <build>
         <plugins>
-            <!-- workaround for creating version according to OSGi specification (major.minor.micro[.qualifier] -->
-            <plugin>
-                <groupId>org.codehaus.groovy.maven</groupId>
-                <artifactId>gmaven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>execute</goal>
-                        </goals>
-                        <configuration>
-                            <source>
-                                System.setProperty("osgiversion", "${project.version}".replace('-', '.'))
-                            </source>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
-                        <Fragment-Host>${project.groupId}.config-persister-impl;bundle-version=${osgiversion}
+                        <Fragment-Host>${project.groupId}.config-persister-impl
                         </Fragment-Host>
                         <Provide-Capability>org.opendaylight.controller.config.persister.storage.adapter
                         </Provide-Capability>
             </plugin>
         </plugins>
     </build>
-
 </project>
index da442ef..7af06bd 100644 (file)
@@ -8,21 +8,26 @@
 
 package org.opendaylight.controller.config.persist.storage.directory.xml;
 
+import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.File;
+import java.io.IOException;
 import java.util.Collections;
 import java.util.List;
 import java.util.SortedSet;
 
-import com.google.common.base.Optional;
 import org.junit.Test;
 import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
 import org.opendaylight.controller.config.persist.api.Persister;
 import org.opendaylight.controller.config.persist.test.PropertiesProviderTest;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import org.xml.sax.SAXException;
+
+import com.google.common.base.Optional;
 
 public class DirectoryStorageAdapterTest {
     Persister tested;
@@ -95,8 +100,8 @@ public class DirectoryStorageAdapterTest {
         logger.info("Testing : " + tested.toString());
     }
 
-    private void assertResult(ConfigSnapshotHolder result, String s, String... caps) {
-        assertEquals(s, result.getConfigSnapshot().replaceAll("\\s", ""));
+    private void assertResult(ConfigSnapshotHolder result, String s, String... caps) throws SAXException, IOException {
+        assertXMLEqual(s, result.getConfigSnapshot());
         int i = 0;
         for (String capFromSnapshot : result.getCapabilities()) {
             assertEquals(capFromSnapshot, caps[i++]);
index dd20795..a5010f0 100644 (file)
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+        </dependency>
     </dependencies>
 
     <build>
         <plugins>
-            <!-- workaround for creating version according to OSGi specification (major.minor.micro[.qualifier] -->
-            <plugin>
-                <groupId>org.codehaus.groovy.maven</groupId>
-                <artifactId>gmaven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>execute</goal>
-                        </goals>
-                        <configuration>
-                            <source>
-                                System.setProperty("osgiversion", "${project.version}".replace('-', '.'))
-                            </source>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
-                        <Fragment-Host>${project.groupId}.config-persister-impl;bundle-version=${osgiversion}
+                        <Fragment-Host>${project.groupId}.config-persister-impl
                         </Fragment-Host>
-                        <Provide-Capability>org.opendaylight.controller.config.persister.storage.adapter
-                        </Provide-Capability>
+                        <Provide-Capability>org.opendaylight.controller.config.persister.storage.adapter</Provide-Capability>
                     </instructions>
                 </configuration>
             </plugin>
index 5322f63..2bfe70a 100644 (file)
@@ -8,7 +8,12 @@
 
 package org.opendaylight.controller.config.persist.storage.file.xml;
 
-import com.google.common.base.Charsets;
+import static junit.framework.Assert.assertFalse;
+import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -16,16 +21,16 @@ import java.nio.file.Files;
 import java.util.List;
 import java.util.SortedSet;
 import java.util.TreeSet;
+
 import junit.framework.Assert;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
 import org.opendaylight.controller.config.persist.test.PropertiesProviderTest;
-import static junit.framework.Assert.assertFalse;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
+
+import com.google.common.base.Charsets;
 
 public class FileStorageAdapterTest {
 
@@ -96,8 +101,7 @@ public class FileStorageAdapterTest {
         List<ConfigSnapshotHolder> lastConf = storage.loadLastConfigs();
         assertEquals(1, lastConf.size());
         ConfigSnapshotHolder configSnapshotHolder = lastConf.get(0);
-        assertEquals("<config>2</config>",
-                configSnapshotHolder.getConfigSnapshot().replaceAll("\\s", ""));
+        assertXMLEqual("<config>2</config>", configSnapshotHolder.getConfigSnapshot());
         assertEquals(createCaps(), configSnapshotHolder.getCapabilities());
 
         storage = new XmlFileStorageAdapter();
@@ -147,8 +151,7 @@ public class FileStorageAdapterTest {
         List<ConfigSnapshotHolder> lastConf = storage.loadLastConfigs();
         assertEquals(1, lastConf.size());
         ConfigSnapshotHolder configSnapshotHolder = lastConf.get(0);
-        assertEquals("<config>2</config>",
-                configSnapshotHolder.getConfigSnapshot().replaceAll("\\s", ""));
+        assertXMLEqual("<config>2</config>", configSnapshotHolder.getConfigSnapshot());
     }
 
     @Test
@@ -178,8 +181,7 @@ public class FileStorageAdapterTest {
         List<ConfigSnapshotHolder> lastConf = storage.loadLastConfigs();
         assertEquals(1, lastConf.size());
         ConfigSnapshotHolder configSnapshotHolder = lastConf.get(0);
-        assertEquals("<config>3</config>",
-                configSnapshotHolder.getConfigSnapshot().replaceAll("\\s", ""));
+        assertXMLEqual("<config>3</config>", configSnapshotHolder.getConfigSnapshot());
         assertFalse(readLines.contains(holder.getConfigSnapshot()));
     }
 
index e382c33..2c607f8 100644 (file)
         <maven>3.0.4</maven>
     </prerequisites>
 
-    <properties>
-        <jmxGeneratorPath>${project.build.directory}/generated-sources/config</jmxGeneratorPath>
-    </properties>
-
     <build>
         <pluginManagement>
             <plugins>
                         </dependency>
                     </dependencies>
                 </plugin>
-
-                <!-- tell eclipse about generated source folders -->
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>build-helper-maven-plugin</artifactId>
-                    <version>1.8</version>
-                    <executions>
-                        <execution>
-                            <id>add-source</id>
-                            <phase>generate-sources</phase>
-                            <goals>
-                                <goal>add-source</goal>
-                            </goals>
-                            <configuration>
-                                <sources>
-                                    <source>${jmxGeneratorPath}</source>
-                                    <source>${salGeneratorPath}</source>
-                                </sources>
-                            </configuration>
-                        </execution>
-                    </executions>
-                </plugin>
             </plugins>
         </pluginManagement>
     </build>
index fbebda5..2fe515c 100644 (file)
@@ -89,6 +89,7 @@
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
             </plugin>
+
         </plugins>
     </build>
 </project>
index 5414335..332426f 100644 (file)
@@ -68,8 +68,6 @@
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
             </plugin>
-
-
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
index d700075..8efed2d 100644 (file)
@@ -62,7 +62,6 @@
         <osgi.version>5.0.0</osgi.version>
         <jacoco.version>0.6.2.201302030002</jacoco.version>
         <slf4j.version>1.7.2</slf4j.version>
-        <salGeneratorPath>${project.build.directory}/generated-sources/sal</salGeneratorPath>
     </properties>
 
     <dependencies>
                         </dependency>
                     </dependencies>
                 </plugin>
-                <!-- tell eclipse about generated source folders -->
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>build-helper-maven-plugin</artifactId>
-                    <version>1.8</version>
-                    <executions>
-                        <execution>
-                            <id>add-source</id>
-                            <phase>generate-sources</phase>
-                            <goals>
-                                <goal>add-source</goal>
-                            </goals>
-                            <configuration>
-                                <sources>
-                                    <source>${salGeneratorPath}</source>
-                                </sources>
-                            </configuration>
-                        </execution>
-                    </executions>
-                </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-jar-plugin</artifactId>
index b9731cd..177adc1 100644 (file)
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.config.threadpool.async;\r
-\r
-import static org.junit.Assert.assertThat;\r
-import static org.junit.Assert.fail;\r
-import static org.junit.matchers.JUnitMatchers.containsString;\r
-\r
-import javax.management.InstanceAlreadyExistsException;\r
-import javax.management.ObjectName;\r
-\r
-import org.junit.Before;\r
-import org.junit.Test;\r
-import org.opendaylight.controller.config.api.ConflictingVersionException;\r
-import org.opendaylight.controller.config.api.ValidationException;\r
-import org.opendaylight.controller.config.api.jmx.CommitStatus;\r
-import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;\r
-import org.opendaylight.controller.config.manager.impl.ClassBasedModuleFactory;\r
-import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;\r
-import org.opendaylight.controller.config.threadpool.scheduled.TestingScheduledThreadPoolModule;\r
-import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.AsyncEventBusModuleFactory;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.AsyncEventBusModuleMXBean;\r
-\r
-public class AsyncEventBusConfigBeanTest extends AbstractConfigTest {\r
-\r
-    private AsyncEventBusModuleFactory factory;\r
-    private final String instanceName = "async1";\r
-    private final String poolImplName = "fixed1";\r
-\r
-    @Before\r
-    public void setUp() {\r
-\r
-        ClassBasedModuleFactory scheduledThreadPoolConfigFactory = createClassBasedCBF(\r
-                TestingScheduledThreadPoolModule.class, poolImplName);\r
-\r
-        factory = new AsyncEventBusModuleFactory();\r
-        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory,\r
-                scheduledThreadPoolConfigFactory));\r
-    }\r
-\r
-    @Test\r
-    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,\r
-            ConflictingVersionException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        createAsynced(transaction, instanceName, transaction.createModule(poolImplName, "pool-test"));\r
-        transaction.validateConfig();\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-        assertStatus(status, 2, 0, 0);\r
-    }\r
-\r
-    @Test\r
-    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,\r
-            ValidationException {\r
-\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createAsynced(transaction, instanceName, transaction.createModule(poolImplName, "pool-test"));\r
-\r
-        transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-        assertStatus(status, 0, 0, 2);\r
-\r
-    }\r
-\r
-    @Test\r
-    public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException,\r
-            InstanceAlreadyExistsException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        ObjectName poolCB = transaction.createModule(poolImplName, "pool-test");\r
-        createAsynced(transaction, instanceName, poolCB);\r
-        transaction.commit();\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        try {\r
-            createAsynced(transaction, instanceName, poolCB);\r
-            fail();\r
-        } catch (InstanceAlreadyExistsException e) {\r
-            assertThat(\r
-                    e.getMessage(),\r
-                    containsString("There is an instance registered with name ModuleIdentifier{factoryName='async-eventbus', instanceName='async1'}"));\r
-        }\r
-    }\r
-\r
-    private ObjectName createAsynced(ConfigTransactionJMXClient transaction, String instanceName, ObjectName threadPool)\r
-            throws InstanceAlreadyExistsException {\r
-        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);\r
-        AsyncEventBusModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated, AsyncEventBusModuleMXBean.class);\r
-        mxBean.setThreadpool(threadPool);\r
-        return nameCreated;\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.threadpool.async;
+
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.containsString;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.ObjectName;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.controller.config.api.ConflictingVersionException;
+import org.opendaylight.controller.config.api.ValidationException;
+import org.opendaylight.controller.config.api.jmx.CommitStatus;
+import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
+import org.opendaylight.controller.config.manager.impl.ClassBasedModuleFactory;
+import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
+import org.opendaylight.controller.config.threadpool.scheduled.TestingScheduledThreadPoolModule;
+import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
+import org.opendaylight.controller.config.yang.threadpool.impl.AsyncEventBusModuleFactory;
+import org.opendaylight.controller.config.yang.threadpool.impl.AsyncEventBusModuleMXBean;
+
+public class AsyncEventBusConfigBeanTest extends AbstractConfigTest {
+
+    private AsyncEventBusModuleFactory factory;
+    private final String instanceName = "async1";
+    private final String poolImplName = "fixed1";
+
+    @Before
+    public void setUp() {
+
+        ClassBasedModuleFactory scheduledThreadPoolConfigFactory = createClassBasedCBF(
+                TestingScheduledThreadPoolModule.class, poolImplName);
+
+        factory = new AsyncEventBusModuleFactory();
+        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory,
+                scheduledThreadPoolConfigFactory));
+    }
+
+    @Test
+    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,
+            ConflictingVersionException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        createAsynced(transaction, instanceName, transaction.createModule(poolImplName, "pool-test"));
+        transaction.validateConfig();
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+        assertStatus(status, 2, 0, 0);
+    }
+
+    @Test
+    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,
+            ValidationException {
+
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createAsynced(transaction, instanceName, transaction.createModule(poolImplName, "pool-test"));
+
+        transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+
+        transaction = configRegistryClient.createTransaction();
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+        assertStatus(status, 0, 0, 2);
+
+    }
+
+    @Test
+    public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException,
+            InstanceAlreadyExistsException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        ObjectName poolCB = transaction.createModule(poolImplName, "pool-test");
+        createAsynced(transaction, instanceName, poolCB);
+        transaction.commit();
+
+        transaction = configRegistryClient.createTransaction();
+        try {
+            createAsynced(transaction, instanceName, poolCB);
+            fail();
+        } catch (InstanceAlreadyExistsException e) {
+            assertThat(
+                    e.getMessage(),
+                    containsString("There is an instance registered with name ModuleIdentifier{factoryName='async-eventbus', instanceName='async1'}"));
+        }
+    }
+
+    private ObjectName createAsynced(ConfigTransactionJMXClient transaction, String instanceName, ObjectName threadPool)
+            throws InstanceAlreadyExistsException {
+        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);
+        AsyncEventBusModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated, AsyncEventBusModuleMXBean.class);
+        mxBean.setThreadpool(threadPool);
+        return nameCreated;
+    }
+
+}
index 01a89a9..4431f78 100644 (file)
@@ -1,35 +1,35 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.config.threadpool.eventbus;\r
-\r
-import static org.mockito.Mockito.doNothing;\r
-import static org.mockito.Mockito.mock;\r
-\r
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;\r
-import org.opendaylight.controller.config.api.ModuleIdentifier;\r
-import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;\r
-import org.opendaylight.controller.config.spi.Module;\r
-import org.opendaylight.controller.config.threadpool.util.CloseableEventBus;\r
-import org.opendaylight.controller.config.yang.threadpool.EventBusServiceInterface;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.EventBusModuleMXBean;\r
-\r
-public class TestingEventBusModule extends AbstractMockedModule implements Module, EventBusServiceInterface,\r
-        EventBusModuleMXBean {\r
-\r
-    public TestingEventBusModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {\r
-        super(old, id);\r
-    }\r
-\r
-    @Override\r
-    protected AutoCloseable prepareMockedInstance() throws Exception {\r
-        CloseableEventBus bus = mock(CloseableEventBus.class);\r
-        doNothing().when(bus).close();\r
-        return bus;\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.threadpool.eventbus;
+
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.mock;
+
+import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;
+import org.opendaylight.controller.config.spi.Module;
+import org.opendaylight.controller.config.threadpool.util.CloseableEventBus;
+import org.opendaylight.controller.config.yang.threadpool.EventBusServiceInterface;
+import org.opendaylight.controller.config.yang.threadpool.impl.EventBusModuleMXBean;
+
+public class TestingEventBusModule extends AbstractMockedModule implements Module, EventBusServiceInterface,
+        EventBusModuleMXBean {
+
+    public TestingEventBusModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {
+        super(old, id);
+    }
+
+    @Override
+    protected AutoCloseable prepareMockedInstance() throws Exception {
+        CloseableEventBus bus = mock(CloseableEventBus.class);
+        doNothing().when(bus).close();
+        return bus;
+    }
+
+}
index 8bfd049..781215d 100644 (file)
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.config.threadpool.fixed;\r
-\r
-import org.junit.Before;\r
-import org.junit.Test;\r
-import org.opendaylight.controller.config.api.ConflictingVersionException;\r
-import org.opendaylight.controller.config.api.ValidationException;\r
-import org.opendaylight.controller.config.api.jmx.CommitStatus;\r
-import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;\r
-import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;\r
-import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.fixed.FixedThreadPoolModuleFactory;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.fixed.FixedThreadPoolModuleMXBean;\r
-\r
-import javax.management.InstanceAlreadyExistsException;\r
-import javax.management.InstanceNotFoundException;\r
-import javax.management.ObjectName;\r
-\r
-import static org.junit.Assert.assertThat;\r
-import static org.junit.Assert.fail;\r
-import static org.junit.matchers.JUnitMatchers.containsString;\r
-\r
-public class FixedThreadPoolConfigBeanTest extends AbstractConfigTest {\r
-\r
-    private FixedThreadPoolModuleFactory factory;\r
-    private final String nameInstance = "fixedInstance";\r
-\r
-    @Before\r
-    public void setUp() {\r
-        factory = new FixedThreadPoolModuleFactory();\r
-        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory,\r
-                new NamingThreadFactoryModuleFactory()));\r
-    }\r
-\r
-    @Test\r
-    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,\r
-            ConflictingVersionException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createFixed(transaction, nameInstance, 2);\r
-\r
-        transaction.validateConfig();\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-        assertStatus(status, 2, 0, 0);\r
-    }\r
-\r
-    @Test\r
-    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,\r
-            ValidationException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createFixed(transaction, nameInstance, 4);\r
-\r
-        transaction.validateConfig();\r
-        transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-        assertStatus(status, 0, 0, 2);\r
-    }\r
-\r
-    @Test\r
-    public void testNegative() throws ConflictingVersionException, ValidationException, InstanceAlreadyExistsException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        createFixed(transaction, nameInstance, 5);\r
-        transaction.commit();\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        try {\r
-            createFixed(transaction, nameInstance, 0);\r
-            fail();\r
-        } catch (InstanceAlreadyExistsException e) {\r
-            assertThat(\r
-                    e.getMessage(),\r
-                    containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-fixed', instanceName='fixedInstance'}"));\r
-        }\r
-    }\r
-\r
-    @Test\r
-    public void testDestroy() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException,\r
-            InstanceNotFoundException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createFixed(transaction, nameInstance, 1);\r
-\r
-        transaction.commit();\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        transaction.destroyConfigBean(factory.getImplementationName(), nameInstance);\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(0, factory.getImplementationName());\r
-        assertStatus(status, 0, 0, 1);\r
-    }\r
-\r
-    @Test\r
-    public void testValidationException() throws InstanceAlreadyExistsException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createFixed(transaction, nameInstance, -1);\r
-        try {\r
-            transaction.validateConfig();\r
-            fail();\r
-        } catch (ValidationException e) {\r
-            assertThat(e.getMessage(), containsString("MaxThreadCount must be greater than zero"));\r
-        }\r
-    }\r
-\r
-    private ObjectName createFixed(ConfigTransactionJMXClient transaction, String name, int numberOfThreads)\r
-            throws InstanceAlreadyExistsException {\r
-        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), name);\r
-        FixedThreadPoolModuleMXBean mxBean = transaction.newMXBeanProxy(nameCreated, FixedThreadPoolModuleMXBean.class);\r
-        mxBean.setMaxThreadCount(numberOfThreads);\r
-\r
-        ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, "naming");\r
-        NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON,\r
-                NamingThreadFactoryModuleMXBean.class);\r
-        namingThreadFactoryModuleMXBean.setNamePrefix("prefix");\r
-\r
-        mxBean.setThreadFactory(threadFactoryON);\r
-\r
-        return nameCreated;\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.threadpool.fixed;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.controller.config.api.ConflictingVersionException;
+import org.opendaylight.controller.config.api.ValidationException;
+import org.opendaylight.controller.config.api.jmx.CommitStatus;
+import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
+import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
+import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
+import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory;
+import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean;
+import org.opendaylight.controller.config.yang.threadpool.impl.fixed.FixedThreadPoolModuleFactory;
+import org.opendaylight.controller.config.yang.threadpool.impl.fixed.FixedThreadPoolModuleMXBean;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.ObjectName;
+
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.containsString;
+
+public class FixedThreadPoolConfigBeanTest extends AbstractConfigTest {
+
+    private FixedThreadPoolModuleFactory factory;
+    private final String nameInstance = "fixedInstance";
+
+    @Before
+    public void setUp() {
+        factory = new FixedThreadPoolModuleFactory();
+        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory,
+                new NamingThreadFactoryModuleFactory()));
+    }
+
+    @Test
+    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,
+            ConflictingVersionException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createFixed(transaction, nameInstance, 2);
+
+        transaction.validateConfig();
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+        assertStatus(status, 2, 0, 0);
+    }
+
+    @Test
+    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,
+            ValidationException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createFixed(transaction, nameInstance, 4);
+
+        transaction.validateConfig();
+        transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+
+        transaction = configRegistryClient.createTransaction();
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+        assertStatus(status, 0, 0, 2);
+    }
+
+    @Test
+    public void testNegative() throws ConflictingVersionException, ValidationException, InstanceAlreadyExistsException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        createFixed(transaction, nameInstance, 5);
+        transaction.commit();
+
+        transaction = configRegistryClient.createTransaction();
+        try {
+            createFixed(transaction, nameInstance, 0);
+            fail();
+        } catch (InstanceAlreadyExistsException e) {
+            assertThat(
+                    e.getMessage(),
+                    containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-fixed', instanceName='fixedInstance'}"));
+        }
+    }
+
+    @Test
+    public void testDestroy() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException,
+            InstanceNotFoundException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createFixed(transaction, nameInstance, 1);
+
+        transaction.commit();
+
+        transaction = configRegistryClient.createTransaction();
+        transaction.destroyConfigBean(factory.getImplementationName(), nameInstance);
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(0, factory.getImplementationName());
+        assertStatus(status, 0, 0, 1);
+    }
+
+    @Test
+    public void testValidationException() throws InstanceAlreadyExistsException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createFixed(transaction, nameInstance, -1);
+        try {
+            transaction.validateConfig();
+            fail();
+        } catch (ValidationException e) {
+            assertThat(e.getMessage(), containsString("MaxThreadCount must be greater than zero"));
+        }
+    }
+
+    private ObjectName createFixed(ConfigTransactionJMXClient transaction, String name, int numberOfThreads)
+            throws InstanceAlreadyExistsException {
+        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), name);
+        FixedThreadPoolModuleMXBean mxBean = transaction.newMXBeanProxy(nameCreated, FixedThreadPoolModuleMXBean.class);
+        mxBean.setMaxThreadCount(numberOfThreads);
+
+        ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, "naming");
+        NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON,
+                NamingThreadFactoryModuleMXBean.class);
+        namingThreadFactoryModuleMXBean.setNamePrefix("prefix");
+
+        mxBean.setThreadFactory(threadFactoryON);
+
+        return nameCreated;
+    }
+
+}
index 1fc0821..03cf9d6 100644 (file)
@@ -1,37 +1,37 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.config.threadpool.fixed;\r
-\r
-import static org.mockito.Mockito.doNothing;\r
-import static org.mockito.Mockito.doReturn;\r
-import static org.mockito.Mockito.mock;\r
-\r
-import java.util.concurrent.ExecutorService;\r
-\r
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;\r
-import org.opendaylight.controller.config.api.ModuleIdentifier;\r
-import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;\r
-import org.opendaylight.controller.config.spi.Module;\r
-import org.opendaylight.controller.config.threadpool.util.FixedThreadPoolWrapper;\r
-import org.opendaylight.controller.config.yang.threadpool.ThreadPoolServiceInterface;\r
-\r
-public class TestingFixedThreadPoolModule extends AbstractMockedModule implements ThreadPoolServiceInterface, Module {\r
-\r
-    public TestingFixedThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {\r
-        super(old, id);\r
-    }\r
-\r
-    @Override\r
-    protected AutoCloseable prepareMockedInstance() throws Exception {\r
-        FixedThreadPoolWrapper pool = mock(FixedThreadPoolWrapper.class);\r
-        doNothing().when(pool).close();\r
-        doReturn(mock(ExecutorService.class)).when(pool).getExecutor();\r
-        return pool;\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.threadpool.fixed;
+
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
+import java.util.concurrent.ExecutorService;
+
+import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;
+import org.opendaylight.controller.config.spi.Module;
+import org.opendaylight.controller.config.threadpool.util.FixedThreadPoolWrapper;
+import org.opendaylight.controller.config.yang.threadpool.ThreadPoolServiceInterface;
+
+public class TestingFixedThreadPoolModule extends AbstractMockedModule implements ThreadPoolServiceInterface, Module {
+
+    public TestingFixedThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {
+        super(old, id);
+    }
+
+    @Override
+    protected AutoCloseable prepareMockedInstance() throws Exception {
+        FixedThreadPoolWrapper pool = mock(FixedThreadPoolWrapper.class);
+        doNothing().when(pool).close();
+        doReturn(mock(ExecutorService.class)).when(pool).getExecutor();
+        return pool;
+    }
+
+}
index 43cb7e1..f0e8a10 100644 (file)
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.config.threadpool.flexible;\r
-\r
-import org.junit.Before;\r
-import org.junit.Test;\r
-import org.opendaylight.controller.config.api.ConflictingVersionException;\r
-import org.opendaylight.controller.config.api.ValidationException;\r
-import org.opendaylight.controller.config.api.jmx.CommitStatus;\r
-import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;\r
-import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;\r
-import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.flexible.FlexibleThreadPoolModuleFactory;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.flexible.FlexibleThreadPoolModuleMXBean;\r
-\r
-import javax.management.InstanceAlreadyExistsException;\r
-import javax.management.InstanceNotFoundException;\r
-import javax.management.ObjectName;\r
-\r
-import static org.junit.Assert.assertThat;\r
-import static org.junit.Assert.fail;\r
-import static org.junit.matchers.JUnitMatchers.containsString;\r
-\r
-public class FlexibleThreadPoolConfigBeanTest extends AbstractConfigTest {\r
-\r
-    private FlexibleThreadPoolModuleFactory flexibleFactory;\r
-    private final String instanceName = "flexible1";\r
-    private final String threadFactoryName = "threadFactoryName";\r
-\r
-    @Before\r
-    public void setUp() {\r
-\r
-        flexibleFactory = new FlexibleThreadPoolModuleFactory();\r
-        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(flexibleFactory,\r
-                new NamingThreadFactoryModuleFactory()));\r
-    }\r
-\r
-    @Test\r
-    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,\r
-            ConflictingVersionException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        createFlexible(transaction, instanceName, threadFactoryName, 1, 20, 20);\r
-        transaction.validateConfig();\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, flexibleFactory.getImplementationName());\r
-        assertStatus(status, 2, 0, 0);\r
-    }\r
-\r
-    @Test\r
-    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,\r
-            ValidationException {\r
-\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createFlexible(transaction, instanceName, threadFactoryName, 1, 20, 10);\r
-\r
-        transaction.commit();\r
-\r
-        assertBeanCount(1, flexibleFactory.getImplementationName());\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, flexibleFactory.getImplementationName());\r
-        assertStatus(status, 0, 0, 2);\r
-\r
-    }\r
-\r
-    @Test\r
-    public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        try {\r
-            createFlexible(transaction, instanceName, threadFactoryName, 1, 1, 2);\r
-            transaction.commit();\r
-        } catch (InstanceAlreadyExistsException e1) {\r
-            fail();\r
-        }\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        try {\r
-            createFlexible(transaction, instanceName, "threadFactoryName1", 2, 2, 2);\r
-            fail();\r
-        } catch (InstanceAlreadyExistsException e) {\r
-            assertThat(\r
-                    e.getMessage(),\r
-                    containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-flexible', instanceName='flexible1'}"));\r
-        }\r
-    }\r
-\r
-    @Test\r
-    public void testValidationException() throws InstanceAlreadyExistsException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        createFlexible(transaction, instanceName, threadFactoryName, 0, 10, 10);\r
-\r
-        try {\r
-            transaction.validateConfig();\r
-            fail();\r
-        } catch (ValidationException e) {\r
-            assertThat(e.getMessage(), containsString("MinThreadCount must be greater than zero"));\r
-        }\r
-    }\r
-\r
-    @Test\r
-    public void testValidationException2() throws InstanceAlreadyExistsException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        createFlexible(transaction, instanceName, threadFactoryName, 0, 0, 10);\r
-\r
-        try {\r
-            transaction.validateConfig();\r
-            fail();\r
-        } catch (ValidationException e) {\r
-            assertThat(e.getMessage(), containsString("KeepAliveMillis must be greater than zero"));\r
-        }\r
-    }\r
-\r
-    @Test\r
-    public void testValidationException3() throws InstanceAlreadyExistsException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        createFlexible(transaction, instanceName, threadFactoryName, 10, 50, 0);\r
-\r
-        try {\r
-            transaction.validateConfig();\r
-            fail();\r
-        } catch (ValidationException e) {\r
-            assertThat(e.getMessage(), containsString("MaxThreadCount must be greater than zero"));\r
-        }\r
-    }\r
-\r
-    private ObjectName createFlexible(ConfigTransactionJMXClient transaction, String instanceName,\r
-            String threadFactoryName, int minThreadCount, long keepAliveMillis, int maxThreadCount)\r
-            throws InstanceAlreadyExistsException {\r
-\r
-        ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, threadFactoryName);\r
-        NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON,\r
-                NamingThreadFactoryModuleMXBean.class);\r
-        namingThreadFactoryModuleMXBean.setNamePrefix("prefix");\r
-\r
-        ObjectName flexibleON = transaction.createModule(flexibleFactory.getImplementationName(), instanceName);\r
-        FlexibleThreadPoolModuleMXBean mxBean = transaction.newMBeanProxy(flexibleON,\r
-                FlexibleThreadPoolModuleMXBean.class);\r
-        mxBean.setKeepAliveMillis(keepAliveMillis);\r
-        mxBean.setMaxThreadCount(maxThreadCount);\r
-        mxBean.setMinThreadCount(minThreadCount);\r
-        mxBean.setThreadFactory(threadFactoryON);\r
-        return flexibleON;\r
-    }\r
-\r
-    @Test\r
-    public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException,\r
-            ConflictingVersionException, InstanceNotFoundException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createFlexible(transaction, instanceName, threadFactoryName, 2, 2, 2);\r
-\r
-        transaction.commit();\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        ObjectName databaseNew = transaction.lookupConfigBean(flexibleFactory.getImplementationName(), instanceName);\r
-        FlexibleThreadPoolModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew,\r
-                FlexibleThreadPoolModuleMXBean.class);\r
-        proxy.setMaxThreadCount(99);\r
-\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, flexibleFactory.getImplementationName());\r
-        assertStatus(status, 0, 1, 1);\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.threadpool.flexible;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.controller.config.api.ConflictingVersionException;
+import org.opendaylight.controller.config.api.ValidationException;
+import org.opendaylight.controller.config.api.jmx.CommitStatus;
+import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
+import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
+import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
+import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory;
+import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean;
+import org.opendaylight.controller.config.yang.threadpool.impl.flexible.FlexibleThreadPoolModuleFactory;
+import org.opendaylight.controller.config.yang.threadpool.impl.flexible.FlexibleThreadPoolModuleMXBean;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.ObjectName;
+
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.containsString;
+
+public class FlexibleThreadPoolConfigBeanTest extends AbstractConfigTest {
+
+    private FlexibleThreadPoolModuleFactory flexibleFactory;
+    private final String instanceName = "flexible1";
+    private final String threadFactoryName = "threadFactoryName";
+
+    @Before
+    public void setUp() {
+
+        flexibleFactory = new FlexibleThreadPoolModuleFactory();
+        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(flexibleFactory,
+                new NamingThreadFactoryModuleFactory()));
+    }
+
+    @Test
+    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,
+            ConflictingVersionException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        createFlexible(transaction, instanceName, threadFactoryName, 1, 20, 20);
+        transaction.validateConfig();
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, flexibleFactory.getImplementationName());
+        assertStatus(status, 2, 0, 0);
+    }
+
+    @Test
+    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,
+            ValidationException {
+
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createFlexible(transaction, instanceName, threadFactoryName, 1, 20, 10);
+
+        transaction.commit();
+
+        assertBeanCount(1, flexibleFactory.getImplementationName());
+
+        transaction = configRegistryClient.createTransaction();
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, flexibleFactory.getImplementationName());
+        assertStatus(status, 0, 0, 2);
+
+    }
+
+    @Test
+    public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        try {
+            createFlexible(transaction, instanceName, threadFactoryName, 1, 1, 2);
+            transaction.commit();
+        } catch (InstanceAlreadyExistsException e1) {
+            fail();
+        }
+
+        transaction = configRegistryClient.createTransaction();
+        try {
+            createFlexible(transaction, instanceName, "threadFactoryName1", 2, 2, 2);
+            fail();
+        } catch (InstanceAlreadyExistsException e) {
+            assertThat(
+                    e.getMessage(),
+                    containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-flexible', instanceName='flexible1'}"));
+        }
+    }
+
+    @Test
+    public void testValidationException() throws InstanceAlreadyExistsException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        createFlexible(transaction, instanceName, threadFactoryName, 0, 10, 10);
+
+        try {
+            transaction.validateConfig();
+            fail();
+        } catch (ValidationException e) {
+            assertThat(e.getMessage(), containsString("MinThreadCount must be greater than zero"));
+        }
+    }
+
+    @Test
+    public void testValidationException2() throws InstanceAlreadyExistsException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        createFlexible(transaction, instanceName, threadFactoryName, 0, 0, 10);
+
+        try {
+            transaction.validateConfig();
+            fail();
+        } catch (ValidationException e) {
+            assertThat(e.getMessage(), containsString("KeepAliveMillis must be greater than zero"));
+        }
+    }
+
+    @Test
+    public void testValidationException3() throws InstanceAlreadyExistsException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        createFlexible(transaction, instanceName, threadFactoryName, 10, 50, 0);
+
+        try {
+            transaction.validateConfig();
+            fail();
+        } catch (ValidationException e) {
+            assertThat(e.getMessage(), containsString("MaxThreadCount must be greater than zero"));
+        }
+    }
+
+    private ObjectName createFlexible(ConfigTransactionJMXClient transaction, String instanceName,
+            String threadFactoryName, int minThreadCount, long keepAliveMillis, int maxThreadCount)
+            throws InstanceAlreadyExistsException {
+
+        ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, threadFactoryName);
+        NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON,
+                NamingThreadFactoryModuleMXBean.class);
+        namingThreadFactoryModuleMXBean.setNamePrefix("prefix");
+
+        ObjectName flexibleON = transaction.createModule(flexibleFactory.getImplementationName(), instanceName);
+        FlexibleThreadPoolModuleMXBean mxBean = transaction.newMBeanProxy(flexibleON,
+                FlexibleThreadPoolModuleMXBean.class);
+        mxBean.setKeepAliveMillis(keepAliveMillis);
+        mxBean.setMaxThreadCount(maxThreadCount);
+        mxBean.setMinThreadCount(minThreadCount);
+        mxBean.setThreadFactory(threadFactoryON);
+        return flexibleON;
+    }
+
+    @Test
+    public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException,
+            ConflictingVersionException, InstanceNotFoundException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createFlexible(transaction, instanceName, threadFactoryName, 2, 2, 2);
+
+        transaction.commit();
+
+        transaction = configRegistryClient.createTransaction();
+        ObjectName databaseNew = transaction.lookupConfigBean(flexibleFactory.getImplementationName(), instanceName);
+        FlexibleThreadPoolModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew,
+                FlexibleThreadPoolModuleMXBean.class);
+        proxy.setMaxThreadCount(99);
+
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, flexibleFactory.getImplementationName());
+        assertStatus(status, 0, 1, 1);
+    }
+
+}
index 7280b04..6dea96e 100644 (file)
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.config.threadpool.naming;\r
-\r
-import static org.junit.Assert.assertEquals;\r
-import static org.junit.Assert.assertThat;\r
-import static org.junit.Assert.assertTrue;\r
-import static org.junit.Assert.fail;\r
-import static org.junit.matchers.JUnitMatchers.containsString;\r
-\r
-import javax.management.InstanceAlreadyExistsException;\r
-import javax.management.InstanceNotFoundException;\r
-import javax.management.ObjectName;\r
-\r
-import org.junit.Before;\r
-import org.junit.Test;\r
-import org.opendaylight.controller.config.api.ConflictingVersionException;\r
-import org.opendaylight.controller.config.api.ValidationException;\r
-import org.opendaylight.controller.config.api.jmx.CommitStatus;\r
-import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;\r
-import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;\r
-import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;\r
-import org.opendaylight.controller.config.yang.threadpool.ThreadFactoryServiceInterface;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean;\r
-\r
-public class NamingThreadPoolFactoryConfigBeanTest extends AbstractConfigTest {\r
-\r
-    private NamingThreadFactoryModuleFactory factory;\r
-    private final String instanceName = "named";\r
-\r
-    @Before\r
-    public void setUp() {\r
-\r
-        factory = new NamingThreadFactoryModuleFactory();\r
-        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory));\r
-    }\r
-\r
-    @Test\r
-    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,\r
-            ConflictingVersionException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        createNamed(transaction, instanceName, "prefixes");\r
-        transaction.validateConfig();\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size());\r
-        assertEquals(1, status.getNewInstances().size());\r
-        assertEquals(0, status.getRecreatedInstances().size());\r
-        assertEquals(0, status.getReusedInstances().size());\r
-    }\r
-\r
-    @Test\r
-    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,\r
-            ValidationException {\r
-\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createNamed(transaction, instanceName, "prefixes");\r
-\r
-        transaction.commit();\r
-\r
-        assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size());\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size());\r
-        assertEquals(0, status.getNewInstances().size());\r
-        assertEquals(0, status.getRecreatedInstances().size());\r
-        assertEquals(1, status.getReusedInstances().size());\r
-\r
-    }\r
-\r
-    @Test\r
-    public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException,\r
-            InstanceAlreadyExistsException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        createNamed(transaction, instanceName, "prefixes");\r
-        transaction.commit();\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        try {\r
-            createNamed(transaction, instanceName, "prefixes1");\r
-            fail();\r
-        } catch (InstanceAlreadyExistsException e) {\r
-            assertThat(\r
-                    e.getMessage(),\r
-                    containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadfactory-naming', instanceName='named'}"));\r
-        }\r
-    }\r
-\r
-    @Test\r
-    public void testValidationException() throws InstanceAlreadyExistsException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);\r
-        transaction.newMXBeanProxy(nameCreated, ThreadFactoryServiceInterface.class);\r
-        try {\r
-            transaction.validateConfig();\r
-            fail();\r
-        } catch (ValidationException e) {\r
-            assertTrue(e.getFailedValidations().containsKey(factory.getImplementationName()));\r
-            assertEquals(1, e.getFailedValidations().get(factory.getImplementationName()).keySet().size());\r
-        }\r
-    }\r
-\r
-    @Test\r
-    public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException,\r
-            ConflictingVersionException, InstanceNotFoundException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createNamed(transaction, instanceName, "pref");\r
-\r
-        transaction.commit();\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        ObjectName databaseNew = transaction.lookupConfigBean(factory.getImplementationName(), instanceName);\r
-        NamingThreadFactoryModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew,\r
-                NamingThreadFactoryModuleMXBean.class);\r
-        proxy.setNamePrefix("pref1");\r
-\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-        assertStatus(status, 0, 1, 0);\r
-    }\r
-\r
-    private ObjectName createNamed(ConfigTransactionJMXClient transaction, String instanceName, String prefixes)\r
-            throws InstanceAlreadyExistsException {\r
-        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);\r
-        NamingThreadFactoryModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated,\r
-                NamingThreadFactoryModuleMXBean.class);\r
-        mxBean.setNamePrefix(prefixes);\r
-        return nameCreated;\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.threadpool.naming;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.containsString;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.ObjectName;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.controller.config.api.ConflictingVersionException;
+import org.opendaylight.controller.config.api.ValidationException;
+import org.opendaylight.controller.config.api.jmx.CommitStatus;
+import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
+import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
+import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
+import org.opendaylight.controller.config.yang.threadpool.ThreadFactoryServiceInterface;
+import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory;
+import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean;
+
+public class NamingThreadPoolFactoryConfigBeanTest extends AbstractConfigTest {
+
+    private NamingThreadFactoryModuleFactory factory;
+    private final String instanceName = "named";
+
+    @Before
+    public void setUp() {
+
+        factory = new NamingThreadFactoryModuleFactory();
+        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory));
+    }
+
+    @Test
+    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,
+            ConflictingVersionException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        createNamed(transaction, instanceName, "prefixes");
+        transaction.validateConfig();
+        CommitStatus status = transaction.commit();
+
+        assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size());
+        assertEquals(1, status.getNewInstances().size());
+        assertEquals(0, status.getRecreatedInstances().size());
+        assertEquals(0, status.getReusedInstances().size());
+    }
+
+    @Test
+    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,
+            ValidationException {
+
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createNamed(transaction, instanceName, "prefixes");
+
+        transaction.commit();
+
+        assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size());
+
+        transaction = configRegistryClient.createTransaction();
+        CommitStatus status = transaction.commit();
+
+        assertEquals(1, configRegistry.lookupConfigBeans(factory.getImplementationName()).size());
+        assertEquals(0, status.getNewInstances().size());
+        assertEquals(0, status.getRecreatedInstances().size());
+        assertEquals(1, status.getReusedInstances().size());
+
+    }
+
+    @Test
+    public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException,
+            InstanceAlreadyExistsException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        createNamed(transaction, instanceName, "prefixes");
+        transaction.commit();
+
+        transaction = configRegistryClient.createTransaction();
+        try {
+            createNamed(transaction, instanceName, "prefixes1");
+            fail();
+        } catch (InstanceAlreadyExistsException e) {
+            assertThat(
+                    e.getMessage(),
+                    containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadfactory-naming', instanceName='named'}"));
+        }
+    }
+
+    @Test
+    public void testValidationException() throws InstanceAlreadyExistsException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);
+        transaction.newMXBeanProxy(nameCreated, ThreadFactoryServiceInterface.class);
+        try {
+            transaction.validateConfig();
+            fail();
+        } catch (ValidationException e) {
+            assertTrue(e.getFailedValidations().containsKey(factory.getImplementationName()));
+            assertEquals(1, e.getFailedValidations().get(factory.getImplementationName()).keySet().size());
+        }
+    }
+
+    @Test
+    public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException,
+            ConflictingVersionException, InstanceNotFoundException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createNamed(transaction, instanceName, "pref");
+
+        transaction.commit();
+
+        transaction = configRegistryClient.createTransaction();
+        ObjectName databaseNew = transaction.lookupConfigBean(factory.getImplementationName(), instanceName);
+        NamingThreadFactoryModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew,
+                NamingThreadFactoryModuleMXBean.class);
+        proxy.setNamePrefix("pref1");
+
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+        assertStatus(status, 0, 1, 0);
+    }
+
+    private ObjectName createNamed(ConfigTransactionJMXClient transaction, String instanceName, String prefixes)
+            throws InstanceAlreadyExistsException {
+        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);
+        NamingThreadFactoryModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated,
+                NamingThreadFactoryModuleMXBean.class);
+        mxBean.setNamePrefix(prefixes);
+        return nameCreated;
+    }
+
+}
index f22da34..47613bf 100644 (file)
@@ -1,66 +1,66 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.config.threadpool.naming;\r
-\r
-import static org.mockito.Matchers.any;\r
-import static org.mockito.Mockito.doNothing;\r
-import static org.mockito.Mockito.doReturn;\r
-import static org.mockito.Mockito.mock;\r
-\r
-import java.io.Closeable;\r
-import java.io.IOException;\r
-\r
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;\r
-import org.opendaylight.controller.config.api.ModuleIdentifier;\r
-import org.opendaylight.controller.config.spi.Module;\r
-import org.opendaylight.controller.config.threadpool.util.NamingThreadPoolFactory;\r
-import org.opendaylight.controller.config.yang.threadpool.ThreadFactoryServiceInterface;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean;\r
-\r
-public class TestingNamingThreadPoolFactoryModule implements Module, ThreadFactoryServiceInterface,\r
-        NamingThreadFactoryModuleMXBean {\r
-\r
-    private final NamingThreadPoolFactory fact;\r
-\r
-    public TestingNamingThreadPoolFactoryModule() throws IOException {\r
-        fact = mock(NamingThreadPoolFactory.class);\r
-        Thread thread = mock(Thread.class);\r
-        doNothing().when(thread).start();\r
-        doReturn(thread).when(fact).newThread(any(Runnable.class));\r
-        doNothing().when(fact).close();\r
-    }\r
-\r
-    public TestingNamingThreadPoolFactoryModule(DynamicMBeanWithInstance old) {\r
-        fact = (NamingThreadPoolFactory) old.getInstance();\r
-    }\r
-\r
-    @Override\r
-    public ModuleIdentifier getIdentifier() {\r
-        return new ModuleIdentifier(TestingNamingThreadPoolFactoryModule.class.getCanonicalName(), "mock");\r
-    }\r
-\r
-    @Override\r
-    public String getNamePrefix() {\r
-        return null;\r
-    }\r
-\r
-    @Override\r
-    public void setNamePrefix(String arg) {\r
-        throw new UnsupportedOperationException();\r
-    }\r
-\r
-    @Override\r
-    public void validate() {\r
-    }\r
-\r
-    @Override\r
-    public Closeable getInstance() {\r
-        return fact;\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.threadpool.naming;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
+import java.io.Closeable;
+import java.io.IOException;
+
+import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.config.spi.Module;
+import org.opendaylight.controller.config.threadpool.util.NamingThreadPoolFactory;
+import org.opendaylight.controller.config.yang.threadpool.ThreadFactoryServiceInterface;
+import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean;
+
+public class TestingNamingThreadPoolFactoryModule implements Module, ThreadFactoryServiceInterface,
+        NamingThreadFactoryModuleMXBean {
+
+    private final NamingThreadPoolFactory fact;
+
+    public TestingNamingThreadPoolFactoryModule() throws IOException {
+        fact = mock(NamingThreadPoolFactory.class);
+        Thread thread = mock(Thread.class);
+        doNothing().when(thread).start();
+        doReturn(thread).when(fact).newThread(any(Runnable.class));
+        doNothing().when(fact).close();
+    }
+
+    public TestingNamingThreadPoolFactoryModule(DynamicMBeanWithInstance old) {
+        fact = (NamingThreadPoolFactory) old.getInstance();
+    }
+
+    @Override
+    public ModuleIdentifier getIdentifier() {
+        return new ModuleIdentifier(TestingNamingThreadPoolFactoryModule.class.getCanonicalName(), "mock");
+    }
+
+    @Override
+    public String getNamePrefix() {
+        return null;
+    }
+
+    @Override
+    public void setNamePrefix(String arg) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void validate() {
+    }
+
+    @Override
+    public Closeable getInstance() {
+        return fact;
+    }
+
+}
index 6183cb5..538d437 100644 (file)
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.config.threadpool.scheduled;\r
-\r
-import org.junit.Before;\r
-import org.junit.Test;\r
-import org.opendaylight.controller.config.api.ConflictingVersionException;\r
-import org.opendaylight.controller.config.api.ValidationException;\r
-import org.opendaylight.controller.config.api.jmx.CommitStatus;\r
-import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;\r
-import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;\r
-import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleFactory;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleMXBean;\r
-\r
-import javax.management.InstanceAlreadyExistsException;\r
-import javax.management.InstanceNotFoundException;\r
-import javax.management.ObjectName;\r
-\r
-import static org.junit.Assert.assertEquals;\r
-import static org.junit.Assert.assertThat;\r
-import static org.junit.Assert.assertTrue;\r
-import static org.junit.Assert.fail;\r
-import static org.junit.matchers.JUnitMatchers.containsString;\r
-\r
-public class ScheduledThreadPoolConfigBeanTest extends AbstractConfigTest {\r
-\r
-    private ScheduledThreadPoolModuleFactory factory;\r
-    private final String instanceName = "scheduled1";\r
-\r
-    @Before\r
-    public void setUp() {\r
-\r
-        factory = new ScheduledThreadPoolModuleFactory();\r
-        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory,\r
-                new NamingThreadFactoryModuleFactory()));\r
-    }\r
-\r
-    @Test\r
-    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,\r
-            ConflictingVersionException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-\r
-        createScheduled(transaction, instanceName, 1);\r
-        transaction.validateConfig();\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-        assertStatus(status, 2, 0, 0);\r
-    }\r
-\r
-    @Test\r
-    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,\r
-            ValidationException {\r
-\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createScheduled(transaction, instanceName, 1);\r
-\r
-        transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-        assertStatus(status, 0, 0, 2);\r
-    }\r
-\r
-    @Test\r
-    public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException,\r
-            ConflictingVersionException, InstanceNotFoundException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createScheduled(transaction, instanceName, 1);\r
-\r
-        transaction.commit();\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        ObjectName databaseNew = transaction.lookupConfigBean(factory.getImplementationName(), instanceName);\r
-        ScheduledThreadPoolModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew,\r
-                ScheduledThreadPoolModuleMXBean.class);\r
-        proxy.setMaxThreadCount(99);\r
-\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(1, factory.getImplementationName());\r
-        assertStatus(status, 0, 1, 1);\r
-    }\r
-\r
-    @Test\r
-    public void testDestroy() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException,\r
-            InstanceNotFoundException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createScheduled(transaction, instanceName, 1);\r
-\r
-        transaction.commit();\r
-\r
-        transaction = configRegistryClient.createTransaction();\r
-        transaction.destroyConfigBean(factory.getImplementationName(), instanceName);\r
-        CommitStatus status = transaction.commit();\r
-\r
-        assertBeanCount(0, factory.getImplementationName());\r
-        assertStatus(status, 0, 0, 1);\r
-    }\r
-\r
-    @Test\r
-    public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException,\r
-            InstanceAlreadyExistsException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createScheduled(transaction, instanceName, 1);\r
-        transaction.commit();\r
-        transaction = configRegistryClient.createTransaction();\r
-        try {\r
-            createScheduled(transaction, instanceName, 2);\r
-            fail();\r
-        } catch (InstanceAlreadyExistsException e) {\r
-            assertThat(\r
-                    e.getMessage(),\r
-                    containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-scheduled', instanceName='scheduled1'}"));\r
-        }\r
-    }\r
-\r
-    @Test\r
-    public void testValidationException() throws InstanceAlreadyExistsException {\r
-        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();\r
-        createScheduled(transaction, instanceName, 0);\r
-\r
-        try {\r
-            transaction.validateConfig();\r
-            fail();\r
-        } catch (ValidationException e) {\r
-            assertTrue(e.getFailedValidations().containsKey(factory.getImplementationName()));\r
-            assertEquals(1, e.getFailedValidations().get(factory.getImplementationName()).keySet().size());\r
-        }\r
-    }\r
-\r
-    private ObjectName createScheduled(ConfigTransactionJMXClient transaction, String instanceName, int maxThreadCount)\r
-            throws InstanceAlreadyExistsException {\r
-        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);\r
-        ScheduledThreadPoolModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated,\r
-                ScheduledThreadPoolModuleMXBean.class);\r
-        mxBean.setMaxThreadCount(maxThreadCount);\r
-\r
-        ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, "naming");\r
-        NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON,\r
-                NamingThreadFactoryModuleMXBean.class);\r
-        namingThreadFactoryModuleMXBean.setNamePrefix("prefix");\r
-\r
-        mxBean.setThreadFactory(threadFactoryON);\r
-\r
-        return nameCreated;\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.threadpool.scheduled;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.controller.config.api.ConflictingVersionException;
+import org.opendaylight.controller.config.api.ValidationException;
+import org.opendaylight.controller.config.api.jmx.CommitStatus;
+import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
+import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
+import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
+import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleFactory;
+import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean;
+import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleFactory;
+import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleMXBean;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.ObjectName;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.containsString;
+
+public class ScheduledThreadPoolConfigBeanTest extends AbstractConfigTest {
+
+    private ScheduledThreadPoolModuleFactory factory;
+    private final String instanceName = "scheduled1";
+
+    @Before
+    public void setUp() {
+
+        factory = new ScheduledThreadPoolModuleFactory();
+        super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(factory,
+                new NamingThreadFactoryModuleFactory()));
+    }
+
+    @Test
+    public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException,
+            ConflictingVersionException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+
+        createScheduled(transaction, instanceName, 1);
+        transaction.validateConfig();
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+        assertStatus(status, 2, 0, 0);
+    }
+
+    @Test
+    public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException,
+            ValidationException {
+
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createScheduled(transaction, instanceName, 1);
+
+        transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+
+        transaction = configRegistryClient.createTransaction();
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+        assertStatus(status, 0, 0, 2);
+    }
+
+    @Test
+    public void testReconfigurationInstance() throws InstanceAlreadyExistsException, ValidationException,
+            ConflictingVersionException, InstanceNotFoundException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createScheduled(transaction, instanceName, 1);
+
+        transaction.commit();
+
+        transaction = configRegistryClient.createTransaction();
+        ObjectName databaseNew = transaction.lookupConfigBean(factory.getImplementationName(), instanceName);
+        ScheduledThreadPoolModuleMXBean proxy = transaction.newMXBeanProxy(databaseNew,
+                ScheduledThreadPoolModuleMXBean.class);
+        proxy.setMaxThreadCount(99);
+
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(1, factory.getImplementationName());
+        assertStatus(status, 0, 1, 1);
+    }
+
+    @Test
+    public void testDestroy() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException,
+            InstanceNotFoundException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createScheduled(transaction, instanceName, 1);
+
+        transaction.commit();
+
+        transaction = configRegistryClient.createTransaction();
+        transaction.destroyConfigBean(factory.getImplementationName(), instanceName);
+        CommitStatus status = transaction.commit();
+
+        assertBeanCount(0, factory.getImplementationName());
+        assertStatus(status, 0, 0, 1);
+    }
+
+    @Test
+    public void testInstanceAlreadyExistsException() throws ConflictingVersionException, ValidationException,
+            InstanceAlreadyExistsException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createScheduled(transaction, instanceName, 1);
+        transaction.commit();
+        transaction = configRegistryClient.createTransaction();
+        try {
+            createScheduled(transaction, instanceName, 2);
+            fail();
+        } catch (InstanceAlreadyExistsException e) {
+            assertThat(
+                    e.getMessage(),
+                    containsString("There is an instance registered with name ModuleIdentifier{factoryName='threadpool-scheduled', instanceName='scheduled1'}"));
+        }
+    }
+
+    @Test
+    public void testValidationException() throws InstanceAlreadyExistsException {
+        ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
+        createScheduled(transaction, instanceName, 0);
+
+        try {
+            transaction.validateConfig();
+            fail();
+        } catch (ValidationException e) {
+            assertTrue(e.getFailedValidations().containsKey(factory.getImplementationName()));
+            assertEquals(1, e.getFailedValidations().get(factory.getImplementationName()).keySet().size());
+        }
+    }
+
+    private ObjectName createScheduled(ConfigTransactionJMXClient transaction, String instanceName, int maxThreadCount)
+            throws InstanceAlreadyExistsException {
+        ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);
+        ScheduledThreadPoolModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated,
+                ScheduledThreadPoolModuleMXBean.class);
+        mxBean.setMaxThreadCount(maxThreadCount);
+
+        ObjectName threadFactoryON = transaction.createModule(NamingThreadFactoryModuleFactory.NAME, "naming");
+        NamingThreadFactoryModuleMXBean namingThreadFactoryModuleMXBean = transaction.newMXBeanProxy(threadFactoryON,
+                NamingThreadFactoryModuleMXBean.class);
+        namingThreadFactoryModuleMXBean.setNamePrefix("prefix");
+
+        mxBean.setThreadFactory(threadFactoryON);
+
+        return nameCreated;
+    }
+
+}
index 0fe5b0d..2ba1b3b 100644 (file)
@@ -1,82 +1,82 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.config.threadpool.scheduled;\r
-\r
-import com.google.common.util.concurrent.ListenableFutureTask;\r
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;\r
-import org.opendaylight.controller.config.api.ModuleIdentifier;\r
-import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;\r
-import org.opendaylight.controller.config.spi.Module;\r
-import org.opendaylight.controller.config.threadpool.util.ScheduledThreadPoolWrapper;\r
-import org.opendaylight.controller.config.yang.threadpool.ScheduledThreadPoolServiceInterface;\r
-import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleMXBean;\r
-\r
-import javax.management.ObjectName;\r
-import java.util.concurrent.ScheduledExecutorService;\r
-import java.util.concurrent.ScheduledFuture;\r
-import java.util.concurrent.TimeUnit;\r
-\r
-import static org.mockito.Matchers.any;\r
-import static org.mockito.Matchers.anyBoolean;\r
-import static org.mockito.Matchers.anyLong;\r
-import static org.mockito.Mockito.doNothing;\r
-import static org.mockito.Mockito.doReturn;\r
-import static org.mockito.Mockito.mock;\r
-\r
-public class TestingScheduledThreadPoolModule extends AbstractMockedModule implements\r
-        ScheduledThreadPoolServiceInterface, Module, ScheduledThreadPoolModuleMXBean {\r
-\r
-    public TestingScheduledThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {\r
-        super(old, id);\r
-    }\r
-\r
-    @Override\r
-    protected AutoCloseable prepareMockedInstance() throws Exception {\r
-        ScheduledThreadPoolWrapper instance = mock(ScheduledThreadPoolWrapper.class);\r
-        ScheduledExecutorService ses = mock(ScheduledExecutorService.class);\r
-        {// mockFuture\r
-            ScheduledFuture<?> future = mock(ScheduledFuture.class);\r
-            doReturn(false).when(future).cancel(anyBoolean());\r
-            try {\r
-                doReturn(mock(Object.class)).when(future).get();\r
-            } catch (Exception e) {\r
-                throw new RuntimeException(e);\r
-            }\r
-            doReturn(future).when(ses).schedule(any(Runnable.class), any(Long.class), any(TimeUnit.class));\r
-            doReturn(future).when(ses).scheduleWithFixedDelay(any(Runnable.class), anyLong(), anyLong(),\r
-                    any(TimeUnit.class));\r
-\r
-        }\r
-        doNothing().when(ses).execute(any(Runnable.class));\r
-        doNothing().when(ses).execute(any(ListenableFutureTask.class));\r
-        doReturn(ses).when(instance).getExecutor();\r
-        doNothing().when(instance).close();\r
-\r
-        doReturn(1).when(instance).getMaxThreadCount();\r
-        return instance;\r
-    }\r
-\r
-    @Override\r
-    public ObjectName getThreadFactory() {\r
-        return any(ObjectName.class);\r
-    }\r
-\r
-    @Override\r
-    public void setThreadFactory(ObjectName threadFactory) {\r
-    }\r
-\r
-    @Override\r
-    public Integer getMaxThreadCount() {\r
-        return 1;\r
-    }\r
-\r
-    @Override\r
-    public void setMaxThreadCount(Integer maxThreadCount) {\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.threadpool.scheduled;
+
+import com.google.common.util.concurrent.ListenableFutureTask;
+import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;
+import org.opendaylight.controller.config.spi.Module;
+import org.opendaylight.controller.config.threadpool.util.ScheduledThreadPoolWrapper;
+import org.opendaylight.controller.config.yang.threadpool.ScheduledThreadPoolServiceInterface;
+import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleMXBean;
+
+import javax.management.ObjectName;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
+public class TestingScheduledThreadPoolModule extends AbstractMockedModule implements
+        ScheduledThreadPoolServiceInterface, Module, ScheduledThreadPoolModuleMXBean {
+
+    public TestingScheduledThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {
+        super(old, id);
+    }
+
+    @Override
+    protected AutoCloseable prepareMockedInstance() throws Exception {
+        ScheduledThreadPoolWrapper instance = mock(ScheduledThreadPoolWrapper.class);
+        ScheduledExecutorService ses = mock(ScheduledExecutorService.class);
+        {// mockFuture
+            ScheduledFuture<?> future = mock(ScheduledFuture.class);
+            doReturn(false).when(future).cancel(anyBoolean());
+            try {
+                doReturn(mock(Object.class)).when(future).get();
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+            doReturn(future).when(ses).schedule(any(Runnable.class), any(Long.class), any(TimeUnit.class));
+            doReturn(future).when(ses).scheduleWithFixedDelay(any(Runnable.class), anyLong(), anyLong(),
+                    any(TimeUnit.class));
+
+        }
+        doNothing().when(ses).execute(any(Runnable.class));
+        doNothing().when(ses).execute(any(ListenableFutureTask.class));
+        doReturn(ses).when(instance).getExecutor();
+        doNothing().when(instance).close();
+
+        doReturn(1).when(instance).getMaxThreadCount();
+        return instance;
+    }
+
+    @Override
+    public ObjectName getThreadFactory() {
+        return any(ObjectName.class);
+    }
+
+    @Override
+    public void setThreadFactory(ObjectName threadFactory) {
+    }
+
+    @Override
+    public Integer getMaxThreadCount() {
+        return 1;
+    }
+
+    @Override
+    public void setMaxThreadCount(Integer maxThreadCount) {
+    }
+
+}
index a8119b8..c934530 100644 (file)
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <artifactId>config-subsystem</artifactId>
             <artifactId>binding-type-provider</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>net.sourceforge.pmd</groupId>
+            <artifactId>pmd</artifactId>
+            <version>5.1.0</version>
+            <scope>test</scope>
+        </dependency>
+
+
         <dependency>
             <groupId>org.eclipse.jdt</groupId>
             <artifactId>core</artifactId>
         </dependency>
 
 
-        <dependency>
-            <groupId>org.freemarker</groupId>
-            <artifactId>freemarker</artifactId>
-            <version>2.3.20</version>
-        </dependency>
-
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>config-api</artifactId>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.codehaus.gmaven.runtime</groupId>
+            <artifactId>gmaven-runtime-2.0</artifactId>
+            <version>1.5</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.sonatype.gossip</groupId>
+                    <artifactId>gossip</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
     </dependencies>
 
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <compilerId>groovy-eclipse-compiler</compilerId>
+                    <verbose>false</verbose>
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.codehaus.groovy</groupId>
+                        <artifactId>groovy-eclipse-compiler</artifactId>
+                        <version>2.8.0-01</version>
+                    </dependency>
+
+                    <dependency>
+                        <groupId>org.codehaus.groovy</groupId>
+                        <artifactId>groovy-eclipse-batch</artifactId>
+                        <version>2.1.8-01</version>
+                    </dependency>
+                </dependencies>
             </plugin>
+
         </plugins>
     </build>
 </project>
index 13d828a..dd2b504 100644 (file)
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
+import com.google.common.base.Optional;
+import com.google.common.collect.Lists;
+import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
+import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry;
+import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.GeneralClassTemplate;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.GeneralInterfaceTemplate;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.RuntimeRegistratorFtlTemplate;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.StubFactoryTemplate;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.AbsFactoryGeneratedObjectFactory;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.AbsModuleGeneratedObjectFactory;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.ConcreteModuleGeneratedObjectFactory;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.GenericGeneratedObjectFactory;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.GeneratedObject;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
 
-import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
-import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
+final class CodeWriter {
+
+    private static final Logger logger = LoggerFactory.getLogger(CodeWriter.class);
+    private static final Optional<String> copyright = StringUtil.loadCopyright();
+
+    public File writeSie(ServiceInterfaceEntry sie, File outputBaseDir) {
+        try {
+            GeneralInterfaceTemplate generalInterfaceTemplate = TemplateFactory.serviceInterfaceFromSie(sie);
+            GeneratedObject go = new GenericGeneratedObjectFactory().toGeneratedObject(generalInterfaceTemplate, copyright);
+            return go.persist(outputBaseDir).get().getValue();
+        } catch (Exception e) {
+            String message = "An error occurred during Service interface generating, sie:"
+                    + sie.getTypeName() + ", " + sie.getFullyQualifiedName();
+            logger.error(message, e);
+            throw new RuntimeException(message, e);
+        }
+    }
+
+    public List<File> writeMbe(ModuleMXBeanEntry mbe, File targetBaseDir,
+                               File mainBaseDir) {
+        try {
+            List<File> generatedFiles = Lists.newArrayList();
+
+
+            Map<GeneratedObject, Boolean /*overwrite*/> gos = new HashMap<>();
+
+            // generate mx interface and abstract factory
+
+            // TOs
+            Map<String,GeneralClassTemplate> tosFromMbe = TemplateFactory.tOsFromMbe(mbe);
+            for(GeneralClassTemplate template: tosFromMbe.values()) {
+                gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(template, copyright), true);
+            }
+
+            // MXBean interface
+            GeneralInterfaceTemplate ifcTemplate = TemplateFactory.mXBeanInterfaceTemplateFromMbe(mbe);
+            gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(ifcTemplate, copyright), true);
+
+
+            // generate abstract factory
+            gos.put(new AbsFactoryGeneratedObjectFactory().toGeneratedObject(mbe, copyright), true);
+
+            // generate abstract module
+            gos.put(new AbsModuleGeneratedObjectFactory().toGeneratedObject(mbe, copyright), true);
+
+            // generate concrete factory
+            StubFactoryTemplate concreteFactory = TemplateFactory.stubFactoryTemplateFromMbe(mbe);
+            gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(concreteFactory, copyright), false);
+
+
+            // generate concrete module
+
+            gos.put(new ConcreteModuleGeneratedObjectFactory().toGeneratedObject(mbe, copyright, Optional.<String>absent()), false);
+
+            // write runtime bean MXBeans and registrators
+            List<FtlTemplate> allFtlFiles = getRuntimeBeanFtlTemplates(mbe.getRuntimeBeans());
+            for(FtlTemplate template: allFtlFiles) {
+                gos.put(new GenericGeneratedObjectFactory().toGeneratedObject(template, copyright), true);
+            }
+
+            generatedFiles.addAll(persistGeneratedObjects(targetBaseDir, mainBaseDir, gos));
+
+            // purge nulls
+            for (Iterator<File> it = generatedFiles.iterator(); it.hasNext(); ) {
+                if (it.next() == null) {
+                    it.remove();
+                }
+            }
+
+            return generatedFiles;
+
+        } catch (Exception e) {
+            String message = "An error occurred during Module generating, mbe:"
+                    + mbe.getJavaNamePrefix();
+            logger.error(message, e);
+            throw new RuntimeException(message, e);
+        }
+    }
 
-public interface CodeWriter {
+    private List<File> persistGeneratedObjects(File targetBaseDir, File mainBaseDir, Map<GeneratedObject, Boolean> gos) throws IOException {
+        List<File> generatedFiles = new ArrayList<>();
+        for (Entry<GeneratedObject, Boolean> entry : gos.entrySet()) {
+            boolean overwrite = entry.getValue();
+            File dst;
+            if (overwrite) {
+                dst = targetBaseDir;
+            } else {
+                dst = mainBaseDir;
+            }
+            Optional<Entry<FullyQualifiedName, File>> maybePersistEntry = entry.getKey().persist(dst, overwrite);
 
-    File writeSie(ServiceInterfaceEntry sie, File targetBaseDir);
+            if (maybePersistEntry.isPresent()) {
+                generatedFiles.add(maybePersistEntry.get().getValue());
+            }
+        }
+        return generatedFiles;
+    }
 
-    List<File> writeMbe(ModuleMXBeanEntry mbe, File targetBaseDir,
-            File mainBaseDir, File resourceBaseDir);
+    private List<FtlTemplate> getRuntimeBeanFtlTemplates(Collection<RuntimeBeanEntry> runtimeBeans) {
+        if (runtimeBeans.isEmpty()) {
+            return Collections.emptyList();
+        }
+        List<FtlTemplate> allFtlFiles = new ArrayList<>();
+        { // registrators
+            Map<String, FtlTemplate> registratorNamesToFtls = RuntimeRegistratorFtlTemplate
+                    .create(RuntimeRegistratorFtlTemplate.findRoot(runtimeBeans));
 
+            allFtlFiles.addAll(registratorNamesToFtls.values());
+        }
+        { // TOs, MXBean interfaces
+            for (RuntimeBeanEntry runtimeBeanEntry : runtimeBeans) {
+                Collection<FtlTemplate> ftlFiles = TemplateFactory
+                        .getTOAndMXInterfaceFtlFiles(runtimeBeanEntry)
+                        .values();
+                allFtlFiles.addAll(ftlFiles);
+            }
+        }
+        return allFtlFiles;
+    }
 }
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/FreeMarkerCodeWriterImpl.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/FreeMarkerCodeWriterImpl.java
deleted file mode 100644 (file)
index 2b84ed1..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.config.yangjmxgenerator.plugin;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
-import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry;
-import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlFilePersister;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.RuntimeRegistratorFtlTemplate;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.collect.Lists;
-
-final class FreeMarkerCodeWriterImpl implements CodeWriter {
-
-    private static final Logger logger = LoggerFactory
-            .getLogger(FreeMarkerCodeWriterImpl.class);
-
-    private final FtlFilePersister ftlFilePersister = new FtlFilePersister();
-
-    public FreeMarkerCodeWriterImpl() {
-    }
-
-    @Override
-    public File writeSie(ServiceInterfaceEntry sie, File outputBaseDir) {
-        try {
-            Collection<FtlTemplate> values = TemplateFactory.getFtlTemplates(
-                    sie).values();
-            return ftlFilePersister.persist(values, outputBaseDir, true).get(0);
-        } catch (Exception e) {
-            String message = "An error occurred during Service interface generating, sie:"
-                    + sie.getTypeName() + ", " + sie.getFullyQualifiedName();
-            logger.error(message, e);
-            throw new RuntimeException(message, e);
-        }
-    }
-
-    @Override
-    public List<File> writeMbe(ModuleMXBeanEntry mbe, File targetBaseDir,
-            File mainBaseDir, File resourceBaseDir) {
-        try {
-            List<File> generatedFiles = Lists.newArrayList();
-
-            generatedFiles.addAll(ftlFilePersister.persist(TemplateFactory
-                    .getFtlTemplates(mbe).values(), targetBaseDir, true));
-            generatedFiles.addAll(ftlFilePersister.persist(TemplateFactory
-                    .getFtlStubTemplates(mbe).values(), mainBaseDir, false));
-
-            // write runtime bean MXBeans and registrators
-            Collection<RuntimeBeanEntry> runtimeBeans = mbe.getRuntimeBeans();
-            if (runtimeBeans.size() > 0) {
-                List<FtlTemplate> allFtlFiles = new ArrayList<>();
-                { // registrators
-                    Map<String, FtlTemplate> registratorNamesToFtls = RuntimeRegistratorFtlTemplate
-                            .create(RuntimeRegistratorFtlTemplate.findRoot(runtimeBeans));
-
-                    allFtlFiles.addAll(registratorNamesToFtls.values());
-                }
-                { // TOs, MXBean interfaces
-                    for (RuntimeBeanEntry runtimeBeanEntry : runtimeBeans) {
-                        Collection<FtlTemplate> ftlFiles = TemplateFactory
-                                .getTOAndMXInterfaceFtlFiles(runtimeBeanEntry)
-                                .values();
-                        allFtlFiles.addAll(ftlFiles);
-                    }
-                }
-                boolean overwrite = true;
-
-                FtlFilePersister ftlFilePersister = new FtlFilePersister();
-                List<File> persisted = ftlFilePersister.persist(allFtlFiles,
-                        targetBaseDir, overwrite);
-                // FIXME: check for intersection
-                generatedFiles.addAll(persisted);
-            }
-
-            // purge nulls
-            for (Iterator<File> it = generatedFiles.iterator(); it.hasNext();) {
-                if (it.next() == null) {
-                    it.remove();
-                }
-            }
-
-            return generatedFiles;
-
-        } catch (Exception e) {
-            String message = "An error occurred during Module generating, mbe:"
-                    + mbe.getJavaNamePrefix();
-            logger.error(message, e);
-            throw new RuntimeException(message, e);
-        }
-    }
-
-}
index e41ac66..1b8905b 100644 (file)
@@ -12,16 +12,6 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.project.MavenProject;
@@ -40,6 +30,17 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.impl.StaticLoggerBinder;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 /**
  * This class interfaces with yang-maven-plugin. Gets parsed yang modules in
  * {@link SchemaContext}, and parameters form the plugin configuration, and
@@ -61,7 +62,7 @@ public class JMXGenerator implements CodeGenerator {
     private boolean generateModuleFactoryFile = true;
 
     public JMXGenerator() {
-        this.codeWriter = new FreeMarkerCodeWriterImpl();
+        this.codeWriter = new CodeWriter();
     }
 
     public JMXGenerator(CodeWriter codeWriter) {
@@ -139,7 +140,7 @@ public class JMXGenerator implements CodeGenerator {
                 ModuleMXBeanEntry mbe = mbeEntry.getValue();
                 try {
                     List<File> files1 = codeWriter.writeMbe(mbe, outputBaseDir,
-                            mainBaseDir, resourceBaseDir);
+                            mainBaseDir);
                     generatedFiles.addFile(files1);
                 } catch (Exception e) {
                     throw new RuntimeException(
index 35dc7a3..c3e51d6 100644 (file)
@@ -8,94 +8,26 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import com.google.common.collect.Lists;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
-import org.opendaylight.controller.config.spi.Module;
 import org.opendaylight.controller.config.spi.ModuleFactory;
-import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
-import org.osgi.framework.BundleContext;
 
 import java.util.Collections;
 import java.util.List;
 
-/**
- *
- */
 public class AbstractFactoryTemplate extends GeneralClassTemplate {
 
     private static final List<String> implementedIfcs = Lists
             .newArrayList(ModuleFactory.class.getCanonicalName());
 
-    private final String globallyUniqueName, moduleInstanceType;
-    private final List<String> providedServices;
-    private final ModuleMXBeanEntry mbe;
-
     public AbstractFactoryTemplate(Header header, String packageName,
-                                   String abstractFactoryName, String globallyUniqueName,
-                                   String moduleInstanceType, List<Field> fields,
-                                   List<String> providedServices, ModuleMXBeanEntry mbe) {
+                                   String abstractFactoryName,
+                                   List<Field> fields) {
         super(header, packageName, abstractFactoryName, Collections
                 .<String> emptyList(), implementedIfcs, fields, Collections
                 .<MethodDefinition> emptyList(), true, false, Collections
                 .<Constructor> emptyList());
-        this.globallyUniqueName = globallyUniqueName;
-        this.moduleInstanceType = moduleInstanceType;
-        this.providedServices = providedServices;
-        this.mbe = mbe;
-    }
-
-    public String getGloballyUniqueName() {
-        return globallyUniqueName;
-    }
-
-    public String getInstanceType() {
-        return AutoCloseable.class.getCanonicalName();
-    }
-
-    public String getModuleNameType() {
-        return ModuleIdentifier.class.getCanonicalName();
-    }
-
-    public String getModuleInstanceType() {
-        return moduleInstanceType;
-    }
-
-    public String getAbstractServiceInterfaceType() {
-        return AbstractServiceInterface.class.getCanonicalName();
-    }
-
-    public List<String> getProvidedServices() {
-        return providedServices;
-    }
-
-    public String getModuleType() {
-        return Module.class.getCanonicalName();
-    }
-
-    public String getDependencyResolverType() {
-        return DependencyResolver.class.getCanonicalName();
-    }
-
-    public String getDynamicMBeanWithInstanceType() {
-        return DynamicMBeanWithInstance.class.getCanonicalName();
-    }
-
-    public String getBundleContextType() {
-        return BundleContext.class.getCanonicalName();
-    }
-
-    @Override
-    public String getFtlTempleteLocation() {
-        return "factory_abs_template.ftl";
-    }
-
-    public ModuleMXBeanEntry getMbe() {
-        return mbe;
     }
 }
index 7f80299..a959978 100644 (file)
@@ -7,17 +7,18 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
-import java.io.File;
-import java.util.List;
-
+import com.google.common.base.Optional;
+import com.google.common.collect.Lists;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Method;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.TypeDeclaration;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FullyQualifiedNameHelper;
 
-import com.google.common.collect.Lists;
+import java.util.Collections;
+import java.util.List;
 
 public abstract class AbstractFtlTemplate implements FtlTemplate {
     private final String packageName;
@@ -44,6 +45,15 @@ public abstract class AbstractFtlTemplate implements FtlTemplate {
         return header;
     }
 
+    @Override
+    public Optional<String> getHeaderString() {
+        if (header == null) {
+            return Optional.absent();
+        } else {
+            return Optional.of(header.toString());
+        }
+    }
+
     @Override
     public String getFullyQualifiedName() {
         return FullyQualifiedNameHelper.getFullyQualifiedName(getPackageName(),
@@ -60,9 +70,14 @@ public abstract class AbstractFtlTemplate implements FtlTemplate {
         return typeDeclaration;
     }
 
+
     @Override
-    public String getJavadoc() {
-        return javadoc;
+    public Optional<String> getMaybeJavadoc() {
+        if (javadoc == null) {
+            return Optional.absent();
+        } else {
+            return Optional.of(javadoc);
+        }
     }
 
     public void setJavadoc(String javadoc) {
@@ -84,15 +99,10 @@ public abstract class AbstractFtlTemplate implements FtlTemplate {
         return methods;
     }
 
-    @Override
-    public File getRelativeFile() {
-        return new File(packageName.replace(".", File.separator),
-                getTypeDeclaration().getName() + ".java");
-    }
 
     @Override
-    public String getFtlTempleteLocation() {
-        return "abstract_ftl_file.ftl";
+    public List<Constructor> getConstructors() {
+        return Collections.emptyList();
     }
 
     @Override
index c40bfdf..92a71c2 100644 (file)
@@ -7,26 +7,15 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
-import java.util.Collections;
-import java.util.List;
-
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
-import org.opendaylight.controller.config.api.runtime.RootRuntimeBeanRegistrator;
-import org.opendaylight.controller.config.spi.Module;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.ModuleField;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-/**
- *
- */
+import java.util.Collections;
+import java.util.List;
+
 public class AbstractModuleTemplate extends GeneralClassTemplate {
 
     private final List<ModuleField> moduleFields;
@@ -50,22 +39,6 @@ public class AbstractModuleTemplate extends GeneralClassTemplate {
         return moduleFields;
     }
 
-    public String getInstanceType() {
-        return AutoCloseable.class.getCanonicalName();
-    }
-
-    public String getModuleNameType() {
-        return ModuleIdentifier.class.getCanonicalName();
-    }
-
-    public String getAbstractServiceInterfaceType() {
-        return AbstractServiceInterface.class.getCanonicalName();
-    }
-
-    public String getModuleType() {
-        return Module.class.getCanonicalName();
-    }
-
     public String getRegistratorType() {
         return registratorType;
     }
@@ -74,29 +47,4 @@ public class AbstractModuleTemplate extends GeneralClassTemplate {
         return runtime;
     }
 
-    public String getDependencyResolverType() {
-        return DependencyResolver.class.getCanonicalName();
-    }
-
-    public String getDynamicMBeanWithInstanceType() {
-        return DynamicMBeanWithInstance.class.getCanonicalName();
-    }
-
-    public String getRootRuntimeRegistratorType() {
-        return RootRuntimeBeanRegistrator.class.getCanonicalName();
-    }
-
-    @Override
-    public String getFtlTempleteLocation() {
-        return "module_abs_template_new.ftl";
-    }
-
-    public String getLoggerType() {
-        return Logger.class.getCanonicalName();
-    }
-
-    public String getLoggerFactoryType() {
-        return LoggerFactory.class.getCanonicalName();
-    }
-
 }
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersister.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlFilePersister.java
deleted file mode 100644 (file)
index 37d5e6b..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
-
-import com.google.common.annotations.VisibleForTesting;
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.AnnotationsDirective;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.ConstructorsDirective;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.FieldsDirectiveProg;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.HeaderDirective;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.JavadocDirective;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.MethodsDirective;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.ModuleFieldsDirective;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.TypeDeclarationDirective;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives.UnimplementedExceptionDirective;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.regex.Pattern;
-
-public class FtlFilePersister {
-    private static final Logger logger = LoggerFactory
-            .getLogger(FtlFilePersister.class);
-
-    private static final Pattern TRAILING_WHITESPACES = Pattern.compile(" +$", Pattern.MULTILINE);
-
-    @VisibleForTesting
-    public Map<FtlTemplate, String> serializeFtls(
-            Collection<? extends FtlTemplate> ftlFiles) {
-        Map<FtlTemplate, String> result = new HashMap<>();
-        for (FtlTemplate ftlFile : ftlFiles) {
-
-            try (Writer writer = new StringWriter()) {
-                Template template = getCfg().getTemplate(
-                        ftlFile.getFtlTempleteLocation());
-                try {
-                    template.process(ftlFile, writer);
-                } catch (Exception e) {
-                    throw new IllegalStateException(
-                            "Template error while generating " + ftlFile, e);
-                }
-                String fileContent = writer.toString();
-                // remove trailing spaces
-                fileContent = TRAILING_WHITESPACES.matcher(fileContent).replaceAll("");
-                result.put(ftlFile, fileContent);
-            } catch (IOException e) {
-                throw new IllegalStateException(
-                        "Exception while processing template", e);
-            }
-        }
-
-        return result;
-    }
-
-    public List<File> persist(Collection<? extends FtlTemplate> ftlFiles,
-            File dstFolder, boolean overwrite) throws IOException {
-        Map<FtlTemplate, String> ftlFileStringMap = serializeFtls(ftlFiles);
-        List<File> result = new ArrayList<>();
-        for (Entry<FtlTemplate, String> entry : ftlFileStringMap.entrySet()) {
-            FtlTemplate ftlFile = entry.getKey();
-            File targetFile = new File(dstFolder, ftlFile.getRelativeFile()
-                    .getPath());
-            File pathToFile = targetFile.getParentFile();
-            if (pathToFile.exists() == false) {
-                pathToFile.mkdirs();
-            }
-            if (targetFile.exists() && overwrite == false) {
-                logger.trace("Skipping {} since it already exists", targetFile);
-            } else {
-                try (Writer fileWriter = new FileWriter(targetFile)) {
-                    fileWriter.write(entry.getValue());
-                }
-                logger.trace("{}: File {} generated successfully",
-                        JMXGenerator.class.getCanonicalName(), targetFile);
-                result.add(targetFile);
-            }
-        }
-        return result;
-    }
-
-    private Configuration getCfg() {
-        Configuration cfg = new Configuration();
-        cfg.setClassForTemplateLoading(getClass(), "/freeMarker/");
-        cfg.setSharedVariable("javadocD", new JavadocDirective());
-        cfg.setSharedVariable("annotationsD", new AnnotationsDirective());
-        cfg.setSharedVariable("typeDeclarationD",
-                new TypeDeclarationDirective());
-        cfg.setSharedVariable("constructorsD", new ConstructorsDirective());
-        cfg.setSharedVariable("fieldsD", new FieldsDirectiveProg());
-        cfg.setSharedVariable("moduleFieldsD", new ModuleFieldsDirective());
-        cfg.setSharedVariable("methodsD", new MethodsDirective());
-        cfg.setSharedVariable("headerD", new HeaderDirective());
-        cfg.setSharedVariable("unimplementedExceptionD",
-                new UnimplementedExceptionDirective());
-        return cfg;
-    }
-
-}
index 8172a58..d01f3f9 100644 (file)
@@ -7,22 +7,24 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
-import java.io.File;
-import java.util.List;
-
+import com.google.common.base.Optional;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Method;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.TypeDeclaration;
 
+import java.util.List;
+
 public interface FtlTemplate {
 
     Header getHeader();
+    Optional<String> getHeaderString();
 
     String getPackageName();
 
-    String getJavadoc();
+    Optional<String> getMaybeJavadoc();
 
     public List<Annotation> getAnnotations();
 
@@ -34,14 +36,5 @@ public interface FtlTemplate {
 
     List<? extends Method> getMethods();
 
-    /**
-     * @return relative path to file to be created.
-     */
-    public File getRelativeFile();
-
-    /**
-     *
-     * @return ftl template location
-     */
-    public String getFtlTempleteLocation();
+    List<Constructor> getConstructors();
 }
index be49f93..5d2d664 100644 (file)
@@ -7,33 +7,21 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
-import java.util.Collections;
-
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
+import com.google.common.collect.Lists;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 
-import com.google.common.collect.Lists;
+import java.util.Collections;
 
 public class StubFactoryTemplate extends GeneralClassTemplate {
 
-    private final String moduleInstanceType;
-
     public StubFactoryTemplate(Header header, String packageName, String name,
-            String extendedClass, String moduleInstanceType) {
+                               String extendedClass) {
         super(header, packageName, name, Lists.newArrayList(extendedClass),
                 Collections.<String> emptyList(), Collections
                         .<Field> emptyList(), Collections
                         .<MethodDefinition> emptyList());
-        this.moduleInstanceType = moduleInstanceType;
-    }
-
-    public String getModuleInstanceType() {
-        return moduleInstanceType;
     }
 
-    public String getDynamicMBeanWithInstanceType() {
-        return DynamicMBeanWithInstance.class.getCanonicalName();
-    }
 }
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubModuleTemplate.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubModuleTemplate.java
deleted file mode 100644 (file)
index f49bbba..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
-
-import java.util.Collections;
-
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
-import org.opendaylight.controller.config.spi.Module;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
-
-import com.google.common.collect.Lists;
-
-/**
- *
- */
-public class StubModuleTemplate extends GeneralClassTemplate {
-
-    private final String extendedClass;
-
-    public StubModuleTemplate(Header header, String packageName,
-            String stubModuleName, String extendedClass) {
-        super(header, packageName, stubModuleName, Lists
-                .newArrayList(extendedClass), Collections.<String> emptyList(),
-                Collections.<Field> emptyList(), Collections
-                        .<MethodDefinition> emptyList(), false, true,
-                Collections.<Constructor> emptyList());
-        this.extendedClass = extendedClass;
-    }
-
-    public String getExtendedClass() {
-        return extendedClass;
-    }
-
-    public String getInstanceType() {
-        return AutoCloseable.class.getCanonicalName();
-    }
-
-    public String getModuleNameType() {
-        return ModuleIdentifier.class.getCanonicalName();
-    }
-
-    public String getAbstractServiceInterfaceType() {
-        return AbstractServiceInterface.class.getCanonicalName();
-    }
-
-    public String getModuleType() {
-        return Module.class.getCanonicalName();
-    }
-
-    public String getDependencyResolverType() {
-        return DependencyResolver.class.getCanonicalName();
-    }
-
-    public String getDynamicMBeanWithInstanceType() {
-        return DynamicMBeanWithInstance.class.getCanonicalName();
-    }
-
-    @Override
-    public String getFtlTempleteLocation() {
-        return "module_stub_template.ftl";
-    }
-}
index fea9a79..7b7aab8 100644 (file)
@@ -7,9 +7,7 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
-import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.Collections2;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import org.opendaylight.controller.config.api.DependencyResolver;
@@ -45,12 +43,10 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FullyQual
 import org.opendaylight.yangtools.binding.generator.util.BindingGeneratorUtil;
 import org.opendaylight.yangtools.sal.binding.model.api.ParameterizedType;
 import org.opendaylight.yangtools.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition;
 
 import javax.management.openmbean.SimpleType;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -59,49 +55,6 @@ import java.util.Map.Entry;
 
 public class TemplateFactory {
 
-    public static Map<String, FtlTemplate> getFtlTemplates(
-            ModuleMXBeanEntry entry) {
-        Map<String, FtlTemplate> result = new HashMap<>();
-
-        result.putAll(TemplateFactory.tOsFromMbe(entry));
-
-        // IFC
-        result.put(entry.getMXBeanInterfaceName() + ".java",
-                TemplateFactory.mXBeanInterfaceTemplateFromMbe(entry));
-
-        // ABS fact
-        result.put(entry.getAbstractFactoryName() + ".java",
-                TemplateFactory.abstractFactoryTemplateFromMbe(entry));
-
-        // ABS module
-        result.put(entry.getAbstractModuleName() + ".java",
-                TemplateFactory.abstractModuleTemplateFromMbe(entry));
-
-        return result;
-    }
-
-    public static Map<String, FtlTemplate> getFtlStubTemplates(
-            ModuleMXBeanEntry entry) {
-        Map<String, FtlTemplate> result = new HashMap<>();
-        // STUB fact
-        result.put(entry.getStubFactoryName() + ".java",
-                TemplateFactory.stubFactoryTemplateFromMbe(entry));
-
-        result.put(entry.getStubModuleName() + ".java",
-                TemplateFactory.stubModuleTemplateFromMbe(entry));
-        return result;
-    }
-
-    public static Map<String, FtlTemplate> getFtlTemplates(
-            ServiceInterfaceEntry entry) {
-
-        Map<String, FtlTemplate> result = new HashMap<>();
-        result.put(entry.getTypeName() + ".java",
-                TemplateFactory.serviceInterfaceFromSie(entry));
-
-        return result;
-    }
-
     /**
      * Get map of file name as key, FtlFile instance representing runtime mx
      * bean as value that should be persisted from this instance.
@@ -183,11 +136,6 @@ public class TemplateFactory {
         return serializeType(type, false);
     }
 
-    private static boolean isIdentityRefType(Type type) {
-        return type instanceof IdentityrefTypeDefinition;
-    }
-
-
     private static String getReturnType(AttributeIfc attributeIfc) {
         String returnType;
         if (attributeIfc instanceof TypedAttribute) {
@@ -234,28 +182,17 @@ public class TemplateFactory {
         attrProcessor.processAttributes(mbe.getAttributes(),
                 mbe.getPackageName());
 
-        Collection<String> transformed = Collections2.transform(mbe
-                .getProvidedServices().keySet(),
-                new Function<String, String>() {
 
-                    @Override
-                    public String apply(String input) {
-                        return input + ".class";
-                    }
-                });
 
         return new AbstractFactoryTemplate(getHeaderFromEntry(mbe),
                 mbe.getPackageName(), mbe.getAbstractFactoryName(),
-                mbe.getGloballyUniqueName(), mbe.getFullyQualifiedName(mbe
-                        .getStubModuleName()), attrProcessor.getFields(),
-                Lists.newArrayList(transformed), mbe);
+                attrProcessor.getFields()
+        );
     }
 
     public static AbstractModuleTemplate abstractModuleTemplateFromMbe(
             ModuleMXBeanEntry mbe) {
-        AbstractModuleAttributesProcessor attrProcessor = new AbstractModuleAttributesProcessor();
-        attrProcessor.processAttributes(mbe.getAttributes(),
-                mbe.getPackageName());
+        AbstractModuleAttributesProcessor attrProcessor = new AbstractModuleAttributesProcessor(mbe.getAttributes());
 
         List<ModuleField> moduleFields = attrProcessor.getModuleFields();
         List<String> implementedIfcs = Lists.newArrayList(
@@ -298,15 +235,8 @@ public class TemplateFactory {
             ModuleMXBeanEntry mbe) {
         return new StubFactoryTemplate(getHeaderFromEntry(mbe),
                 mbe.getPackageName(), mbe.getStubFactoryName(),
-                mbe.getFullyQualifiedName(mbe.getAbstractFactoryName()),
-                mbe.getStubModuleName());
-    }
-
-    public static StubModuleTemplate stubModuleTemplateFromMbe(
-            ModuleMXBeanEntry mbe) {
-        return new StubModuleTemplate(getHeaderFromEntry(mbe),
-                mbe.getPackageName(), mbe.getStubModuleName(),
-                mbe.getFullyQualifiedName(mbe.getAbstractModuleName()));
+                mbe.getFullyQualifiedName(mbe.getAbstractFactoryName())
+        );
     }
 
     public static GeneralInterfaceTemplate mXBeanInterfaceTemplateFromMbe(
@@ -612,12 +542,26 @@ public class TemplateFactory {
     }
 
     private static class AbstractModuleAttributesProcessor {
+        private static class Holder {
+            private final List<ModuleField> moduleFields;
+            private final List<MethodDefinition> methods;
+
+            private Holder(List<ModuleField> moduleFields, List<MethodDefinition> methods) {
+                this.moduleFields = Collections.unmodifiableList(moduleFields);
+                this.methods = Collections.unmodifiableList(methods);
+            }
+        }
 
-        private final List<ModuleField> moduleFields = Lists.newArrayList();
-        private final List<MethodDefinition> methods = Lists.newArrayList();
+        private final Holder holder;
 
-        void processAttributes(Map<String, AttributeIfc> attributes,
-                String packageName) {
+
+        private AbstractModuleAttributesProcessor(Map<String, AttributeIfc> attributes) {
+            this.holder = processAttributes(attributes);
+        }
+
+        private static Holder processAttributes(Map<String, AttributeIfc> attributes) {
+            List<ModuleField> moduleFields = new ArrayList<>();
+            List<MethodDefinition> methods = new ArrayList<>();
             for (Entry<String, AttributeIfc> attrEntry : attributes.entrySet()) {
                 String type, nullableDefaultWrapped = null;
                 AttributeIfc attributeIfc = attrEntry.getValue();
@@ -661,7 +605,7 @@ public class TemplateFactory {
 
                 String varName = BindingGeneratorUtil
                         .parseToValidParamName(attrEntry.getKey());
-
+                {
                 ModuleField field;
 
                 if (isIdentity) {
@@ -695,7 +639,7 @@ public class TemplateFactory {
                             nullableDefaultWrapped, isDependency, dependency, isListOfDependencies, needsDepResolver);
                 }
                 moduleFields.add(field);
-
+                }
                 String getterName = "get"
                         + attributeIfc.getUpperCaseCammelCase();
                 MethodDefinition getter = new MethodDefinition(type,
@@ -727,14 +671,15 @@ public class TemplateFactory {
 
                 methods.add(setter);
             }
+            return new Holder(moduleFields, methods);
         }
 
         List<ModuleField> getModuleFields() {
-            return moduleFields;
+            return holder.moduleFields;
         }
 
         List<MethodDefinition> getMethods() {
-            return methods;
+            return holder.methods;
         }
 
     }
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/AnnotationsDirective.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/AnnotationsDirective.java
deleted file mode 100644 (file)
index 4a34a1f..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.List;
-import java.util.Map;
-
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation.Parameter;
-
-import com.google.common.collect.Lists;
-
-import freemarker.core.Environment;
-import freemarker.template.SimpleSequence;
-import freemarker.template.TemplateDirectiveBody;
-import freemarker.template.TemplateDirectiveModel;
-import freemarker.template.TemplateException;
-import freemarker.template.TemplateModel;
-
-/**
- * Add annotations to freemarker template.
- */
-public class AnnotationsDirective implements TemplateDirectiveModel {
-
-    private static final String OBJECT = "object";
-
-    @Override
-    public void execute(Environment env, Map params, TemplateModel[] loopVars,
-            TemplateDirectiveBody body) throws TemplateException, IOException {
-        Object object = params.get(OBJECT);
-        List<Annotation> annotations = Lists.newArrayList();
-
-        if (object != null) {
-            if (object instanceof SimpleSequence)
-                annotations = ((SimpleSequence) object).toList();
-            else if (object instanceof FtlTemplate) {
-                annotations = ((FtlTemplate) object).getAnnotations();
-            } else
-                throw new IllegalArgumentException(
-                        "Object must be a SimpleSequence or instance of "
-                                + FtlTemplate.class + "but was "
-                                + object.getClass());
-        }
-
-        Writer out = env.getOut();
-        StringBuilder build = new StringBuilder();
-        writeAnnotations(annotations, build, "");
-
-        if (!annotations.isEmpty())
-            out.write(build.toString().toCharArray());
-    }
-
-    static void writeAnnotations(List<Annotation> annotations,
-            StringBuilder build, String linePrefix) {
-        for (Annotation annotation : annotations) {
-            build.append(linePrefix + "@");
-            build.append(annotation.getName());
-            if (!annotation.getParams().isEmpty()) {
-                build.append("(");
-                for (Parameter param : annotation.getParams()) {
-                    build.append(param.getKey());
-                    build.append(" = ");
-                    build.append(fixString(param.getValue()));
-                    build.append(", ");
-                }
-                build.setCharAt(build.length() - 2, ')');
-            }
-            build.append(System.lineSeparator());
-        }
-    }
-
-    private static String fixString(String value) {
-        // TODO replace with compress single line if possible
-        return value.replaceAll("\\r\\n|\\r|\\n", " ").replaceAll(" +", " ");
-    }
-
-}
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/ConstructorsDirective.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/ConstructorsDirective.java
deleted file mode 100644 (file)
index 56b7286..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.List;
-import java.util.Map;
-
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.GeneralClassTemplate;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
-
-import com.google.common.collect.Lists;
-
-import freemarker.core.Environment;
-import freemarker.template.SimpleSequence;
-import freemarker.template.TemplateDirectiveBody;
-import freemarker.template.TemplateDirectiveModel;
-import freemarker.template.TemplateException;
-import freemarker.template.TemplateModel;
-
-/**
- * Add annotations to freemarker template.
- */
-public class ConstructorsDirective implements TemplateDirectiveModel {
-
-    private static final String OBJECT = "object";
-
-    @Override
-    public void execute(Environment env, Map params, TemplateModel[] loopVars,
-            TemplateDirectiveBody body) throws TemplateException, IOException {
-        Object object = params.get(OBJECT);
-        List<Constructor> constructors = Lists.newArrayList();
-
-        if (object != null) {
-            if (object instanceof SimpleSequence)
-                constructors = ((SimpleSequence) object).toList();
-            else if (object instanceof GeneralClassTemplate) {
-                constructors = ((GeneralClassTemplate) object)
-                        .getConstructors();
-            } else
-                throw new IllegalArgumentException(
-                        "Object must be a SimpleSequence or instance of "
-                                + GeneralClassTemplate.class + "but was "
-                                + object.getClass());
-        }
-
-        Writer out = env.getOut();
-        StringBuilder build = new StringBuilder();
-        for (Constructor constr : constructors) {
-            build.append("    ");
-            if (constr.isPublic())
-                build.append("public ");
-            build.append(constr.getTypeName() + " ");
-            build.append("() {");
-            build.append(System.lineSeparator());
-            build.append("    ");
-            build.append("    ");
-            build.append(constr.getBody());
-            build.append(System.lineSeparator());
-            build.append("    ");
-            build.append("}");
-            build.append(System.lineSeparator());
-            build.append(System.lineSeparator());
-        }
-
-        if (!constructors.isEmpty())
-            out.write(build.toString().toCharArray());
-    }
-
-}
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/FieldsDirectiveProg.java b/opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/directives/FieldsDirectiveProg.java
deleted file mode 100644 (file)
index 7dd0f8e..0000000
+++ /dev/null
@@