Class NotificationManagerFactory

java.lang.Object
com.easydesk.notification.NotificationManagerFactory

@Component public class NotificationManagerFactory extends Object
설정된 BatchManager/QueueManager 구현을 돌려주는 factory.

Spring 전환: Class.forName(...).newInstance() + Turbine AnnotationProcessor 로 구현 class 이름을 설정(easydesk.notification.batch.manager.classname)에서 읽던 방식을 없애고, Spring 에 등록된 bean 중에서 이름으로 고른다.

 easydesk.notification.batch.manager=batchNotificationManager        # 기본값
 # 또는 easydesk.notification.batch.manager=batchNotificationByActivitySetManager
 easydesk.notification.queue.manager=queueManager                    # 기본값
 

Torque 기동을 기다리던 busy-wait 는 제거했다. 이 factory 는 bean 을 요청 시점에만 조회하고, 실제 DB 접근은 batch 가 실행될 때 일어난다.

Author:
Youncho Cho
  • Constructor Details

    • NotificationManagerFactory

      @Autowired public NotificationManagerFactory(Map<String,BatchManager> batchManagers, Map<String,QueueManager> queueManagers, @Value("${easydesk.notification.batch.manager:batchNotificationManager}") String batchManagerName, @Value("${easydesk.notification.queue.manager:queueManager}") String queueManagerName)
  • Method Details

    • getNotificationManager

      public NotificationManager getNotificationManager()
      Returns the currently configured NotificationManager.
    • getBatchManager

      public BatchManager getBatchManager()
      Returns the currently configured BatchManager.
      Throws:
      IllegalStateException - 설정한 이름의 bean 이 없을 때
    • getQueueManager

      public QueueManager getQueueManager()
      Returns the currently configured QueueManager.
      Throws:
      IllegalStateException - 설정한 이름의 bean 이 없을 때