Search in sources :

Example 16 with IOState

use of org.graylog2.plugin.IOState in project graylog2-server by Graylog2.

the class InputLauncher method handleLaunchException.

protected void handleLaunchException(Throwable e, IOState<MessageInput> inputState) {
    final MessageInput input = inputState.getStoppable();
    StringBuilder msg = new StringBuilder("The [" + input.getClass().getCanonicalName() + "] input with ID <" + input.getId() + "> misfired. Reason: ");
    String causeMsg = ExceptionUtils.getRootCauseMessage(e);
    msg.append(causeMsg);
    LOG.error(msg.toString(), e);
    // Clean up.
    // cleanInput(input);
    inputState.setState(IOState.Type.FAILED, causeMsg);
}
Also used : MessageInput(org.graylog2.plugin.inputs.MessageInput)

Aggregations

MessageInput (org.graylog2.plugin.inputs.MessageInput)13 Test (org.junit.Test)9 EventBus (com.google.common.eventbus.EventBus)4 Subscribe (com.google.common.eventbus.Subscribe)4 IOState (org.graylog2.plugin.IOState)4 NotFoundException (org.graylog2.database.NotFoundException)3 InputRegistry (org.graylog2.shared.inputs.InputRegistry)2 Stopwatch (com.google.common.base.Stopwatch)1 Inject (javax.inject.Inject)1 LeaderChangedEvent (org.graylog2.cluster.leader.LeaderChangedEvent)1 LeaderElectionService (org.graylog2.cluster.leader.LeaderElectionService)1 Notification (org.graylog2.notifications.Notification)1 ServerStatus (org.graylog2.plugin.ServerStatus)1 Lifecycle (org.graylog2.plugin.lifecycles.Lifecycle)1 NodeId (org.graylog2.plugin.system.NodeId)1 InputCreated (org.graylog2.rest.models.system.inputs.responses.InputCreated)1 InputDeleted (org.graylog2.rest.models.system.inputs.responses.InputDeleted)1 InputUpdated (org.graylog2.rest.models.system.inputs.responses.InputUpdated)1 InputLauncher (org.graylog2.shared.inputs.InputLauncher)1 NoSuchInputTypeException (org.graylog2.shared.inputs.NoSuchInputTypeException)1