Skip to content

Commit 1789c86

Browse files
vaadin-botLegioth
andauthored
feat: Clarify SignalEnvironment details (#22116) (#22119)
* Make overridable methods protected * Clarify fallback implementation name Co-authored-by: Leif Åstrand <leif@vaadin.com>
1 parent 7f3de97 commit 1789c86

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

signals/src/main/java/com/vaadin/signals/SignalEnvironment.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public abstract class SignalEnvironment {
3434

3535
private static final Executor IMMEDIATE_EXECUTOR = Runnable::run;
3636

37-
private static final Executor DEFAULT_EFFECT_DISPATCHER = task -> {
37+
private static final Executor EFFECT_DISPATCHER_FALLBACK = task -> {
3838
resolve(SignalEnvironment::getFallbackEffectDispatcher,
3939
IMMEDIATE_EXECUTOR).execute(task);
4040
};
@@ -46,7 +46,7 @@ public abstract class SignalEnvironment {
4646
* @return <code>true</code> if this environment is active,
4747
* <code>false</code> if it's inactive
4848
*/
49-
public abstract boolean isActive();
49+
protected abstract boolean isActive();
5050

5151
/**
5252
* Gets an executor to use for asynchronously notifying about operation
@@ -62,7 +62,7 @@ public abstract class SignalEnvironment {
6262
* @return an executor to use for notifying about operation results, or
6363
* <code>null</code> to notify about results immediately
6464
*/
65-
public abstract Executor getResultNotifier();
65+
protected abstract Executor getResultNotifier();
6666

6767
/**
6868
* Gets an executor to use for running the callback of an effect. This
@@ -82,7 +82,7 @@ public abstract class SignalEnvironment {
8282
* @return an executor to use for invoking effect callbacks, or
8383
* <code>null</code> to use the fallback dispatcher
8484
*/
85-
public abstract Executor getEffectDispatcher();
85+
protected abstract Executor getEffectDispatcher();
8686

8787
/**
8888
* Gets an executor to use for running the callback of an effect that
@@ -98,7 +98,7 @@ public abstract class SignalEnvironment {
9898
* their own dispatcher, or <code>null</code> to invoke the
9999
* callbacks immediately
100100
*/
101-
public abstract Executor getFallbackEffectDispatcher();
101+
protected abstract Executor getFallbackEffectDispatcher();
102102

103103
/**
104104
* Registers a signal environment to consider when processing signal
@@ -151,6 +151,6 @@ public static Executor getCurrentResultNotifier() {
151151
*/
152152
public static Executor getCurrentEffectDispatcher() {
153153
return resolve(SignalEnvironment::getEffectDispatcher,
154-
DEFAULT_EFFECT_DISPATCHER);
154+
EFFECT_DISPATCHER_FALLBACK);
155155
}
156156
}

0 commit comments

Comments
 (0)