@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void handleSagasEvent(Object event) {
Collection<SagaManager> loaders = sagaRegistry.getLoadersForEvent(event);
for (SagaManager loader : loaders) {
SagaInstance sagaInstance = loadSaga(loader, event);
invokeSagaActionForEvent(sagaInstance, event);
if (sagaInstance.isCompleted()) {
loader.removeSaga(sagaInstance);
}
}
}