forked from ReactiveX/RxJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue ReactiveX#309: Added fallback functionality to spring annotatio…
…ns (ReactiveX#377)
- Loading branch information
1 parent
a6da58b
commit c679135
Showing
63 changed files
with
1,759 additions
and
77 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
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
Empty file.
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
66 changes: 66 additions & 0 deletions
66
...ava/io/github/resilience4j/recovery/autoconfigure/RecoveryConfigurationOnMissingBean.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,66 @@ | ||
/* | ||
* Copyright 2019 Kyuhyen Hwang | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.github.resilience4j.recovery.autoconfigure; | ||
|
||
import io.github.resilience4j.recovery.RecoveryDecorator; | ||
import io.github.resilience4j.recovery.RecoveryDecorators; | ||
import io.github.resilience4j.recovery.configure.RecoveryConfiguration; | ||
import io.github.resilience4j.utils.ReactorOnClasspathCondition; | ||
import io.github.resilience4j.utils.RxJava2OnClasspathCondition; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Conditional; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* {@link Configuration} for {@link RecoveryDecorators}. | ||
*/ | ||
@Configuration | ||
public class RecoveryConfigurationOnMissingBean { | ||
private final RecoveryConfiguration recoveryConfiguration; | ||
|
||
public RecoveryConfigurationOnMissingBean() { | ||
this.recoveryConfiguration = new RecoveryConfiguration(); | ||
} | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public RecoveryDecorators recoveryDecorators(List<RecoveryDecorator> recoveryDecorator) { | ||
return recoveryConfiguration.recoveryDecorators(recoveryDecorator); | ||
} | ||
|
||
@Bean | ||
@Conditional(value = {RxJava2OnClasspathCondition.class}) | ||
@ConditionalOnMissingBean | ||
public RecoveryDecorator rxJava2RecoveryDecorator() { | ||
return recoveryConfiguration.rxJava2RecoveryDecorator(); | ||
} | ||
|
||
@Bean | ||
@Conditional(value = {ReactorOnClasspathCondition.class}) | ||
@ConditionalOnMissingBean | ||
public RecoveryDecorator reactorRecoveryDecorator() { | ||
return recoveryConfiguration.reactorRecoveryDecorator(); | ||
} | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public RecoveryDecorator completionStageRecoveryDecorator() { | ||
return recoveryConfiguration.completionStageRecoveryDecorator(); | ||
} | ||
} |
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
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
Oops, something went wrong.