use of com.google.inject.assistedinject.FactoryModuleBuilder in project graylog2-server by Graylog2.
the class PluginModule method addSchedulerJob.
protected void addSchedulerJob(String name, Class<? extends Job> jobClass, Class<? extends Job.Factory> factoryClass, Class<? extends JobDefinitionConfig> configClass, Class<? extends JobTriggerData> dataClass) {
install(new FactoryModuleBuilder().implement(Job.class, jobClass).build(factoryClass));
jobBinder().addBinding(name).to(factoryClass);
registerJacksonSubtype(configClass, name);
// Some jobs might not have a custom data class
if (dataClass != null) {
registerJacksonSubtype(dataClass, name);
}
}
use of com.google.inject.assistedinject.FactoryModuleBuilder in project graylog2-server by Graylog2.
the class PluginModule method addNotificationType.
protected void addNotificationType(String name, Class<? extends EventNotificationConfig> notificationClass, Class<? extends EventNotification> handlerClass, Class<? extends EventNotification.Factory> factoryClass) {
install(new FactoryModuleBuilder().implement(EventNotification.class, handlerClass).build(factoryClass));
eventNotificationBinder().addBinding(name).to(factoryClass);
registerJacksonSubtype(notificationClass, name);
}
use of com.google.inject.assistedinject.FactoryModuleBuilder in project graylog2-server by Graylog2.
the class PluginModule method addEventStorageHandler.
protected void addEventStorageHandler(String name, Class<? extends EventStorageHandler> handlerClass, Class<? extends EventStorageHandler.Factory> factoryClass, Class<? extends EventStorageHandler.Config> configClass) {
install(new FactoryModuleBuilder().implement(EventStorageHandler.class, handlerClass).build(factoryClass));
eventStorageHandlerBinder().addBinding(name).to(factoryClass);
registerJacksonSubtype(configClass, name);
}
use of com.google.inject.assistedinject.FactoryModuleBuilder in project graylog2-server by Graylog2.
the class PluginModule method addEventProcessor.
protected void addEventProcessor(String name, Class<? extends EventProcessor> processorClass, Class<? extends EventProcessor.Factory> factoryClass, Class<? extends EventProcessorConfig> configClass, Class<? extends EventProcessorParameters> parametersClass) {
install(new FactoryModuleBuilder().implement(EventProcessor.class, processorClass).build(factoryClass));
eventProcessorBinder().addBinding(name).to(factoryClass);
registerJacksonSubtype(configClass, name);
registerJacksonSubtype(parametersClass, name);
}
use of com.google.inject.assistedinject.FactoryModuleBuilder in project graylog2-server by Graylog2.
the class Graylog2Module method installAlertCondition.
protected void installAlertCondition(MapBinder<String, AlertCondition.Factory> alertConditionBinder, Class<? extends AlertCondition> alertConditionClass, Class<? extends AlertCondition.Factory> alertConditionFactoryClass) {
install(new FactoryModuleBuilder().implement(AlertCondition.class, alertConditionClass).build(alertConditionFactoryClass));
alertConditionBinder.addBinding(alertConditionClass.getCanonicalName()).to(alertConditionFactoryClass);
}
Aggregations