mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-29 15:44:14 +00:00
parent
bc717c9241
commit
267001226e
@ -34,7 +34,7 @@ public class DeviceHealthManagerImpl implements DeviceHealthManager {
|
||||
private AlertManager alertManager;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("general_db_man_bean")
|
||||
@Qualifier(PersistenceConfiguration.DEVICE_STATE_MANAGER_BEAN_NAME)
|
||||
private DeviceStateManager deviceStateManager;
|
||||
|
||||
@Autowired
|
||||
|
@ -18,6 +18,12 @@ import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
|
||||
@Configuration
|
||||
@Import({ HibernateConfiguration.class })
|
||||
public class PersistenceConfiguration {
|
||||
|
||||
/**
|
||||
* The bean name to retrieve the default/general implementation of {@link DeviceStateManager}.
|
||||
*/
|
||||
public static final String DEVICE_STATE_MANAGER_BEAN_NAME = "general_db_man_bean";
|
||||
|
||||
@Autowired
|
||||
private LocalSessionFactoryBean sessionFactory;
|
||||
|
||||
@ -140,7 +146,7 @@ public class PersistenceConfiguration {
|
||||
*
|
||||
* @return {@link DeviceStateManager}
|
||||
*/
|
||||
@Bean(name = "general_db_man_bean")
|
||||
@Bean(name = DEVICE_STATE_MANAGER_BEAN_NAME)
|
||||
public DeviceStateManager generalDeviceStateManager() {
|
||||
DBDeviceStateManager manager = new DBDeviceStateManager(sessionFactory.getObject());
|
||||
setDbManagerRetrySettings(manager);
|
||||
|
@ -46,7 +46,7 @@ public class DeviceHealthManagerImplTest {
|
||||
private AlertManager alertManager;
|
||||
|
||||
@Mock
|
||||
@Qualifier("general_db_man_bean")
|
||||
@Qualifier(PersistenceConfiguration.DEVICE_STATE_MANAGER_BEAN_NAME)
|
||||
private DeviceStateManager deviceStateManager;
|
||||
|
||||
@Mock
|
||||
|
Loading…
x
Reference in New Issue
Block a user