mirror of
https://github.com/jlengrand/helidon.git
synced 2026-03-10 08:21:17 +00:00
Using Flow API from Java, removed Flow from reactive module.
See #1220 Javadoc no longer fails the build. See #1223 as a follow up issue. Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
This commit is contained in:
committed by
Tomas Langer
parent
d34ad1e36e
commit
31365ec5d9
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## 2.0.0
|
||||
### Backward incompatible changes
|
||||
#### Common
|
||||
- Flow API is now used from `java.util.concurrent.Flow`, Helidon specific `Flow` class is now removed
|
||||
|
||||
## [1.4.0]
|
||||
|
||||
### Notes
|
||||
|
||||
@@ -16,16 +16,16 @@
|
||||
|
||||
package io.helidon.common;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotSame;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* Unit tests for class {@link InputStreamHelper}.
|
||||
*
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import io.helidon.config.Config;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,11 +17,10 @@
|
||||
package io.helidon.common.http;
|
||||
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
|
||||
/**
|
||||
* Represents an HTTP entity as a {@link Flow.Publisher publisher} of {@link DataChunk chunks} with specific
|
||||
* features.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,10 +17,9 @@
|
||||
package io.helidon.common.http;
|
||||
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
|
||||
/**
|
||||
* The Reader transforms a {@link DataChunk} publisher into a completion stage of the associated type.
|
||||
*
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
package io.helidon.common.http;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests for class {@link Ascii}.
|
||||
*
|
||||
|
||||
@@ -15,19 +15,18 @@
|
||||
*/
|
||||
package io.helidon.common.http;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import org.hamcrest.CoreMatchers;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.hasItem;
|
||||
import static org.hamcrest.CoreMatchers.hasItems;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
public class FormParamsTest {
|
||||
|
||||
private static final String KEY1 = "key1";
|
||||
|
||||
@@ -16,13 +16,12 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Flow.Processor;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Processor;
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
|
||||
/**
|
||||
* A generic processor used for the implementation of {@link Multi} and {@link Single}.
|
||||
*
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
|
||||
/**
|
||||
* Empty subscription singleton.
|
||||
|
||||
@@ -18,11 +18,11 @@ package io.helidon.common.reactive;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
|
||||
/**
|
||||
* Fixed items publisher implementation.
|
||||
*/
|
||||
|
||||
@@ -1,294 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* 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.helidon.common.reactive;
|
||||
|
||||
/**
|
||||
* Interrelated interfaces and static methods for establishing
|
||||
* flow-controlled components in which {@link Publisher Publishers}
|
||||
* produce items consumed by one or more {@link Subscriber
|
||||
* Subscribers}, each managed by a {@link Subscription
|
||||
* Subscription}.
|
||||
*
|
||||
* <p>These interfaces correspond to the <a
|
||||
* href="http://www.reactive-streams.org/"> reactive-streams</a>
|
||||
* specification. They apply in both concurrent and distributed
|
||||
* asynchronous settings: All (seven) methods are defined in {@code
|
||||
* void} "one-way" message style. Communication relies on a simple form
|
||||
* of flow control (method {@link Subscription#request}) that can be
|
||||
* used to avoid resource management problems that may otherwise occur
|
||||
* in "push" based systems.
|
||||
*
|
||||
* <p><b>Examples.</b> A {@link Publisher} usually defines its own
|
||||
* {@link Subscription} implementation; constructing one in method
|
||||
* {@code subscribe} and issuing it to the calling {@link
|
||||
* Subscriber}. It publishes items to the subscriber asynchronously,
|
||||
* normally using an {@link java.util.concurrent.Executor}. For example, here is a very
|
||||
* simple publisher that only issues (when requested) a single {@code
|
||||
* TRUE} item to a single subscriber. Because the subscriber receives
|
||||
* only a single item, this class does not use buffering and ordering
|
||||
* control required in most implementations (for example {@link
|
||||
* SubmissionPublisher}).
|
||||
*
|
||||
* <pre> {@code
|
||||
* class OneShotPublisher implements Publisher<Boolean> {
|
||||
* private final ExecutorService executor = ForkJoinPool.commonPool(); // daemon-based
|
||||
* private boolean subscribed; // true after first subscribe
|
||||
* public synchronized void subscribe(Subscriber<? super Boolean> subscriber) {
|
||||
* if (subscribed)
|
||||
* subscriber.onError(new IllegalStateException()); // only one allowed
|
||||
* else {
|
||||
* subscribed = true;
|
||||
* subscriber.onSubscribe(new OneShotSubscription(subscriber, executor));
|
||||
* }
|
||||
* }
|
||||
* static class OneShotSubscription implements Subscription {
|
||||
* private final Subscriber<? super Boolean> subscriber;
|
||||
* private final ExecutorService executor;
|
||||
* private Future<?> future; // to allow cancellation
|
||||
* private boolean completed;
|
||||
* OneShotSubscription(Subscriber<? super Boolean> subscriber,
|
||||
* ExecutorService executor) {
|
||||
* this.subscriber = subscriber;
|
||||
* this.executor = executor;
|
||||
* }
|
||||
* public synchronized void request(long n) {
|
||||
* if (n != 0 && !completed) {
|
||||
* completed = true;
|
||||
* if (n < 0) {
|
||||
* IllegalArgumentException ex = new IllegalArgumentException();
|
||||
* executor.execute(() -> subscriber.onError(ex));
|
||||
* } else {
|
||||
* future = executor.submit(() -> {
|
||||
* subscriber.onNext(Boolean.TRUE);
|
||||
* subscriber.onComplete();
|
||||
* });
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* public synchronized void cancel() {
|
||||
* completed = true;
|
||||
* if (future != null) future.cancel(false);
|
||||
* }
|
||||
* }
|
||||
* }}</pre>
|
||||
*
|
||||
* <p>A {@link Subscriber} arranges that items be requested and
|
||||
* processed. Items (invocations of {@link Subscriber#onNext}) are
|
||||
* not issued unless requested, but multiple items may be requested.
|
||||
* Many Subscriber implementations can arrange this in the style of
|
||||
* the following example, where a buffer size of 1 single-steps, and
|
||||
* larger sizes usually allow for more efficient overlapped processing
|
||||
* with less communication; for example with a value of 64, this keeps
|
||||
* total outstanding requests between 32 and 64.
|
||||
* Because Subscriber method invocations for a given {@link
|
||||
* Subscription} are strictly ordered, there is no need for these
|
||||
* methods to use locks or volatiles unless a Subscriber maintains
|
||||
* multiple Subscriptions (in which case it is better to instead
|
||||
* define multiple Subscribers, each with its own Subscription).
|
||||
*
|
||||
* <pre> {@code
|
||||
* class SampleSubscriber<T> implements Subscriber<T> {
|
||||
* final Consumer<? super T> consumer;
|
||||
* Subscription subscription;
|
||||
* final long bufferSize;
|
||||
* long count;
|
||||
* SampleSubscriber(long bufferSize, Consumer<? super T> consumer) {
|
||||
* this.bufferSize = bufferSize;
|
||||
* this.consumer = consumer;
|
||||
* }
|
||||
* public void onSubscribe(Subscription subscription) {
|
||||
* long initialRequestSize = bufferSize;
|
||||
* count = bufferSize - bufferSize / 2; // re-request when half consumed
|
||||
* (this.subscription = subscription).request(initialRequestSize);
|
||||
* }
|
||||
* public void onNext(T item) {
|
||||
* if (--count <= 0)
|
||||
* subscription.request(count = bufferSize - bufferSize / 2);
|
||||
* consumer.accept(item);
|
||||
* }
|
||||
* public void onError(Throwable ex) { ex.printStackTrace(); }
|
||||
* public void onComplete() {}
|
||||
* }}</pre>
|
||||
*
|
||||
* <p>The default value of {@link #defaultBufferSize} may provide a
|
||||
* useful starting point for choosing request sizes and capacities in
|
||||
* Flow components based on expected rates, resources, and usages.
|
||||
* Or, when flow control is never needed, a subscriber may initially
|
||||
* request an effectively unbounded number of items, as in:
|
||||
*
|
||||
* <pre> {@code
|
||||
* class UnboundedSubscriber<T> implements Subscriber<T> {
|
||||
* public void onSubscribe(Subscription subscription) {
|
||||
* subscription.request(Long.MAX_VALUE); // effectively unbounded
|
||||
* }
|
||||
* public void onNext(T item) { use(item); }
|
||||
* public void onError(Throwable ex) { ex.printStackTrace(); }
|
||||
* public void onComplete() {}
|
||||
* void use(T item) { ... }
|
||||
* }}</pre>
|
||||
*
|
||||
*/
|
||||
public final class Flow {
|
||||
|
||||
private Flow() {} // uninstantiable
|
||||
|
||||
/**
|
||||
* A producer of items (and related control messages) received by
|
||||
* Subscribers. Each current {@link Subscriber} receives the same
|
||||
* items (via method {@code onNext}) in the same order, unless
|
||||
* drops or errors are encountered. If a Publisher encounters an
|
||||
* error that does not allow items to be issued to a Subscriber,
|
||||
* that Subscriber receives {@code onError}, and then receives no
|
||||
* further messages. Otherwise, when it is known that no further
|
||||
* messages will be issued to it, a subscriber receives {@code
|
||||
* onComplete}. Publishers ensure that Subscriber method
|
||||
* invocations for each subscription are strictly ordered in <a
|
||||
* href="package-summary.html#MemoryVisibility"><i>happens-before</i></a>
|
||||
* order.
|
||||
*
|
||||
* <p>Publishers may vary in policy about whether drops (failures
|
||||
* to issue an item because of resource limitations) are treated
|
||||
* as unrecoverable errors. Publishers may also vary about
|
||||
* whether Subscribers receive items that were produced or
|
||||
* available before they subscribed.
|
||||
*
|
||||
* @param <T> the published item type
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface Publisher<T> {
|
||||
/**
|
||||
* Adds the given Subscriber if possible. If already
|
||||
* subscribed, or the attempt to subscribe fails due to policy
|
||||
* violations or errors, the Subscriber's {@code onError}
|
||||
* method is invoked with an {@link IllegalStateException}.
|
||||
* Otherwise, the Subscriber's {@code onSubscribe} method is
|
||||
* invoked with a new {@link Subscription}. Subscribers may
|
||||
* enable receiving items by invoking the {@code request}
|
||||
* method of this Subscription, and may unsubscribe by
|
||||
* invoking its {@code cancel} method.
|
||||
*
|
||||
* @param subscriber the subscriber
|
||||
* @throws NullPointerException if subscriber is null
|
||||
*/
|
||||
void subscribe(Subscriber<? super T> subscriber);
|
||||
}
|
||||
|
||||
/**
|
||||
* A receiver of messages. The methods in this interface are
|
||||
* invoked in strict sequential order for each {@link
|
||||
* Subscription}.
|
||||
*
|
||||
* @param <T> the subscribed item type
|
||||
*/
|
||||
public interface Subscriber<T> {
|
||||
/**
|
||||
* Method invoked prior to invoking any other Subscriber
|
||||
* methods for the given Subscription. If this method throws
|
||||
* an exception, resulting behavior is not guaranteed, but may
|
||||
* cause the Subscription not to be established or to be cancelled.
|
||||
*
|
||||
* <p>Typically, implementations of this method invoke {@code
|
||||
* subscription.request} to enable receiving items.
|
||||
*
|
||||
* @param subscription a new subscription
|
||||
*/
|
||||
void onSubscribe(Subscription subscription);
|
||||
|
||||
/**
|
||||
* Method invoked with a Subscription's next item. If this
|
||||
* method throws an exception, resulting behavior is not
|
||||
* guaranteed, but may cause the Subscription to be cancelled.
|
||||
*
|
||||
* @param item the item
|
||||
*/
|
||||
void onNext(T item);
|
||||
|
||||
/**
|
||||
* Method invoked upon an unrecoverable error encountered by a
|
||||
* Publisher or Subscription, after which no other Subscriber
|
||||
* methods are invoked by the Subscription. If this method
|
||||
* itself throws an exception, resulting behavior is
|
||||
* undefined.
|
||||
*
|
||||
* @param throwable the exception
|
||||
*/
|
||||
void onError(Throwable throwable);
|
||||
|
||||
/**
|
||||
* Method invoked when it is known that no additional
|
||||
* Subscriber method invocations will occur for a Subscription
|
||||
* that is not already terminated by error, after which no
|
||||
* other Subscriber methods are invoked by the Subscription.
|
||||
* If this method throws an exception, resulting behavior is
|
||||
* undefined.
|
||||
*/
|
||||
void onComplete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Message control linking a {@link Publisher} and {@link
|
||||
* Subscriber}. Subscribers receive items only when requested,
|
||||
* and may cancel at any time. The methods in this interface are
|
||||
* intended to be invoked only by their Subscribers; usages in
|
||||
* other contexts have undefined effects.
|
||||
*/
|
||||
public interface Subscription {
|
||||
/**
|
||||
* Adds the given number {@code n} of items to the current
|
||||
* unfulfilled demand for this subscription. If {@code n} is
|
||||
* less than or equal to zero, the Subscriber will receive an
|
||||
* {@code onError} signal with an {@link
|
||||
* IllegalArgumentException} argument. Otherwise, the
|
||||
* Subscriber will receive up to {@code n} additional {@code
|
||||
* onNext} invocations (or fewer if terminated).
|
||||
*
|
||||
* @param n the increment of demand; a value of {@code
|
||||
* Long.MAX_VALUE} may be considered as effectively unbounded
|
||||
*/
|
||||
void request(long n);
|
||||
|
||||
/**
|
||||
* Causes the Subscriber to (eventually) stop receiving
|
||||
* messages. Implementation is best-effort -- additional
|
||||
* messages may be received after invoking this method.
|
||||
* A cancelled subscription need not ever receive an
|
||||
* {@code onComplete} or {@code onError} signal.
|
||||
*/
|
||||
void cancel();
|
||||
}
|
||||
|
||||
/**
|
||||
* A component that acts as both a Subscriber and Publisher.
|
||||
*
|
||||
* @param <T> the subscribed item type
|
||||
* @param <R> the published item type
|
||||
*/
|
||||
public interface Processor<T, R> extends Subscriber<T>, Publisher<R> {
|
||||
}
|
||||
|
||||
static final int DEFAULT_BUFFER_SIZE = 256;
|
||||
|
||||
/**
|
||||
* Returns a default value for Publisher or Subscriber buffering,
|
||||
* that may be used in the absence of other constraints.
|
||||
*
|
||||
* @return the buffer size value
|
||||
*/
|
||||
public static int defaultBufferSize() {
|
||||
return DEFAULT_BUFFER_SIZE;
|
||||
}
|
||||
}
|
||||
@@ -15,11 +15,10 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
|
||||
/**
|
||||
* A subscriber delegated java functions for each of the subscriber methods.
|
||||
*/
|
||||
|
||||
@@ -17,10 +17,10 @@ package io.helidon.common.reactive;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
|
||||
import io.helidon.common.mapper.Mapper;
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
|
||||
import static io.helidon.common.CollectionsHelper.listOf;
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
|
||||
/**
|
||||
* Implementation of {@link Multi} that represents the absence of a value by invoking {@link Subscriber#onComplete() } during
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
|
||||
/**
|
||||
* Implementation of {@link Multi} that represents an error, raised during {@link Publisher#subscribe(Subscriber)} by invoking
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
|
||||
/**
|
||||
* Implementation of {@link Multi} that is backed by a {@link Publisher}.
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
|
||||
import io.helidon.common.mapper.Mapper;
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
|
||||
/**
|
||||
* Processor of {@link Publisher} to {@link Single} that publishes and maps each received item.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
|
||||
/**
|
||||
* Implementation of {@link Multi} that never invokes {@link Subscriber#onComplete()} or
|
||||
|
||||
@@ -18,16 +18,16 @@ package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
|
||||
/**
|
||||
* The OriginThreadPublisher's nature is to always run {@link Subscriber#onNext(Object)} on the very same thread as
|
||||
* {@link #submit(Object)}. In other words, whenever the source of chunks sends data, the same thread is used to deliver the data
|
||||
|
||||
@@ -22,9 +22,10 @@ import java.nio.ByteBuffer;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
/**
|
||||
* Output stream that {@link io.helidon.common.reactive.Flow.Publisher} publishes any data written to it as {@link ByteBuffer}
|
||||
* Output stream that {@link java.util.concurrent.Flow.Publisher} publishes any data written to it as {@link ByteBuffer}
|
||||
* events.
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import org.reactivestreams.Publisher;
|
||||
import org.reactivestreams.Subscriber;
|
||||
import org.reactivestreams.Subscription;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,7 +23,7 @@ import java.util.function.Consumer;
|
||||
* Requested event counter.
|
||||
*
|
||||
* This utility class helps to safely track and tryProcess the back-pressure of
|
||||
* {@link io.helidon.common.reactive.Flow.Subscriber}s.
|
||||
* {@link java.util.concurrent.Flow.Subscriber}s.
|
||||
*/
|
||||
public class RequestedCounter {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,7 +17,7 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
/**
|
||||
* Defines delay for next read/poll operation in a polling {@link io.helidon.common.reactive.Flow.Publisher publisher}.
|
||||
* Defines delay for next read/poll operation in a polling {@link java.util.concurrent.Flow.Publisher publisher}.
|
||||
* <p>
|
||||
* Schema defines a delay before next poll if the last one did not get new data.
|
||||
* <p>
|
||||
|
||||
@@ -19,12 +19,12 @@ import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import io.helidon.common.mapper.Mapper;
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
|
||||
/**
|
||||
* Single item publisher utility.
|
||||
|
||||
@@ -15,10 +15,12 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
/**
|
||||
* Implementation of {@link Single} that represents the absence of a value by
|
||||
* invoking {@link Subscriber#onComplete() } during
|
||||
* {@link Publisher#subscribe(Subscriber)}.
|
||||
* invoking {@link java.util.concurrent.Flow.Subscriber#onComplete() } during
|
||||
* {@link java.util.concurrent.Flow.Publisher#subscribe(java.util.concurrent.Flow.Subscriber)}.
|
||||
*/
|
||||
final class SingleEmpty implements Single<Object> {
|
||||
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
|
||||
/**
|
||||
* Implementation of {@link Single} that represents an error, raised during
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
|
||||
/**
|
||||
* Implementation of {@link Single} that represents a non {@code null} value.
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
|
||||
import io.helidon.common.mapper.Mapper;
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
|
||||
/**
|
||||
* Processor of {@link Publisher} to {@link Single} that only processes the first
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
|
||||
import io.helidon.common.mapper.Mapper;
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
|
||||
/**
|
||||
* Processor of {@link Single} to {@link Publisher} that expands the first (and
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
|
||||
/**
|
||||
* Implementation of {@link Single} that never invokes
|
||||
|
||||
@@ -18,6 +18,7 @@ package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -38,7 +39,7 @@ public class SingleSubscriberHolder<T> {
|
||||
* <p>
|
||||
* In case the subscriber registration fails (e.g. the holder already holds a previously registered subscriber
|
||||
* or the holder has been {@link #close(Consumer) closed}), the newly registered subscriber is notified about the
|
||||
* error by invoking it's {@link io.helidon.common.reactive.Flow.Subscriber#onError(Throwable) subscriber.onError} method.
|
||||
* error by invoking it's {@link java.util.concurrent.Flow.Subscriber#onError(Throwable) subscriber.onError} method.
|
||||
*
|
||||
* @param subscriber subscriber to be registered in the holder.
|
||||
* @return {@code true} if the subscriber was successfully registered, {@code false} otherwise.
|
||||
@@ -67,7 +68,7 @@ public class SingleSubscriberHolder<T> {
|
||||
/**
|
||||
* Mark the subscriber holder as closed.
|
||||
* <p>
|
||||
* Invoking this method will ensure that any new attempts to {@link #register(io.helidon.common.reactive.Flow.Subscriber)
|
||||
* Invoking this method will ensure that any new attempts to {@link #register(java.util.concurrent.Flow.Subscriber)
|
||||
* register} a new subscriber
|
||||
* would fail.
|
||||
* <p>
|
||||
|
||||
@@ -15,11 +15,10 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
|
||||
/**
|
||||
* Single fixed item subscription.
|
||||
*/
|
||||
|
||||
@@ -17,11 +17,10 @@ package io.helidon.common.reactive;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
|
||||
/**
|
||||
* {@link Single} exposed as a {@link CompletableFuture}.
|
||||
*/
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
|
||||
/**
|
||||
* Decorated publisher that allows subscribing to individual events with java functions.
|
||||
* @param <T> item type
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,7 +17,7 @@
|
||||
/**
|
||||
* Common reactive library for Helidon projects.
|
||||
*
|
||||
* @see io.helidon.common.reactive.Flow
|
||||
* @see java.util.concurrent.Flow
|
||||
* @see io.helidon.common.reactive.ReactiveStreamsAdapter
|
||||
* @see io.helidon.common.reactive.OutputStreamPublisher
|
||||
* @see io.helidon.common.reactive.SubmissionPublisher
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,16 +17,15 @@
|
||||
package io.helidon.common.reactive.valve;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
|
||||
/**
|
||||
* The {@link Valve} implementation on top of {@link io.helidon.common.reactive.Flow.Publisher}.
|
||||
* The {@link Valve} implementation on top of {@link java.util.concurrent.Flow.Publisher}.
|
||||
*
|
||||
* @param <T> Type of {@code Valve} and {@code Publisher} items
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,14 +21,13 @@ import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collector;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
|
||||
/**
|
||||
* Represents a reactive source of data which can be {@link #pause() paused} and {@link #resume() resumed}.
|
||||
*
|
||||
@@ -199,9 +198,9 @@ public interface Valve<T> extends Pausable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms this {@code Valve} into {@link io.helidon.common.reactive.Flow.Publisher} representation. Resulting {@code
|
||||
* Transforms this {@code Valve} into {@link java.util.concurrent.Flow.Publisher} representation. Resulting {@code
|
||||
* Publisher}
|
||||
* accepts only single {@link io.helidon.common.reactive.Flow.Subscriber}.
|
||||
* accepts only single {@link java.util.concurrent.Flow.Subscriber}.
|
||||
*
|
||||
* @return a {@code Publisher} representation
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,12 +16,11 @@
|
||||
|
||||
package io.helidon.common.reactive.valve;
|
||||
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
|
||||
/**
|
||||
* The ValvePublisher provides {@link io.helidon.common.reactive.Flow.Publisher} based API for the {@link Valve}.
|
||||
* The ValvePublisher provides {@link java.util.concurrent.Flow.Publisher} based API for the {@link Valve}.
|
||||
* This publisher accepts only a single subscriber.
|
||||
*
|
||||
* @param <T> the type of items to be published
|
||||
@@ -35,10 +34,10 @@ class ValvePublisher<T> implements Flow.Publisher<T> {
|
||||
private volatile PausableFeeder pausableFeeder;
|
||||
|
||||
/**
|
||||
* Creates a {@link io.helidon.common.reactive.Flow.Publisher} wrapping a provided {@link Valve}.
|
||||
* Depending on the Valve implementation, only the first {@link io.helidon.common.reactive.Flow.Subscriber}
|
||||
* Creates a {@link java.util.concurrent.Flow.Publisher} wrapping a provided {@link Valve}.
|
||||
* Depending on the Valve implementation, only the first {@link java.util.concurrent.Flow.Subscriber}
|
||||
* (subscribed to any number of such created publishers for a single {@link Valve} instance) that calls
|
||||
* {@link io.helidon.common.reactive.Flow.Subscription#request(long)} will be able to consume the produced items.
|
||||
* {@link java.util.concurrent.Flow.Subscription#request(long)} will be able to consume the produced items.
|
||||
*
|
||||
* @param valve the valve to wrap
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,8 +20,7 @@ import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
/**
|
||||
* An utility class for {@link Valve} interface.
|
||||
@@ -105,7 +104,7 @@ public class Valves {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link Valve} instance from provided {@link io.helidon.common.reactive.Flow.Publisher}.
|
||||
* Creates a {@link Valve} instance from provided {@link java.util.concurrent.Flow.Publisher}.
|
||||
* <p>
|
||||
* If {@code publisher} parameter is {@code null} then returns an empty {@link Valve}.
|
||||
*
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
|
||||
import io.helidon.common.mapper.Mapper;
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -19,19 +19,19 @@ package io.helidon.common.reactive;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
|
||||
@@ -16,13 +16,12 @@
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
|
||||
@@ -15,13 +15,16 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* {@link Subscribeable} test.
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Publisher;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.Flow.Publisher;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
|
||||
/**
|
||||
* Dummy items publisher for testing purpose.
|
||||
|
||||
@@ -18,6 +18,7 @@ package io.helidon.common.reactive;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
/**
|
||||
* A dummy subscriber for testing purpose.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
|
||||
/**
|
||||
* Dummy subscription for testing purpose.
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package io.helidon.common.reactive;
|
||||
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import org.reactivestreams.Publisher;
|
||||
import org.reactivestreams.Subscriber;
|
||||
import org.reactivestreams.Subscription;
|
||||
|
||||
@@ -18,12 +18,12 @@ package io.helidon.common.reactive.valve;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Flow.Subscriber;
|
||||
import java.util.concurrent.Flow.Subscription;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import io.helidon.common.reactive.Collector;
|
||||
import io.helidon.common.reactive.Flow.Subscriber;
|
||||
import io.helidon.common.reactive.Flow.Subscription;
|
||||
import io.helidon.common.reactive.Multi;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -26,13 +26,13 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.internal.ConfigKeyImpl;
|
||||
|
||||
import org.eclipse.microprofile.config.spi.ConfigSource;
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.util.ServiceLoader;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
@@ -40,7 +41,6 @@ import javax.annotation.Priority;
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.common.GenericType;
|
||||
import io.helidon.common.Prioritized;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.common.serviceloader.HelidonServiceLoader;
|
||||
import io.helidon.common.serviceloader.Priorities;
|
||||
import io.helidon.config.ConfigMapperManager.MapperProviders;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,12 +24,12 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.common.reactive.SubmissionPublisher;
|
||||
import io.helidon.config.internal.ConfigThreadFactory;
|
||||
import io.helidon.config.internal.ConfigUtils;
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
@@ -30,7 +31,6 @@ import java.util.stream.Stream;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.common.GenericType;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.internal.ConfigKeyImpl;
|
||||
import io.helidon.config.spi.ConfigFilter;
|
||||
import io.helidon.config.spi.ConfigMapperProvider;
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.util.Optional;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -36,7 +37,6 @@ import java.util.stream.IntStream;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.internal.ConfigKeyImpl;
|
||||
import io.helidon.config.spi.ConfigFilter;
|
||||
import io.helidon.config.spi.ConfigNode;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,11 +27,11 @@ import java.security.PrivilegedAction;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.Function;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.internal.ConfigFileTypeDetector;
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,12 +33,12 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import io.helidon.common.Builder;
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.internal.ConfigUtils;
|
||||
import io.helidon.config.internal.MapConfigSource;
|
||||
import io.helidon.config.internal.PrefixedConfigSource;
|
||||
|
||||
@@ -20,10 +20,10 @@ import java.nio.file.Path;
|
||||
import java.nio.file.WatchEvent.Modifier;
|
||||
import java.nio.file.WatchService;
|
||||
import java.time.Duration;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import io.helidon.common.Builder;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.internal.FilesystemWatchPollingStrategy;
|
||||
import io.helidon.config.internal.ScheduledPollingStrategy;
|
||||
import io.helidon.config.internal.ScheduledPollingStrategy.RegularRecurringPolicy;
|
||||
|
||||
@@ -26,13 +26,13 @@ import java.util.Optional;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.Function;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.common.reactive.SubmissionPublisher;
|
||||
import io.helidon.config.internal.ConfigKeyImpl;
|
||||
import io.helidon.config.internal.ConfigUtils;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,11 +16,10 @@
|
||||
|
||||
package io.helidon.config;
|
||||
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
|
||||
/**
|
||||
* Publisher with "suspended" and "running" behavior.
|
||||
* <p>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,8 +19,8 @@ package io.helidon.config;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.spi.ConfigContext;
|
||||
import io.helidon.config.spi.ConfigNode.ObjectNode;
|
||||
import io.helidon.config.spi.ConfigSource;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,6 +28,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -35,7 +36,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.common.reactive.SubmissionPublisher;
|
||||
import io.helidon.config.ConfigException;
|
||||
import io.helidon.config.ConfigHelper;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,6 +19,7 @@ package io.helidon.config.internal;
|
||||
import java.time.Duration;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -27,7 +28,6 @@ import java.util.function.BiFunction;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.common.reactive.SubmissionPublisher;
|
||||
import io.helidon.config.ConfigHelper;
|
||||
import io.helidon.config.spi.PollingStrategy;
|
||||
|
||||
@@ -21,11 +21,11 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Function;
|
||||
|
||||
import io.helidon.common.OptionalHelper;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.config.internal.ConfigKeyImpl;
|
||||
import io.helidon.config.internal.ListNodeBuilderImpl;
|
||||
|
||||
@@ -21,10 +21,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
|
||||
import org.eclipse.microprofile.config.spi.ConfigSource;
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
package io.helidon.config.spi;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
/**
|
||||
* Base abstract implementation of {@link OverrideSource}, suitable for concrete
|
||||
|
||||
@@ -20,12 +20,12 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.common.reactive.SubmissionPublisher;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.config.ConfigException;
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
package io.helidon.config.spi;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
/**
|
||||
* A changeable component is a component that may identify a change
|
||||
|
||||
@@ -19,9 +19,9 @@ package io.helidon.config.spi;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.config.PollingStrategies;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,8 +17,8 @@
|
||||
package io.helidon.config.spi;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.ConfigException;
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,12 +19,12 @@ package io.helidon.config;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import io.helidon.common.GenericType;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.internal.ConfigKeyImpl;
|
||||
import io.helidon.config.spi.ConfigFilter;
|
||||
import io.helidon.config.spi.ConfigNode;
|
||||
|
||||
@@ -16,17 +16,18 @@
|
||||
|
||||
package io.helidon.config;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.lessThan;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.lessThan;
|
||||
|
||||
|
||||
/**
|
||||
* General tests of {@link Config} to be extended by test classes for missing, value, object and list node types.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,6 +22,7 @@ import java.util.function.Supplier;
|
||||
import io.helidon.config.spi.ConfigFilter;
|
||||
|
||||
import org.hamcrest.CoreMatchers;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -25,12 +25,13 @@ import io.helidon.config.internal.PropertiesConfigParser;
|
||||
import io.helidon.config.spi.ConfigNode.ObjectNode;
|
||||
import io.helidon.config.spi.ConfigParser;
|
||||
import io.helidon.config.spi.ConfigParserException;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.hasSize;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package io.helidon.config;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.test.infra.RestoreSystemPropertiesExt;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -22,8 +22,8 @@ import java.nio.file.Path;
|
||||
import java.util.HashSet;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.ClasspathConfigSource.ClasspathBuilder;
|
||||
import io.helidon.config.spi.ConfigContext;
|
||||
import io.helidon.config.spi.ConfigNode.ObjectNode;
|
||||
|
||||
@@ -19,8 +19,8 @@ package io.helidon.config;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.ClasspathOverrideSource.ClasspathBuilder;
|
||||
import io.helidon.config.spi.OverrideSource;
|
||||
import io.helidon.config.spi.PollingStrategy;
|
||||
|
||||
@@ -22,12 +22,12 @@ import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.internal.PropertiesConfigParser;
|
||||
import io.helidon.config.spi.ConfigContext;
|
||||
import io.helidon.config.spi.ConfigNode.ObjectNode;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,11 +21,12 @@ import java.util.stream.Collectors;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
import static org.hamcrest.Matchers.empty;
|
||||
import static org.hamcrest.core.Is.is;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Tests {@link ConfigDiff}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,7 +26,6 @@ import org.junit.jupiter.api.Test;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.empty;
|
||||
import static org.hamcrest.core.Is.is;
|
||||
import static org.junit.jupiter.api.Assertions.assertAll;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,13 +19,13 @@ package io.helidon.config;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.nio.CharBuffer;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.function.Function;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,11 +17,12 @@
|
||||
package io.helidon.config;
|
||||
|
||||
import io.helidon.config.internal.PropertiesConfigParser;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
|
||||
/**
|
||||
* Tests {@link ConfigParsers}.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,10 +18,10 @@ package io.helidon.config;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.common.reactive.SubmissionPublisher;
|
||||
import io.helidon.config.spi.ConfigContext;
|
||||
import io.helidon.config.spi.ConfigNode.ObjectNode;
|
||||
|
||||
@@ -25,9 +25,9 @@ import java.util.HashSet;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.FileConfigSource.FileBuilder;
|
||||
import io.helidon.config.spi.ConfigContext;
|
||||
import io.helidon.config.spi.ConfigNode.ObjectNode;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package io.helidon.config;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,16 +16,17 @@
|
||||
|
||||
package io.helidon.config;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.helidon.config.spi.PollingStrategy;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Tests {@link PollingStrategies}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,7 +17,7 @@
|
||||
package io.helidon.config;
|
||||
|
||||
/**
|
||||
* Testing implementation of {@link io.helidon.common.reactive.Flow.Subscriber} on {@link Config#changes()} events.
|
||||
* Testing implementation of {@link java.util.concurrent.Flow.Subscriber} on {@link Config#changes()} events.
|
||||
*/
|
||||
public class TestingConfigChangeSubscriber extends TestingSubscriber<Config> {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,7 +22,7 @@ import io.helidon.config.spi.ConfigNode.ObjectNode;
|
||||
import io.helidon.config.spi.ConfigSource;
|
||||
|
||||
/**
|
||||
* Testing implementation of {@link io.helidon.common.reactive.Flow.Subscriber} on {@link ConfigSource#changes()} events.
|
||||
* Testing implementation of {@link java.util.concurrent.Flow.Subscriber} on {@link ConfigSource#changes()} events.
|
||||
*/
|
||||
public class TestingConfigSourceChangeSubscriber extends TestingSubscriber<Optional<ObjectNode>> {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,9 +17,9 @@
|
||||
package io.helidon.config;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.common.reactive.SubmissionPublisher;
|
||||
import io.helidon.config.spi.PollingStrategy;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,10 +17,9 @@
|
||||
package io.helidon.config;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ package io.helidon.config;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.time.Duration;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.UrlConfigSource.UrlBuilder;
|
||||
import io.helidon.config.spi.ConfigContext;
|
||||
import io.helidon.config.spi.ConfigSource;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,11 +20,12 @@ import java.util.Optional;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.config.spi.ConfigContext;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.Matchers.stringContainsInOrder;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,11 +17,12 @@
|
||||
package io.helidon.config.internal;
|
||||
|
||||
import java.time.Duration;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
import static org.hamcrest.core.Is.is;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.core.Is.is;
|
||||
|
||||
/**
|
||||
* Tests {@link ScheduledPollingStrategy.AdaptiveRecurringPolicy}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,10 +19,11 @@ package io.helidon.config.internal;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import io.helidon.config.ConfigHelper;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
/**
|
||||
* Tests {@link ConfigFileTypeDetector}.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,13 +19,14 @@ package io.helidon.config.internal;
|
||||
import io.helidon.config.Config;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.Matchers.lessThan;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* Tests {@link ConfigKeyImpl}.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,14 +28,14 @@ import java.util.stream.Collectors;
|
||||
import javax.annotation.Priority;
|
||||
|
||||
import io.helidon.config.internal.ConfigUtils.ScheduledTask;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.hamcrest.core.IsInstanceOf;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Tests {@link ConfigUtils}.
|
||||
|
||||
@@ -16,14 +16,13 @@
|
||||
|
||||
package io.helidon.config.internal;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.Instant;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Flow;
|
||||
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.config.ConfigException;
|
||||
import io.helidon.config.OverrideSources;
|
||||
import io.helidon.config.internal.FileOverrideSource.FileBuilder;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,15 +16,17 @@
|
||||
|
||||
package io.helidon.config.internal;
|
||||
|
||||
import io.helidon.config.test.infra.TemporaryFolderExt;
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
|
||||
import io.helidon.config.test.infra.TemporaryFolderExt;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
/**
|
||||
* Tests {@link FileSourceHelper}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,10 +24,10 @@ import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Flow;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.common.reactive.Flow;
|
||||
import io.helidon.common.reactive.SubmissionPublisher;
|
||||
import io.helidon.config.spi.PollingStrategy;
|
||||
import io.helidon.config.test.infra.TemporaryFolderExt;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,10 +24,11 @@ import io.helidon.common.CollectionsHelper;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.config.spi.OverrideSource;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.hamcrest.core.Is.is;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Tests {@link OverrideConfigFilter}.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user