Package com.chemaxon.calculations.common
Class ProgressObservers
java.lang.Object
com.chemaxon.calculations.common.ProgressObservers
@PublicAPI
@Deprecated(forRemoval=true)
@SubjectToRemoval(date=JAN_01_2025)
public final class ProgressObservers
extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Utility functions for the creation of ProgressObservers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CancelObserver
anyCancelled
(CancelObserver... cancelObservers) Deprecated, for removal: This API element is subject to removal in a future version.UseCancelObserver.onAnyCancelled(CancelObserver...)
instead.static ProgressObserver
Deprecated, for removal: This API element is subject to removal in a future version.UseProgressObserver.nullObserver()
instead.static CancelObserver
Deprecated, for removal: This API element is subject to removal in a future version.UseCancelObserver.never()
instead.static ProgressObserver
createNullObserver
(String taskName) Deprecated, for removal: This API element is subject to removal in a future version.Will be removed without replacement.static ProgressObserver
Deprecated, for removal: This API element is subject to removal in a future version.Will be removed without replacement.static CancelObserver
Deprecated, for removal: This API element is subject to removal in a future version.UseCancelObserver.never()
instead.static ProgressObserver
Deprecated, for removal: This API element is subject to removal in a future version.UseProgressObserver.nullObserver()
instead.static ProgressObserver
nullProgressObserver
(CancelObserver canceller) Deprecated, for removal: This API element is subject to removal in a future version.Will be removed without replacement.static CancelObserver
orTimeout
(CancelObserver cancelObserver, long timeoutInSeconds) Deprecated, for removal: This API element is subject to removal in a future version.Use a combination ofCancelObserver.onTimeout(long)
andCancelObserver.onAnyCancelled(CancelObserver...)
instead.static CancelObserver
timeoutCanceller
(long timeoutInSeconds) Deprecated, for removal: This API element is subject to removal in a future version.UseCancelObserver.onTimeout(long)
instead.
-
Method Details
-
createStrictNullObserver
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static ProgressObserver createStrictNullObserver()Deprecated, for removal: This API element is subject to removal in a future version.Will be removed without replacement.Returns a ProgressObserver which ignores observed data.API contract is still enforced, eg.
IllegalStateException
is thrown on API contract breaches from the observed code.- Returns:
- A ProgressObserver with no query functionality.
-
createNullObserver
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static ProgressObserver createNullObserver(String taskName) Deprecated, for removal: This API element is subject to removal in a future version.Will be removed without replacement.Returns a ProgressObserver which ignores observed data.API contract is still enforced, eg.
IllegalStateException
is thrown on API contract breaches from the observed code.- Parameters:
taskName
- Name of observed subtask- Returns:
- A ProgressObserver with no query functionality.
-
noCanceller
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static CancelObserver noCanceller()Deprecated, for removal: This API element is subject to removal in a future version.UseCancelObserver.never()
instead.Returns a cancel observer which wont cancel execution.- Returns:
- A canceller which wont cancel
-
timeoutCanceller
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static CancelObserver timeoutCanceller(long timeoutInSeconds) Deprecated, for removal: This API element is subject to removal in a future version.UseCancelObserver.onTimeout(long)
instead.Returns a cancel observer which cancels after a specified timeout.This method returns a naive observer which checks
System.currentTimeMillis()
upon every invocation of itsCancelObserver.isCancelled()
method.- Parameters:
timeoutInSeconds
- Timeout in seconds. Use0
for no timeout.- Returns:
- Canceller which cancel after a specified amount of time or a
noCanceller()
when0
timeout is specified
-
anyCancelled
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static CancelObserver anyCancelled(CancelObserver... cancelObservers) Deprecated, for removal: This API element is subject to removal in a future version.UseCancelObserver.onAnyCancelled(CancelObserver...)
instead.Returns a cancel observer which cancels when any of the specified observer is cancelled.- Parameters:
cancelObservers
- Observers to watch. Note thatnull
is accepted- Returns:
- Canceller which cancel when any of the passed non-null observers cancelled
-
orTimeout
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static CancelObserver orTimeout(CancelObserver cancelObserver, long timeoutInSeconds) Deprecated, for removal: This API element is subject to removal in a future version.Use a combination ofCancelObserver.onTimeout(long)
andCancelObserver.onAnyCancelled(CancelObserver...)
instead.Returns a cancel observer which cancels when a passed observer is cancelled or a timeout occurred.- Parameters:
cancelObserver
- Base observer, can benull
timeoutInSeconds
- Timeout in seconds; use0
for no timeout- Returns:
- Canceller
-
createNoCancelObserver
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static CancelObserver createNoCancelObserver()Deprecated, for removal: This API element is subject to removal in a future version.UseCancelObserver.never()
instead.Returns a cancel observer which wont cancel execution.- Returns:
- A Canceller which wont cancel
-
nullProgressObserver
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static ProgressObserver nullProgressObserver()Deprecated, for removal: This API element is subject to removal in a future version.UseProgressObserver.nullObserver()
instead.Returns a forgiving observer which wont enforce API contracts.- Returns:
- A
ProgressObserver
which wont enforce API contracts and wont cancel
-
createForgivingNullObserver
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static ProgressObserver createForgivingNullObserver()Deprecated, for removal: This API element is subject to removal in a future version.UseProgressObserver.nullObserver()
instead.Returns a forgiving observer which wont enforce API contracts.- Returns:
- A
ProgressObserver
which wont enforce API contracts and wont cancel
-
nullProgressObserver
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static ProgressObserver nullProgressObserver(CancelObserver canceller) Deprecated, for removal: This API element is subject to removal in a future version.Will be removed without replacement.Returns a forgiving cancellable observer which wont enforce API contracts.Note that current implementation polls cancelling upon method calls. If an observed code expects cancelling only through listener callbacks and wont call other methods (progress update) cancel event wont be generated.
- Parameters:
canceller
- Underlying canceller polled at every operation- Returns:
- A
ProgressObserver
which wont enforce API contracts and propagates cancellinkg
-
ProgressObserver
andCancelObserver
instead.