committed by
Jens Schauder
parent
5a59e43745
commit
20a1220cd1
@@ -22,8 +22,6 @@ import kotlinx.coroutines.flow.FlowKt;
|
||||
import kotlinx.coroutines.reactive.ReactiveFlowKt;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import rx.Observable;
|
||||
import rx.Single;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -54,8 +52,6 @@ import org.springframework.util.ClassUtils;
|
||||
* <p>
|
||||
* This class discovers reactive wrapper availability and their conversion support based on the class path. Reactive
|
||||
* wrapper types might be supported/on the class path but conversion may require additional dependencies.
|
||||
* <p>
|
||||
* <strong>Note:</strong> As of Spring Data 2.4, support for RxJava 1.x is deprecated in favor of RxJava 2 and 3.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Oliver Gierke
|
||||
@@ -72,12 +68,6 @@ public abstract class ReactiveWrapperConverters {
|
||||
|
||||
static {
|
||||
|
||||
if (ReactiveWrappers.isAvailable(ReactiveLibrary.RXJAVA1)) {
|
||||
|
||||
REACTIVE_WRAPPERS.add(RxJava1SingleWrapper.INSTANCE);
|
||||
REACTIVE_WRAPPERS.add(RxJava1ObservableWrapper.INSTANCE);
|
||||
}
|
||||
|
||||
if (ReactiveWrappers.isAvailable(ReactiveLibrary.RXJAVA2)) {
|
||||
|
||||
REACTIVE_WRAPPERS.add(RxJava2SingleWrapper.INSTANCE);
|
||||
@@ -341,46 +331,6 @@ public abstract class ReactiveWrapperConverters {
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// RxJava 1 converters
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Wrapper for RxJava 1's {@link Single}.
|
||||
*/
|
||||
private enum RxJava1SingleWrapper implements ReactiveTypeWrapper<Single<?>> {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public Class<? super Single<?>> getWrapperClass() {
|
||||
return Single.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<?> map(Object wrapper, Function<Object, Object> function) {
|
||||
return ((Single<?>) wrapper).map(function::apply);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for RxJava 1's {@link Observable}.
|
||||
*/
|
||||
private enum RxJava1ObservableWrapper implements ReactiveTypeWrapper<Observable<?>> {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public Class<? super Observable<?>> getWrapperClass() {
|
||||
return Observable.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Observable<?> map(Object wrapper, Function<Object, Object> function) {
|
||||
return ((Observable<?>) wrapper).map(function::apply);
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// RxJava 2 converters
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@@ -35,8 +35,6 @@ import org.springframework.util.ClassUtils;
|
||||
* <p>
|
||||
* Supported types are discovered by their availability on the class path. This class is typically used to determine
|
||||
* multiplicity and whether a reactive wrapper type is acceptable for a specific operation.
|
||||
* <p>
|
||||
* <strong>Note:</strong> As of Spring Data 2.4, support for RxJava 1.x is deprecated in favor of RxJava 2 and 3.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
@@ -45,9 +43,6 @@ import org.springframework.util.ClassUtils;
|
||||
* @author Hantsy Bai
|
||||
* @since 2.0
|
||||
* @see org.reactivestreams.Publisher
|
||||
* @see rx.Single
|
||||
* @see rx.Observable
|
||||
* @see rx.Completable
|
||||
* @see io.reactivex.Single
|
||||
* @see io.reactivex.Maybe
|
||||
* @see io.reactivex.Observable
|
||||
@@ -68,12 +63,6 @@ public abstract class ReactiveWrappers {
|
||||
private static final boolean PROJECT_REACTOR_PRESENT = ClassUtils.isPresent("reactor.core.publisher.Flux",
|
||||
ReactiveWrappers.class.getClassLoader());
|
||||
|
||||
@Deprecated
|
||||
private static final boolean RXJAVA1_PRESENT = ClassUtils.isPresent("rx.Observable",
|
||||
ReactiveWrappers.class.getClassLoader())
|
||||
&& ClassUtils.isPresent("rx.RxReactiveStreams",
|
||||
ReactiveWrappers.class.getClassLoader());
|
||||
|
||||
@Deprecated
|
||||
private static final boolean RXJAVA2_PRESENT = ClassUtils.isPresent("io.reactivex.Flowable",
|
||||
ReactiveWrappers.class.getClassLoader());
|
||||
@@ -98,17 +87,11 @@ public abstract class ReactiveWrappers {
|
||||
|
||||
PROJECT_REACTOR,
|
||||
|
||||
/**
|
||||
* @deprecated since 2.4, use RxJava 3 instead. To be removed with Spring Data 3.0.
|
||||
*/
|
||||
@Deprecated
|
||||
RXJAVA1,
|
||||
|
||||
/**
|
||||
* @deprecated since 2.6, use RxJava 3 instead. To be removed with Spring Data 3.0.
|
||||
*/
|
||||
@Deprecated
|
||||
RXJAVA2, RXJAVA3, KOTLIN_COROUTINES, MUTINY;
|
||||
RXJAVA2, RXJAVA3, KOTLIN_COROUTINES;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,8 +117,6 @@ public abstract class ReactiveWrappers {
|
||||
switch (reactiveLibrary) {
|
||||
case PROJECT_REACTOR:
|
||||
return PROJECT_REACTOR_PRESENT;
|
||||
case RXJAVA1:
|
||||
return RXJAVA1_PRESENT;
|
||||
case RXJAVA2:
|
||||
return RXJAVA2_PRESENT;
|
||||
case RXJAVA3:
|
||||
|
||||
Reference in New Issue
Block a user