Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@
<version>3.5.2</version>
<configuration>
<argLine>--enable-native-access=ALL-UNNAMED</argLine>
<!--
One JVM per test class. Shutting down a context that was configured with an availability callback leaves PRISM unable to create backends afterwards, which crashes any later test in the same process. Forking per class keeps the availability tests from poisoning the rest.
-->
<reuseForks>false</reuseForks>
</configuration>
</plugin>
</plugins>
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/org/mcaccess/prism/AvailabilityListener.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package org.mcaccess.prism;

/**
* Listener invoked when a backend's availability changes at runtime.
* Notified when a backend's runtime availability changes.
* A call is a notification that the application's cached choice of backend may be stale. It does not change any backend instance the application already holds
*/
@FunctionalInterface
public interface AvailabilityListener {
/**
* Called when a backend availability status changes.
*
* @param backend the backend ID (or {@link BackendId#INVALID} if custom/unknown)
* @param name the backend name
* @param available {@code true} if the backend is currently available, {@code false} otherwise
* @param backend The identifier of the backend whose availability changed.
* @param name The backend name, for example "SAPI", "NVDA" or "OneCore".
* @param available True if the backend became available, false if it became unavailable.
*/
void onAvailabilityChanged(BackendId backend, String name, boolean available);
}
Loading