@@ -0,0 +1,2336 @@
+/*%0A * Copyright (c) 2013 Red Rainbow IT Solutions GmbH, Germany%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy of%0A * this software and associated documentation files (the %22Software%22), to deal in%0A * the Software without restriction, including without limitation the rights to%0A * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of%0A * the Software, and to permit persons to whom the Software is furnished to do so,%0A * subject to the following conditions:%0A * %0A * The above copyright notice and this permission notice shall be included in all%0A * copies or substantial portions of the Software.%0A * %0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS%0A * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR%0A * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER%0A * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN%0A * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.%0A */%0A%0Apackage org.jeecqrs.bundle.jcommondomain.sagas;%0A%0Aimport org.jeecqrs.common.event.Event;%0Aimport org.jeecqrs.common.event.routing.EventRouter;%0Aimport org.jeecqrs.common.event.routing.convention.ConventionEventRouter;%0Aimport org.jeecqrs.common.util.Validate;%0Aimport org.jeecqrs.sagas.Saga;%0Aimport org.jeecqrs.sagas.SagaIdentificationStrategy;%0A%0A/**%0A *%0A */%0Apublic abstract class EventRoutingSagaIdentificationStrategy%3CS extends Saga%3CEvent%3E%3E%0A    implements SagaIdentificationStrategy%3CS, Event%3E %7B%0A    %0A    private static final String EVENT_HANDLER_NAME = %22when%22;%0A    %0A    private final EventRouter%3CString, Event%3E eventRouter;%0A%0A    protected EventRoutingSagaIdentificationStrategy() %7B%0A        this(new ConventionEventRouter%3CString, Event%3E(true, EVENT_HANDLER_NAME));%0A    %7D%0A%0A    @SuppressWarnings(%22LeakingThisInConstructor%22)%0A    protected EventRoutingSagaIdentificationStrategy(%0A            EventRouter%3CString, Event%3E eventRouter) %7B%0A        Validate.notNull(eventRouter, %22eventRouter must not be null%22);%0A        this.eventRouter = eventRouter;%0A        eventRouter.register(this);%0A    %7D%0A%0A    @Override%0A    public String identifySaga(Event event) %7B%0A        return eventRouter.routeEvent(event);%0A    %7D%0A%0A%7D%0A

Add EventRoutingSagaIdentificationStrategy that supports when(...) lookup for events