use of fish.payara.nucleus.notification.log.LogNotifierExecutionOptions in project Payara by payara.
the class MonitoringService method bootstrapNotifierList.
/**
* Starts notifiers that are enabled with the monitoring service
* @since 4.1.2.174
*/
public void bootstrapNotifierList() {
notifierExecutionOptionsList = new ArrayList<>();
if (configuration.getNotifierList() != null) {
for (Notifier notifier : configuration.getNotifierList()) {
ConfigView view = ConfigSupport.getImpl(notifier);
NotifierConfigurationType annotation = view.getProxyType().getAnnotation(NotifierConfigurationType.class);
notifierExecutionOptionsList.add(executionOptionsFactoryStore.get(annotation.type()).build(notifier));
}
}
if (notifierExecutionOptionsList.isEmpty()) {
// Add logging execution options by default
LogNotifierExecutionOptions logNotifierExecutionOptions = new LogNotifierExecutionOptions();
logNotifierExecutionOptions.setEnabled(true);
notifierExecutionOptionsList.add(logNotifierExecutionOptions);
}
}
use of fish.payara.nucleus.notification.log.LogNotifierExecutionOptions in project Payara by payara.
the class LogNotificationEventFactoryMock method configureService.
@Before
public void configureService() {
executionOptions.setEnabled(false);
executionOptions.setSampleRate(1.0);
executionOptions.setSampleRateFirstEnabled(false);
executionOptions.setThresholdValue(1000L);
executionOptions.setThresholdUnit(TimeUnit.MILLISECONDS);
executionOptions.setHistoricTraceStoreEnabled(false);
LogNotifierExecutionOptions logNotifierExecutionOptions = new LogNotifierExecutionOptions();
logNotifierExecutionOptions.setEnabled(true);
executionOptions.getNotifierExecutionOptionsList().put(NotifierType.LOG, logNotifierExecutionOptions);
}
use of fish.payara.nucleus.notification.log.LogNotifierExecutionOptions in project Payara by payara.
the class HealthCheckService method bootstrapNotifierList.
/**
* Starts all notifiers that have been enable with the healthcheck service.
*/
public void bootstrapNotifierList() {
notifierExecutionOptionsList = new ArrayList<>();
if (configuration.getNotifierList() != null) {
for (Notifier notifier : configuration.getNotifierList()) {
ConfigView view = ConfigSupport.getImpl(notifier);
NotifierConfigurationType annotation = view.getProxyType().getAnnotation(NotifierConfigurationType.class);
notifierExecutionOptionsList.add(executionOptionsFactoryStore.get(annotation.type()).build(notifier));
}
}
if (notifierExecutionOptionsList.isEmpty()) {
// Add logging execution options by default
LogNotifierExecutionOptions logNotifierExecutionOptions = new LogNotifierExecutionOptions();
logNotifierExecutionOptions.setEnabled(true);
notifierExecutionOptionsList.add(logNotifierExecutionOptions);
}
}
use of fish.payara.nucleus.notification.log.LogNotifierExecutionOptions in project Payara by payara.
the class RequestTracingService method bootstrapNotifierList.
/**
* Configures notifiers with request tracing and starts any enabled ones.
* If no options are set then the log notifier is automatically turned on.
* @since 4.1.2.173
*/
public void bootstrapNotifierList() {
executionOptions.resetNotifierExecutionOptions();
if (configuration.getNotifierList() != null) {
for (Notifier notifier : configuration.getNotifierList()) {
ConfigView view = ConfigSupport.getImpl(notifier);
NotifierConfigurationType annotation = view.getProxyType().getAnnotation(NotifierConfigurationType.class);
executionOptions.addNotifierExecutionOption(executionOptionsFactoryStore.get(annotation.type()).build(notifier));
}
}
if (executionOptions.getNotifierExecutionOptionsList().isEmpty()) {
// Add logging execution options by default
LogNotifierExecutionOptions logNotifierExecutionOptions = new LogNotifierExecutionOptions();
logNotifierExecutionOptions.setEnabled(true);
executionOptions.addNotifierExecutionOption(logNotifierExecutionOptions);
}
}
Aggregations