1 package org.openecomp.sdc.config;
3 import org.openecomp.sdc.be.components.impl.ComponentLocker;
4 import org.openecomp.sdc.be.components.impl.lock.ComponentLockAspect;
5 import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic;
6 import org.openecomp.sdc.be.ecomp.converters.AssetMetadataConverter;
7 import org.openecomp.sdc.common.transaction.mngr.TransactionManager;
8 import org.springframework.beans.factory.annotation.Autowired;
9 import org.springframework.context.annotation.Bean;
10 import org.springframework.context.annotation.ComponentScan;
11 import org.springframework.context.annotation.Configuration;
12 import org.springframework.core.annotation.Order;
15 @ComponentScan({"org.openecomp.sdc.be.user",
16 "org.openecomp.sdc.be.impl",
17 "org.openecomp.sdc.be.auditing.impl",
18 "org.openecomp.sdc.be.distribution",
19 "org.openecomp.sdc.be.switchover.detector",
20 "org.openecomp.sdc.be.tosca",
21 "org.openecomp.sdc.be.components.validation",
22 "org.openecomp.sdc.be.components.impl",
23 "org.openecomp.sdc.be.components.path",
24 "org.openecomp.sdc.be.components.merge",
25 "org.openecomp.sdc.be.components.csar",
26 "org.openecomp.sdc.be.components.property",
27 "org.openecomp.sdc.be.datamodel.utils",
28 "org.openecomp.sdc.be.components.upgrade"})
29 public class CatalogBESpringConfig {
31 private static final int BEFORE_TRANSACTION_MANAGER = 0;
32 private final ComponentLocker componentLocker;
35 public CatalogBESpringConfig(ComponentLocker componentLocker) {
36 this.componentLocker = componentLocker;
39 @Bean(name = "lifecycleBusinessLogic")
40 public LifecycleBusinessLogic lifecycleBusinessLogic() {
41 return new LifecycleBusinessLogic();
44 @Bean(name = "transactionManager")
45 public TransactionManager transactionManager() {
46 return new TransactionManager();
49 @Bean(name = "asset-metadata-utils")
50 public AssetMetadataConverter assetMetadataConverter() {
51 return new AssetMetadataConverter();
54 @Bean(name = "componentLockAspect")
55 @Order(BEFORE_TRANSACTION_MANAGER)
56 public ComponentLockAspect componentLockAspect() {
57 return new ComponentLockAspect(componentLocker);