private KieServerMgmtCommandServiceImpl() { ServiceLoader<PersistingServerTemplateStorageService> storageServices = ServiceLoader.load(PersistingServerTemplateStorageService.class); if (storageServices != null && storageServices.iterator().hasNext()) { PersistingServerTemplateStorageService storageService = storageServices.iterator().next(); setTemplateStorage(storageService.getTemplateStorage()); } else { LOGGER.debug("No server template storage defined. Default storage: InMemoryKieServerTemplateStorage will be used"); } ServiceLoader<NotificationServiceFactory> notificationServiceLoader = ServiceLoader.load(NotificationServiceFactory.class); if (notificationServiceLoader != null && notificationServiceLoader.iterator().hasNext()) { final NotificationService notificationService = notificationServiceLoader.iterator().next().getNotificationService(); setNotificationService(notificationService); } else { LOGGER.warn("Notification service not defined. Default notification: LoggingNotificationService will be used"); } }
public WebSocketKieServerControllerImpl() { ServiceLoader<PersistingServerTemplateStorageService> storageServices = ServiceLoader.load(PersistingServerTemplateStorageService.class); if (storageServices != null && storageServices.iterator().hasNext()) { PersistingServerTemplateStorageService storageService = storageServices.iterator().next(); setTemplateStorage(storageService.getTemplateStorage()); logger.debug("Server template storage for standalone kie server controller is {}", storageService.getTemplateStorage().toString()); } else { logger.debug("No server template storage defined. Default storage: InMemoryKieServerTemplateStorage will be used"); } ServiceLoader<NotificationServiceFactory> notificationServiceLoader = ServiceLoader.load(NotificationServiceFactory.class); if (notificationServiceLoader != null && notificationServiceLoader.iterator().hasNext()) { final NotificationService notificationService = notificationServiceLoader.iterator().next().getNotificationService(); this.setNotificationService(notificationService); logger.debug("Notification service for standalone kie server controller is {}", notificationService.toString()); } else { logger.warn("Notification service not defined. Default notification: LoggingNotificationService will be used"); } }