use of org.graylog2.shared.plugins.ChainingClassLoader in project graylog2-server by Graylog2.
the class V20161215163900_MoveIndexSetDefaultConfigTest method setUp.
@Before
public void setUp() throws Exception {
this.clusterConfigService = spy(new ClusterConfigServiceImpl(objectMapperProvider, fongoRule.getConnection(), nodeId, new ChainingClassLoader(getClass().getClassLoader()), new ClusterEventBus()));
this.collection = fongoRule.getDatabase().getCollection("index_sets");
this.migration = new V20161215163900_MoveIndexSetDefaultConfig(fongoRule.getConnection(), clusterConfigService);
}
use of org.graylog2.shared.plugins.ChainingClassLoader in project graylog2-server by Graylog2.
the class Server method getCommandBindings.
@Override
protected List<Module> getCommandBindings() {
final ImmutableList.Builder<Module> modules = ImmutableList.builder();
modules.add(new ConfigurationModule(configuration), new ServerBindings(configuration), new PersistenceServicesBindings(), new MessageFilterBindings(), new MessageProcessorModule(), new AlarmCallbackBindings(), new InitializerBindings(), new MessageOutputBindings(configuration, chainingClassLoader), new RotationStrategyBindings(), new RetentionStrategyBindings(), new PeriodicalBindings(), new ObjectMapperModule(chainingClassLoader), new RestApiBindings(), new PasswordAlgorithmBindings(), new WidgetStrategyBindings(), new DashboardBindings(), new DecoratorBindings(), new AuditBindings(), new AlertConditionBindings(), new IndexerBindings(), new MigrationsModule());
return modules.build();
}
use of org.graylog2.shared.plugins.ChainingClassLoader in project graylog2-server by Graylog2.
the class ClusterEventPeriodicalTest method setUpService.
@Before
public void setUpService() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TIME.getMillis());
this.mongoConnection = mongoRule.getMongoConnection();
MongoJackObjectMapperProvider provider = new MongoJackObjectMapperProvider(objectMapper);
when(nodeId.toString()).thenReturn("ID");
this.clusterEventPeriodical = new ClusterEventPeriodical(provider, mongoRule.getMongoConnection(), nodeId, new ChainingClassLoader(getClass().getClassLoader()), serverEventBus, clusterEventBus);
}
use of org.graylog2.shared.plugins.ChainingClassLoader in project graylog2-server by Graylog2.
the class ClusterConfigServiceImplTest method setUpService.
@Before
public void setUpService() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TIME.getMillis());
this.mongoConnection = mongoRule.getMongoConnection();
MongoJackObjectMapperProvider provider = new MongoJackObjectMapperProvider(objectMapper);
when(nodeId.toString()).thenReturn("ID");
this.clusterConfigService = new ClusterConfigServiceImpl(provider, mongoRule.getMongoConnection(), nodeId, new ChainingClassLoader(getClass().getClassLoader()), clusterEventBus);
}
use of org.graylog2.shared.plugins.ChainingClassLoader in project graylog2-server by Graylog2.
the class CmdLineTool method loadPlugins.
protected Set<Plugin> loadPlugins(String pluginPath, ChainingClassLoader chainingClassLoader) {
final File pluginDir = new File(pluginPath);
final Set<Plugin> plugins = new HashSet<>();
final PluginLoader pluginLoader = new PluginLoader(pluginDir, chainingClassLoader);
for (Plugin plugin : pluginLoader.loadPlugins()) {
final PluginMetaData metadata = plugin.metadata();
if (capabilities().containsAll(metadata.getRequiredCapabilities())) {
if (version.sameOrHigher(metadata.getRequiredVersion())) {
LOG.info("Loaded plugin: {}", plugin);
plugins.add(plugin);
} else {
LOG.error("Plugin \"" + metadata.getName() + "\" requires version " + metadata.getRequiredVersion() + " - not loading!");
}
} else {
LOG.debug("Skipping plugin \"{}\" because some capabilities are missing ({}).", metadata.getName(), Sets.difference(plugin.metadata().getRequiredCapabilities(), capabilities()));
}
}
return plugins;
}
Aggregations