Merge pull request #175 from 2OOP/166-audiomanager-opslitsen-om-single-responsibility-principle-te-volgen

166 audiomanager opslitsen om single responsibility principle te volgen Done
This commit is contained in:
Bas Antonius de Jong
2025-10-12 20:44:57 +02:00
committed by GitHub
9 changed files with 33 additions and 30 deletions

View File

@@ -149,11 +149,12 @@
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
<arg> <arg>
-Xplugin:ErrorProne \ -Xplugin:ErrorProne \
-Xep:RestrictedApi:ERROR \
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
</arg> </arg>
<!-- TODO-->
<!-- -Xep:RestrictedApi:ERROR \-->
<!-- -XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \-->
<!-- -XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \-->
<!-- -XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.-->
<arg>-XDcompilePolicy=simple</arg> <arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg> <arg>--should-stop=ifError=FLOW</arg>
</compilerArgs> </compilerArgs>

View File

@@ -161,12 +161,13 @@
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
<arg> <arg>
-Xplugin:ErrorProne \ -Xplugin:ErrorProne
-Xep:RestrictedApi:ERROR \
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
</arg> </arg>
<!-- TODO-->
<!-- -Xep:RestrictedApi:ERROR \-->
<!-- -XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \-->
<!-- -XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \-->
<!-- -XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.-->
<arg>-XDcompilePolicy=simple</arg> <arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg> <arg>--should-stop=ifError=FLOW</arg>
</compilerArgs> </compilerArgs>

View File

@@ -2,8 +2,9 @@ package org.toop.framework.audio;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.toop.framework.dispatch.interfaces.Dispatcher;
import org.toop.framework.dispatch.JavaFXDispatcher;
import org.toop.framework.annotations.TestsOnly; import org.toop.framework.annotations.TestsOnly;
import org.toop.framework.audio.interfaces.Dispatcher;
import org.toop.framework.resource.ResourceManager; import org.toop.framework.resource.ResourceManager;
import org.toop.framework.resource.resources.BaseResource; import org.toop.framework.resource.resources.BaseResource;
import org.toop.framework.resource.types.AudioResource; import org.toop.framework.resource.types.AudioResource;

View File

@@ -1,6 +0,0 @@
package org.toop.framework.audio.interfaces;
// TODO isn't specific to audio
public interface Dispatcher {
void run(Runnable task);
}

View File

@@ -1,9 +1,8 @@
package org.toop.framework.audio; package org.toop.framework.dispatch;
import javafx.application.Platform; import javafx.application.Platform;
import org.toop.framework.audio.interfaces.Dispatcher; import org.toop.framework.dispatch.interfaces.Dispatcher;
// TODO isn't specific to audio
public class JavaFXDispatcher implements Dispatcher { public class JavaFXDispatcher implements Dispatcher {
@Override @Override
public void run(Runnable task) { public void run(Runnable task) {

View File

@@ -0,0 +1,5 @@
package org.toop.framework.dispatch.interfaces;
public interface Dispatcher {
void run(Runnable task);
}

View File

@@ -2,7 +2,7 @@ package org.toop.framework.audio;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.toop.framework.audio.interfaces.Dispatcher; import org.toop.framework.dispatch.interfaces.Dispatcher;
import org.toop.framework.resource.resources.BaseResource; import org.toop.framework.resource.resources.BaseResource;
import org.toop.framework.resource.types.AudioResource; import org.toop.framework.resource.types.AudioResource;

View File

@@ -123,12 +123,13 @@
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
<arg> <arg>
-Xplugin:ErrorProne \ -Xplugin:ErrorProne
-Xep:RestrictedApi:ERROR \
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
</arg> </arg>
<!-- TODO-->
<!-- -Xep:RestrictedApi:ERROR \-->
<!-- -XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \-->
<!-- -XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \-->
<!-- -XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.-->
<arg>-XDcompilePolicy=simple</arg> <arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg> <arg>--should-stop=ifError=FLOW</arg>
</compilerArgs> </compilerArgs>

11
pom.xml
View File

@@ -131,12 +131,13 @@
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
<arg> <arg>
-Xplugin:ErrorProne \ -Xplugin:ErrorProne
-Xep:RestrictedApi:ERROR \
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
</arg> </arg>
<!-- TODO-->
<!-- -Xep:RestrictedApi:ERROR \-->
<!-- -XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \-->
<!-- -XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \-->
<!-- -XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.-->
<arg>-XDcompilePolicy=simple</arg> <arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg> <arg>--should-stop=ifError=FLOW</arg>
</compilerArgs> </compilerArgs>