diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index b90db4c..6842c04 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -36,15 +36,36 @@ jobs: distribution: 'temurin' java-version: '19' - - name: Compiling java + - name: Building jector run: ./gradlew --console="verbose" -Pversion=${GITHUB_REF_NAME} :jector:build - - name: Archive build + - name: Building jector-monkey + run: ./gradlew --console="verbose" -Pversion=${GITHUB_REF_NAME} :jector-monkey:build + + - name: Generate jector sources jar + run: ./gradlew -Pversion=$GITHUB_REF_NAME :jector:generateSourcesJar + + - name: Generate jector-monkey sources jar + run: ./gradlew -Pversion=$GITHUB_REF_NAME :jector-monkey:generateSourcesJar + + - name: Generate jector javadoc jar + run: ./gradlew -Pversion=$GITHUB_REF_NAME :jector:generateJavadocJar + + - name: Generate jector-monkey javadoc jar + run: ./gradlew -Pversion=$GITHUB_REF_NAME :jector-monkey:generateJavadocJar + + - name: Archive jector uses: actions/upload-artifact@v3 with: name: jector-build path: jector/build/libs + - name: Archive jector-monkey + uses: actions/upload-artifact@v3 + with: + name: jector-monkey-build + path: jector-monkey/build/libs + deploy: environment: name: maven-central @@ -87,18 +108,18 @@ jobs: - name: Send public key 'avrsandbox' # sends the public key to a maven compatible host run: gpg --keyserver keyserver.ubuntu.com --send-keys 85A57D4975B6EE2B6D0EA46903DE10B9F12F0B20 - - - name: Generate sources jar - run: ./gradlew -Pversion=$GITHUB_REF_NAME :jector:generateSourcesJar - - - name: Generate javadoc jar - run: ./gradlew -Pversion=$GITHUB_REF_NAME :jector:generateJavadocJar - - name: Download build + - name: Download jector build uses: actions/download-artifact@v3 with: name: jector-build path: jector/build/libs/ + + - name: Download jector-monkey build + uses: actions/download-artifact@v3 + with: + name: jector-monkey-build + path: jector-monkey/build/libs/ - name: Deploying jector binaries env: diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 749af9e..81921e7 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -33,10 +33,13 @@ jobs: distribution: 'temurin' java-version: '19' - - name: Compiling java + - name: Compiling jector run: ./gradlew --console="verbose" :jector:build - - name: Archive build + - name: Compiling jector-monkey + run: ./gradlew --console="verbose" :jector-monkey:build + + - name: Archive jector uses: actions/upload-artifact@v3 with: name: jector-snapshot @@ -61,9 +64,12 @@ jobs: distribution: 'temurin' java-version: '19' - - name: Generate javadoc + - name: Generate javadoc for jector run: chmod +rwx ./gradlew && ./gradlew :jector:generateJavadocJar + - name: Generate javadoc for jector-monkey + run: chmod +rwx ./gradlew && ./gradlew :jector-monkey:generateJavadocJar + test: # runner images with architectures (variants) runs-on: ${{ matrix.os }} diff --git a/helper-scripts/project-impl/publishing/sonatype-publish-artifacts.sh b/helper-scripts/project-impl/publishing/sonatype-publish-artifacts.sh index c773e95..b9c904b 100755 --- a/helper-scripts/project-impl/publishing/sonatype-publish-artifacts.sh +++ b/helper-scripts/project-impl/publishing/sonatype-publish-artifacts.sh @@ -5,13 +5,17 @@ source "./helper-scripts/project-impl/variables.sh" # obtain dependencies in the form 'groupId:artifact:version' version=${1} -desktop_artifact="${build_dir}/${desktop_artifactId_release}-${version}.jar" -sources_jar="${build_dir}/${desktop_artifactId_release}-${version}-sources.jar" -javadoc_jar="${build_dir}/${desktop_artifactId_release}-${version}-javadoc.jar" +lib_artifact="${lib_build_dir}/${lib_artifactId_release}-${version}.jar" +lib_sources_jar="${lib_build_dir}/${lib_artifactId_release}-${version}-sources.jar" +lib_javadoc_jar="${lib_build_dir}/${lib_artifactId_release}-${version}-javadoc.jar" + +ext_artifact="${ext_build_dir}/${ext_artifactId_release}-${version}.jar" +ext_sources_jar="${ext_build_dir}/${ext_artifactId_release}-${version}-sources.jar" +ext_javadoc_jar="${ext_build_dir}/${ext_artifactId_release}-${version}-javadoc.jar" generateGenericPom "${groupId}" \ - "${desktop_artifactId_release}" \ + "${lib_artifactId_release}" \ "${version}" \ "The Jector Framework" \ "A Dependency Injection framework designed for JVM and Android applications with an Open-Ended API and Submit-Callback features." \ @@ -23,7 +27,23 @@ generateGenericPom "${groupId}" \ "The AvrSandbox" \ "https://github.com/Software-Hardware-Codesign" \ "scm:git:git://github.com/Software-Hardware-Codesign/Jector.git" \ - "${desktop_pomFile}" + "${lib_pomFile}" + +generateGenericPom "${groupId}" \ + "${ext_artifactId_release}" \ + "${version}" \ + "The JectorMonkey API" \ + "A Specialized implementation of the Jector Framework for jMonkeyEngine." \ + "https://github.com/Software-Hardware-Codesign/Jector" \ + "The AvrSandbox Project, Jector Framework, BSD-3 Clause License" \ + "https://github.com/Software-Hardware-Codesign/Jector/blob/master/LICENSE" \ + "Pavly Gerges (aka. pavl_g)" \ + "pepogerges33@gmail.com" \ + "The AvrSandbox" \ + "https://github.com/Software-Hardware-Codesign" \ + "scm:git:git://github.com/Software-Hardware-Codesign/Jector.git" \ + "${ext_pomFile}" # publish 'android' and 'desktop' builds to maven sonatype -publishBuild "${desktop_artifactId_release}" "${desktop_artifact}" "${version}" "${javadoc_jar}" "${sources_jar}" "${desktop_pomFile}" \ No newline at end of file +publishBuild "${lib_artifactId_release}" "${lib_artifact}" "${version}" "${lib_javadoc_jar}" "${lib_sources_jar}" "${lib_pomFile}" +publishBuild "${ext_artifactId_release}" "${ext_artifact}" "${version}" "${ext_javadoc_jar}" "${ext_sources_jar}" "${ext_pomFile}" \ No newline at end of file diff --git a/helper-scripts/project-impl/variables.sh b/helper-scripts/project-impl/variables.sh index 5631343..4f9cc1f 100644 --- a/helper-scripts/project-impl/variables.sh +++ b/helper-scripts/project-impl/variables.sh @@ -7,13 +7,18 @@ repository="ossrh" groupId="io.github.software-hardware-codesign" maven_version="3.9.3" maven_bin="./apache-maven-$maven_version/bin/mvn" -desktop_pomFile="./helper-scripts/project-impl/publishing/jector.pom" + +lib_pomFile="./helper-scripts/project-impl/publishing/jector.pom" +ext_pomFile="./helper-scripts/project-impl/publishing/jector.pom" + passphrase="avrsandbox" -desktop_artifactId_release="jector" +lib_artifactId_release="jector" +ext_artifactId_release="jector-monkey" -desktop_artifactId_debug="jector-debug" +artifactId_debug="jector-debug" settings="./helper-scripts/project-impl/publishing/maven-settings.xml" build_dir="./jector/build/libs" +ext_build_dir="./jector-monkey/build/libs" # --------------------- diff --git a/jector-examples/bin/main/com/avrsandbox/jector/examples/monkey/TaskExecutorService.class b/jector-examples/bin/main/com/avrsandbox/jector/examples/monkey/TaskExecutorService.class deleted file mode 100644 index 5921c2e..0000000 Binary files a/jector-examples/bin/main/com/avrsandbox/jector/examples/monkey/TaskExecutorService.class and /dev/null differ diff --git a/jector-examples/bin/main/com/avrsandbox/jector/examples/monkey/TestMonkeyTaskBinder$AssetLoaderThread.class b/jector-examples/bin/main/com/avrsandbox/jector/examples/monkey/TestMonkeyTaskBinder$AssetLoaderThread.class deleted file mode 100644 index bce8fce..0000000 Binary files a/jector-examples/bin/main/com/avrsandbox/jector/examples/monkey/TestMonkeyTaskBinder$AssetLoaderThread.class and /dev/null differ diff --git a/jector-examples/bin/main/com/avrsandbox/jector/examples/monkey/TestMonkeyTaskBinder.class b/jector-examples/bin/main/com/avrsandbox/jector/examples/monkey/TestMonkeyTaskBinder.class deleted file mode 100644 index b11a141..0000000 Binary files a/jector-examples/bin/main/com/avrsandbox/jector/examples/monkey/TestMonkeyTaskBinder.class and /dev/null differ diff --git a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/package-info.java b/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/package-info.java deleted file mode 100644 index 6523a7d..0000000 --- a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/package-info.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * BSD 3-Clause License - * - * Copyright (c) 2023, The AvrSandbox Project, Jector Framework - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * Provides a specialized implementation of the jector framework for jMonkeyEngine. - */ -package com.avrsandbox.jector.monkey.core; \ No newline at end of file diff --git a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/MonkeyTaskExecutor.java b/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/MonkeyTaskExecutor.java deleted file mode 100644 index ac093ea..0000000 --- a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/MonkeyTaskExecutor.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * BSD 3-Clause License - * - * Copyright (c) 2023, The AvrSandbox Project, Jector Framework - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.avrsandbox.jector.monkey.core.work; - -import com.avrsandbox.jector.core.work.TaskExecutor; -import com.avrsandbox.jector.core.work.WorkerTask; -import com.jme3.app.Application; -import com.jme3.app.state.BaseAppState; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -/** - * A base implementation of the jector {@link TaskExecutor}s to a jMonkeyEngine app state. - * - * @author pavl_g - */ -public class MonkeyTaskExecutor extends BaseAppState implements TaskExecutor { - - /** - * Tasks wrapping the methods to be bound to their specified annotated methods. - */ - protected final Map tasks = new HashMap<>(); - - /** - * A flag to order the executor for termination. - */ - protected volatile boolean terminate; - - /** - * A flag to order the executor to start running. - */ - protected volatile boolean active = false; - - /** - * Provides a universal tpf attribute for the associated tasks. - */ - protected float timePerFrame; - - /** - * Provides an interface to command-state the initialization. - */ - protected OnExecutorInitialized onInitialized; - - /** - * Instantiates a new instance of a task executor specialized to run on the JME thread only. - * - * @param id the associated state id - */ - public MonkeyTaskExecutor(String id) { - super(id); - } - - /** - * Retrieves the application time-per-frame in seconds. - * - * @return the JME app tpf in seconds - */ - public float getTimePerFrame() { - return timePerFrame; - } - - /** - * Adjusts the initialization listener instance. - * - * @param onInitialized the initializer instance - */ - public void setOnInitialized(OnExecutorInitialized onInitialized) { - this.onInitialized = onInitialized; - } - - @Override - protected void initialize(Application app) { - if (onInitialized != null) { - onInitialized.onInitialized(app); - } - } - - @Override - protected void cleanup(Application app) { - - } - - @Override - protected void onEnable() { - - } - - @Override - protected void onDisable() { - - } - - @Override - public void update(float tpf) { - this.timePerFrame = tpf; - /* 2) Run Worker Method tasks */ - executeTasks(tpf); - } - - @Override - public boolean isActive() { - return isEnabled(); - } - - @Override - public void setActive(boolean active) { - setEnabled(active); - } - - @Override - public void addTask(Method method, WorkerTask task) { - tasks.put(method.getName(), task); - } - - @Override - public void executeTasks(Object arguments) { - try { - for (String task : tasks.keySet()) { - if (!tasks.get(task).isActive()) { - continue; - } - if (!(tasks.get(task) instanceof MonkeyWorkerTask)) { - throw new IllegalArgumentException("WorkerTasks must be of type: " + MonkeyWorkerTask.class.getName()); - } - MonkeyWorkerTask monkeyTask = (MonkeyWorkerTask) tasks.get(task); - /* Invokes and Saves the result of the execution order! */ - monkeyTask.setTimePerFrame((float) arguments); - monkeyTask.setResult(monkeyTask.call()); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public Map getTasks() { - return tasks; - } - - @Override - public void terminate() { - getStateManager().detach(this); - this.terminate = true; - } - - @Override - public boolean isTerminated() { - return terminate; - } -} diff --git a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/MonkeyTaskExecutorsManager.java b/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/MonkeyTaskExecutorsManager.java deleted file mode 100644 index 0b56f8a..0000000 --- a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/MonkeyTaskExecutorsManager.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * BSD 3-Clause License - * - * Copyright (c) 2023, The AvrSandbox Project, Jector Framework - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.avrsandbox.jector.monkey.core.work; - -import com.avrsandbox.jector.core.command.MethodArguments; -import com.avrsandbox.jector.core.work.TaskExecutorsManager; -import com.avrsandbox.jector.core.work.Worker; -import com.avrsandbox.jector.core.work.*; -import java.lang.reflect.Method; - -/** - * A JME-thread-safe specialized implementation of the {@link TaskExecutorsManager} for jMonkeyEngine. - * - * @author pavl_g - */ -public class MonkeyTaskExecutorsManager extends TaskExecutorsManager { - - /** - * Instantiates a JME task binder with a single worker instance. - * - * @param worker the worker instance holding the worker methods to be executed - */ - public MonkeyTaskExecutorsManager(Worker worker) { - super(worker); - } - - /** - * Instantiates a JME task binder with multiple worker instances. - * - * @param workers an array of worker instances - */ - public MonkeyTaskExecutorsManager(Worker[] workers) { - super(workers); - } - - @Override - public void bind(MethodArguments methodArguments) { - if (!Thread.currentThread().getName().equals("jME3 Main")) { - throw new IllegalStateException("Cannot bind on a non-application thread!"); - } - super.bind(methodArguments); - } - - @Override - protected void bind(TaskExecutor taskExecutor, Worker worker, Method method, - MethodArguments args) { - /* binds the method invocation to the specified executor object */ - taskExecutor.addTask(method, new MonkeyWorkerTask() { - @Override - public Object call() { - /* The Triple Check Pattern (No. of parameters - Input args - Types compatibility) */ - if (method.getParameters() != null) { - return executeMethod(worker, method, args, MonkeyTaskExecutorsManager.this); - } else { - /* Force null args for non-parameterized methods */ - return executeMethod(worker, method, null, MonkeyTaskExecutorsManager.this); - } - } - }); - } -} diff --git a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/MonkeyWorkerTask.java b/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/MonkeyWorkerTask.java deleted file mode 100644 index 3f14be3..0000000 --- a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/MonkeyWorkerTask.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * BSD 3-Clause License - * - * Copyright (c) 2023, The AvrSandbox Project, Jector Framework - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.avrsandbox.jector.monkey.core.work; - -import com.avrsandbox.jector.core.work.WorkerTask; - -/** - * A specialized implementation of the jector WorkerTask for jMonkeyEngine - * supporting time-per-frame monitoring. - * - * @author pavl_g - */ -public abstract class MonkeyWorkerTask extends WorkerTask { - - /** - * Value for time per frame in seconds, this value - * is internally synchronized with the JME update thread. - */ - protected float timePerFrame; - - /** - * Updates the time-per-frame value (in seconds). - * - * @param timePerFrame the new value (in seconds) - */ - public void setTimePerFrame(float timePerFrame) { - this.timePerFrame = timePerFrame; - } - - /** - * Retrieves the time-per-frame value (in seconds). - * - * @return the time-per-frame value (in seconds) - */ - public float getTimePerFrame() { - return timePerFrame; - } -} diff --git a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/OnExecutorInitialized.java b/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/OnExecutorInitialized.java deleted file mode 100644 index 9baf85e..0000000 --- a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/core/work/OnExecutorInitialized.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * BSD 3-Clause License - * - * Copyright (c) 2023, The AvrSandbox Project, Jector Framework - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.avrsandbox.jector.monkey.core.work; - -import com.jme3.app.Application; - -/** - * Commands and executes a listener when the {@link MonkeyTaskExecutor} - * is initialized. - * - * @author pavl_g - */ -public interface OnExecutorInitialized { - - /** - * Dispatched when this executor is initialized. - * - * @param application the JME application instance - */ - void onInitialized(Application application); -} diff --git a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/util/MonkeyTasks.java b/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/util/MonkeyTasks.java deleted file mode 100644 index 9b1bde4..0000000 --- a/jector-monkey/src/main/java/com/avrsandbox/jector/monkey/util/MonkeyTasks.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * BSD 3-Clause License - * - * Copyright (c) 2023, The AvrSandbox Project, Jector Framework - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.avrsandbox.jector.monkey.util; - -import com.avrsandbox.jector.core.work.TaskExecutorsManager; -import com.avrsandbox.jector.monkey.core.work.MonkeyTaskExecutorsManager; -import com.avrsandbox.jector.monkey.core.work.MonkeyTaskExecutor; -import com.avrsandbox.jector.monkey.core.work.MonkeyWorkerTask; -import com.avrsandbox.jector.util.Tasks; -import com.jme3.app.SimpleApplication; - -/** - * An extension utility providing a specialization for the {@link Tasks} utility to be - * utilized within a jMonkeyEngine application. - * - * @author pavl_g - */ -public final class MonkeyTasks { - - private MonkeyTasks() { - } - - /** - * Retrieves the JME task executor by its class-name. - * - * @param taskExecutorsManager the manager holding the registered executors - * @param clazz the class-instance of the task executor to retrieve - * @return the matching JME task executor - */ - public static MonkeyTaskExecutor getTaskExecutor(TaskExecutorsManager taskExecutorsManager, - Class clazz) { - return ((MonkeyTaskExecutor) Tasks - .getTaskExecutorFromTaskBinder(taskExecutorsManager, clazz)); - } - - /** - * Retrieves a JME worker task from its task executor by its name, the name of the - * worker task is the same as its corresponding annotated worker method. - * - * @param taskExecutorsManager the manager holding the registered executors - * @param clazz the class-instance of the task executor holding the target worker task - * @param name the worker task name, and it's the same as its counterpart method name - * @return a reference to the JME worker task defined by the "name" - */ - public static MonkeyWorkerTask getWorkerTask(TaskExecutorsManager taskExecutorsManager, - Class clazz, - String name) { - return ((MonkeyWorkerTask) Tasks.getWorkerTask(taskExecutorsManager, clazz, name)); - } - - /** - * Retrieves the JME application instance, the app instance could by fetched from any JME - * task executor. - * - * @param taskExecutorsManager the manager holding the registered executors - * @param clazz the class-instance of any registered JME task executor - * @return a reference to the application instance - */ - public static SimpleApplication getApplication(TaskExecutorsManager taskExecutorsManager, - Class clazz) { - if (!(taskExecutorsManager instanceof MonkeyTaskExecutorsManager)) { - throw new IllegalArgumentException("Cannot retrieve a JME App Instance from non-application executors!"); - } - return (SimpleApplication) MonkeyTasks.getTaskExecutor(taskExecutorsManager, clazz).getApplication(); - } - - /** - * Retrieves the application time-per-frame as monitored by a registered - * JME task executor. - * - * @param taskExecutorsManager the manager holding the registered executors - * @param clazz the class-instance of any registered JME task executor - * @return a reference to the application tpf value - */ - public static float getApplicationTimePerFrame(TaskExecutorsManager taskExecutorsManager, - Class clazz) { - return MonkeyTasks.getTaskExecutor(taskExecutorsManager, clazz).getTimePerFrame(); - } - - /** - * Retrieves the application time-per-frame as monitored by a JME - * worker task. - * - * @param taskExecutorsManager the manager holding the registered executors - * @param clazz the class-instance of any registered JME task executor - * @param name the name of the JME worker task to retrieve its tpf value - * @return the value of the tpf as monitored by the specified JME worker task - */ - public static float getWorkerTaskTimePerFrame(TaskExecutorsManager taskExecutorsManager, - Class clazz, - String name) { - return MonkeyTasks.getWorkerTask(taskExecutorsManager, clazz, name).getTimePerFrame(); - } -} \ No newline at end of file diff --git a/jector/bin/main/com/avrsandbox/jector/core/command/ExecuteOn.class b/jector/bin/main/com/avrsandbox/jector/core/command/ExecuteOn.class deleted file mode 100644 index 04f280c..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/command/ExecuteOn.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/command/MethodArguments.class b/jector/bin/main/com/avrsandbox/jector/core/command/MethodArguments.class deleted file mode 100644 index ed27640..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/command/MethodArguments.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/command/package-info.class b/jector/bin/main/com/avrsandbox/jector/core/command/package-info.class deleted file mode 100644 index 748c714..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/command/package-info.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/package-info.class b/jector/bin/main/com/avrsandbox/jector/core/package-info.class deleted file mode 100644 index d6c7720..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/package-info.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/thread/AppThread.class b/jector/bin/main/com/avrsandbox/jector/core/thread/AppThread.class deleted file mode 100644 index b8485e0..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/thread/AppThread.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/thread/concurrency/ConcurrentAppThread.class b/jector/bin/main/com/avrsandbox/jector/core/thread/concurrency/ConcurrentAppThread.class deleted file mode 100644 index 06ae282..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/thread/concurrency/ConcurrentAppThread.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/thread/concurrency/package-info.class b/jector/bin/main/com/avrsandbox/jector/core/thread/concurrency/package-info.class deleted file mode 100644 index d884d37..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/thread/concurrency/package-info.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/thread/package-info.class b/jector/bin/main/com/avrsandbox/jector/core/thread/package-info.class deleted file mode 100644 index 192a71d..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/thread/package-info.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/work/TaskBinder$1.class b/jector/bin/main/com/avrsandbox/jector/core/work/TaskBinder$1.class deleted file mode 100644 index 008d6c8..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/work/TaskBinder$1.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/work/TaskBinder.class b/jector/bin/main/com/avrsandbox/jector/core/work/TaskBinder.class deleted file mode 100644 index d4bd7f1..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/work/TaskBinder.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/work/TaskExecutor.class b/jector/bin/main/com/avrsandbox/jector/core/work/TaskExecutor.class deleted file mode 100644 index ed21d9d..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/work/TaskExecutor.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/work/Worker.class b/jector/bin/main/com/avrsandbox/jector/core/work/Worker.class deleted file mode 100644 index 8e2a687..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/work/Worker.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/work/WorkerTask.class b/jector/bin/main/com/avrsandbox/jector/core/work/WorkerTask.class deleted file mode 100644 index 0514eae..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/work/WorkerTask.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/core/work/package-info.class b/jector/bin/main/com/avrsandbox/jector/core/work/package-info.class deleted file mode 100644 index 066a64f..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/core/work/package-info.class and /dev/null differ diff --git a/jector/bin/main/com/avrsandbox/jector/util/Validator.class b/jector/bin/main/com/avrsandbox/jector/util/Validator.class deleted file mode 100644 index cad0c41..0000000 Binary files a/jector/bin/main/com/avrsandbox/jector/util/Validator.class and /dev/null differ