-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #349 from viadeo/prepare_1.1.0_spring
Prepare 1.2.0 spring
- Loading branch information
Showing
160 changed files
with
869 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...er-core/src/main/java/com/viadeo/kasper/core/component/event/saga/DefaultSagaManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.viadeo.kasper.core.component.event.saga; | ||
|
||
import com.google.common.collect.Lists; | ||
import com.viadeo.kasper.core.component.event.saga.factory.DefaultSagaFactoryProvider; | ||
import com.viadeo.kasper.core.component.event.saga.factory.SagaFactoryProvider; | ||
import com.viadeo.kasper.core.component.event.saga.repository.InMemorySagaRepository; | ||
import com.viadeo.kasper.core.component.event.saga.repository.SagaRepository; | ||
import com.viadeo.kasper.core.component.event.saga.step.StepChecker; | ||
import com.viadeo.kasper.core.component.event.saga.step.StepProcessor; | ||
import com.viadeo.kasper.core.component.event.saga.step.StepResolver; | ||
import com.viadeo.kasper.core.component.event.saga.step.Steps; | ||
import com.viadeo.kasper.core.component.event.saga.step.facet.FacetApplierRegistry; | ||
|
||
import java.util.List; | ||
|
||
public class DefaultSagaManager extends SagaManager { | ||
|
||
public DefaultSagaManager( | ||
final SagaFactoryProvider sagaFactoryProvider, | ||
final SagaRepository repository, | ||
final StepProcessor operationProcessor | ||
) { | ||
super(sagaFactoryProvider, repository, operationProcessor); | ||
} | ||
|
||
public static DefaultSagaManager build() { | ||
final SagaFactoryProvider sagaFactoryProvider = new DefaultSagaFactoryProvider(); | ||
final FacetApplierRegistry facetApplierRegistry = new FacetApplierRegistry(); | ||
final List<StepResolver> stepResolvers = Lists.newArrayList((StepResolver) | ||
new Steps.StartStepResolver(facetApplierRegistry), | ||
new Steps.BasicStepResolver(facetApplierRegistry), | ||
new Steps.EndStepResolver(facetApplierRegistry) | ||
); | ||
|
||
final StepChecker stepChecker = new Steps.Checker(); | ||
final StepProcessor operationProcessor = new StepProcessor( | ||
stepChecker, | ||
stepResolvers.toArray(new StepResolver[stepResolvers.size()]) | ||
); | ||
final SagaRepository repository = new InMemorySagaRepository(sagaFactoryProvider); | ||
|
||
return new DefaultSagaManager(sagaFactoryProvider, repository, operationProcessor); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.