From 1687ca32f3f68669d0277a067858da52f8fe206d Mon Sep 17 00:00:00 2001 From: Paldiu Date: Wed, 14 Dec 2022 12:57:45 -0600 Subject: [PATCH] Finalization --- docs/allclasses-index.html | 35 +- docs/allpackages-index.html | 3 +- docs/constant-values.html | 80 +++ docs/deprecated-list.html | 75 +++ docs/help-doc.html | 13 +- docs/index-files/index-1.html | 7 +- docs/index-files/index-10.html | 7 +- docs/index-files/index-11.html | 19 +- docs/index-files/index-12.html | 13 +- docs/index-files/index-13.html | 7 +- docs/index-files/index-14.html | 33 +- docs/index-files/index-15.html | 13 +- docs/index-files/index-16.html | 25 +- docs/index-files/index-17.html | 79 ++- docs/index-files/index-18.html | 11 +- docs/index-files/index-2.html | 7 +- docs/index-files/index-3.html | 21 +- docs/index-files/index-4.html | 23 +- docs/index-files/index-5.html | 25 +- docs/index-files/index-6.html | 7 +- docs/index-files/index-7.html | 31 +- docs/index-files/index-8.html | 11 +- docs/index-files/index-9.html | 27 +- docs/index.html | 3 +- .../github/simplex/api/ExecutableService.html | 2 +- .../simplex/api/InvalidServiceException.html | 4 +- .../api/InvalidServicePoolException.html | 4 +- docs/io/github/simplex/impl/ServiceImpl.html | 4 +- .../simplexdevelopment/api/Context.html | 27 +- .../api/ExecutableService.html | 2 +- .../simplexdevelopment/api/ISchedule.html | 19 +- .../simplexdevelopment/api/IService.html | 87 +-- .../simplexdevelopment/api/Identifier.html | 165 ++++++ .../api/InvalidServiceException.html | 4 +- .../api/InvalidServicePoolException.html | 4 +- .../api/ServiceException.html | 205 +++++++ .../api/ServicePoolException.html | 215 +++++++ .../api/package-summary.html | 17 +- .../simplexdevelopment/api/package-tree.html | 15 +- .../github/simplexdevelopment/impl/Main.html | 26 +- .../simplexdevelopment/impl/PoolHolder.html | 245 ++++++++ .../simplexdevelopment/impl/ServiceImpl.html | 57 +- .../impl/package-summary.html | 7 +- .../simplexdevelopment/impl/package-tree.html | 6 +- .../scheduler/BukkitDisposable.html | 3 +- .../scheduler/ExecutableService.html | 550 ++++++++++++++++++ .../scheduler/ReactorBukkitScheduler.html | 171 ++---- .../scheduler/SchedulingSystem.html | 85 +-- .../scheduler/ServiceManager.html | 26 +- .../scheduler/ServicePool.html | 74 +-- .../scheduler/package-summary.html | 17 +- .../scheduler/package-tree.html | 6 +- docs/member-search-index.js | 2 +- docs/overview-summary.html | 2 +- docs/overview-tree.html | 19 +- docs/serialized-form.html | 15 +- docs/tag-search-index.js | 2 +- docs/type-search-index.js | 2 +- .../simplexdevelopment/api/Context.java | 13 +- .../simplexdevelopment/api/ISchedule.java | 12 +- .../simplexdevelopment/api/IService.java | 38 +- .../simplexdevelopment/api/Identifier.java | 26 + .../api/InvalidServiceException.java | 17 - .../api/InvalidServicePoolException.java | 25 - .../api/ServiceException.java | 29 + .../api/ServicePoolException.java | 38 ++ .../github/simplexdevelopment/impl/Main.java | 36 +- .../simplexdevelopment/impl/PoolHolder.java | 36 ++ .../simplexdevelopment/impl/ServiceImpl.java | 15 +- .../{api => scheduler}/ExecutableService.java | 95 ++- .../scheduler/ReactorBukkitScheduler.java | 5 +- .../scheduler/SchedulingSystem.java | 52 +- .../scheduler/ServiceManager.java | 10 +- .../scheduler/ServicePool.java | 21 +- 74 files changed, 2382 insertions(+), 750 deletions(-) create mode 100644 docs/constant-values.html create mode 100644 docs/deprecated-list.html create mode 100644 docs/io/github/simplexdevelopment/api/Identifier.html create mode 100644 docs/io/github/simplexdevelopment/api/ServiceException.html create mode 100644 docs/io/github/simplexdevelopment/api/ServicePoolException.html create mode 100644 docs/io/github/simplexdevelopment/impl/PoolHolder.html create mode 100644 docs/io/github/simplexdevelopment/scheduler/ExecutableService.html create mode 100644 src/main/java/io/github/simplexdevelopment/api/Identifier.java delete mode 100644 src/main/java/io/github/simplexdevelopment/api/InvalidServiceException.java delete mode 100644 src/main/java/io/github/simplexdevelopment/api/InvalidServicePoolException.java create mode 100644 src/main/java/io/github/simplexdevelopment/api/ServiceException.java create mode 100644 src/main/java/io/github/simplexdevelopment/api/ServicePoolException.java create mode 100644 src/main/java/io/github/simplexdevelopment/impl/PoolHolder.java rename src/main/java/io/github/simplexdevelopment/{api => scheduler}/ExecutableService.java (74%) diff --git a/docs/allclasses-index.html b/docs/allclasses-index.html index f487b71..26eb5ea 100644 --- a/docs/allclasses-index.html +++ b/docs/allclasses-index.html @@ -1,7 +1,7 @@ - + All Classes and Interfaces @@ -36,6 +36,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • @@ -64,28 +65,32 @@ loadScripts(document, 'script');
     
    Context<S>
     
    -
    ExecutableService
    +
    ExecutableService
     
    -
    InvalidServiceException
    -
     
    -
    InvalidServicePoolException
    -
     
    -
    ISchedule
    +
    Identifier
     
    -
    IService
    +
    ISchedule
     
    -
    Main
    +
    IService
    +
     
    +
    Main
    +
     
    +
    PoolHolder
     
    -
    ReactorBukkitScheduler
    -
     
    +
    ReactorBukkitScheduler
    +
     
    SchedulingSystem<T extends org.bukkit.plugin.java.JavaPlugin>
     
    -
    ServiceImpl
    -
     
    -
    ServiceManager
    +
    ServiceException
    +
     
    +
    ServiceImpl
     
    -
    ServicePool
    +
    ServiceManager
     
    +
    ServicePool
    +
     
    +
    ServicePoolException
    +
     
    diff --git a/docs/allpackages-index.html b/docs/allpackages-index.html index 9001523..e12ab8f 100644 --- a/docs/allpackages-index.html +++ b/docs/allpackages-index.html @@ -1,7 +1,7 @@ - + All Packages @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • diff --git a/docs/constant-values.html b/docs/constant-values.html new file mode 100644 index 0000000..530ecf8 --- /dev/null +++ b/docs/constant-values.html @@ -0,0 +1,80 @@ + + + + +Constant Field Values + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Constant Field Values

    +
    +

    Contents

    + +
    +
    +
    +

    io.github.*

    +
      +
    • +
      io.github.simplexdevelopment.scheduler.ServicePool
      +
      +
      Modifier and Type
      +
      Constant Field
      +
      Value
      +
      private static final String
      + +
      "default_service_pool"
      +
      +
    • +
    +
    +
    +
    +
    + + diff --git a/docs/deprecated-list.html b/docs/deprecated-list.html new file mode 100644 index 0000000..753269a --- /dev/null +++ b/docs/deprecated-list.html @@ -0,0 +1,75 @@ + + + + +Deprecated List + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Deprecated API

    +

    Contents

    + +
    + +
    +
    +
    + + diff --git a/docs/help-doc.html b/docs/help-doc.html index f4d5cc2..6f75c13 100644 --- a/docs/help-doc.html +++ b/docs/help-doc.html @@ -1,7 +1,7 @@ - + API Help @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Index
  • @@ -68,6 +69,8 @@ loadScripts(document, 'script');
  • Class or Interface
  • Other Files
  • Tree (Class Hierarchy)
  • +
  • Deprecated API
  • +
  • Constant Field Values
  • Serialized Form
  • All Packages
  • All Classes and Interfaces
  • @@ -156,6 +159,14 @@ The following sections describe the different kinds of pages in this collection.
  • When viewing a particular package, class or interface page, clicking on TREE displays the hierarchy for only that package.
  • +
    +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to shortcomings, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
    +
    +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +

    Serialized Form

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to those who implement rather than use the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See Also" section of the class description.

    diff --git a/docs/index-files/index-1.html b/docs/index-files/index-1.html index fad2d3a..941e1a4 100644 --- a/docs/index-files/index-1.html +++ b/docs/index-files/index-1.html @@ -1,7 +1,7 @@ - + A-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,7 +51,7 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    A

    addService(IService) - Method in class io.github.simplexdevelopment.scheduler.ServicePool
    @@ -62,7 +63,7 @@ loadScripts(document, 'script');
    A collection of services related to this service pool.
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-10.html b/docs/index-files/index-10.html index dda2bf1..bf5c5b5 100644 --- a/docs/index-files/index-10.html +++ b/docs/index-files/index-10.html @@ -1,7 +1,7 @@ - + L-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,13 +51,13 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    L

    locateServiceWithinPools(IService) - Method in class io.github.simplexdevelopment.scheduler.ServiceManager
     
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-11.html b/docs/index-files/index-11.html index e98f7db..9b55d83 100644 --- a/docs/index-files/index-11.html +++ b/docs/index-files/index-11.html @@ -1,7 +1,7 @@ - + M-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,7 +51,7 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    M

    Main - Class in io.github.simplexdevelopment.impl
    @@ -58,13 +59,17 @@ loadScripts(document, 'script');
    Main() - Constructor for class io.github.simplexdevelopment.impl.Main
     
    mainScheduler - Variable in class io.github.simplexdevelopment.scheduler.SchedulingSystem
    -
     
    -
    mayInterruptWhenRunning - Variable in class io.github.simplexdevelopment.api.ExecutableService
    -
     
    -
    multithreadedServicePool(NamespacedKey, IService...) - Method in class io.github.simplexdevelopment.scheduler.ServiceManager
    +
    +
    The main scheduler which this system runs on.
    +
    +
    mayInterruptWhenRunning - Variable in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
    +
    If the service should be allowed to stop while executing.
    +
    +
    multithreadedServicePool(String, IService...) - Method in class io.github.simplexdevelopment.scheduler.ServiceManager
     
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-12.html b/docs/index-files/index-12.html index 8d949e7..923bd83 100644 --- a/docs/index-files/index-12.html +++ b/docs/index-files/index-12.html @@ -1,7 +1,7 @@ - + N-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,19 +51,15 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    N

    name - Variable in class io.github.simplexdevelopment.scheduler.ServicePool
    -
    The key used to identify this service pool.
    -
    -
    newNamespacedKey(String, String) - Static method in interface io.github.simplexdevelopment.api.IService
    -
    -
    This is an easy static call for creating a new namespaced key for services and service pools.
    +
    The name used to identify this service pool.
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-13.html b/docs/index-files/index-13.html index eaa586b..308673a 100644 --- a/docs/index-files/index-13.html +++ b/docs/index-files/index-13.html @@ -1,7 +1,7 @@ - + O-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,7 +51,7 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    O

    onDisable() - Method in class io.github.simplexdevelopment.impl.Main
    @@ -58,7 +59,7 @@ loadScripts(document, 'script');
    onEnable() - Method in class io.github.simplexdevelopment.impl.Main
     
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-14.html b/docs/index-files/index-14.html index d722184..9ba878a 100644 --- a/docs/index-files/index-14.html +++ b/docs/index-files/index-14.html @@ -1,7 +1,7 @@ - + P-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,29 +51,31 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    P

    -
    parentPool - Variable in class io.github.simplexdevelopment.api.ExecutableService
    -
     
    -
    period - Variable in class io.github.simplexdevelopment.api.ExecutableService
    -
     
    +
    parentPool - Variable in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
    +
    The service's execution thread.
    +
    +
    period - Variable in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
    +
    How long the service should wait between executions.
    +
    plugin - Variable in class io.github.simplexdevelopment.impl.ServiceImpl
     
    -
    plugin - Variable in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    -
    -
    The field for the plugin record component.
    -
    -
    plugin - Variable in class io.github.simplexdevelopment.scheduler.SchedulingSystem
    +
    plugin - Variable in class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
     
    -
    plugin() - Method in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    +
    plugin - Variable in class io.github.simplexdevelopment.scheduler.SchedulingSystem
    -
    Returns the value of the plugin record component.
    +
    The plugin to use for registering tasks.
    -
    pool - Variable in class io.github.simplexdevelopment.impl.Main
    +
    PoolHolder - Class in io.github.simplexdevelopment.impl
    +
     
    +
    PoolHolder(Main) - Constructor for class io.github.simplexdevelopment.impl.PoolHolder
     
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-15.html b/docs/index-files/index-15.html index d72a4a2..2d90b76 100644 --- a/docs/index-files/index-15.html +++ b/docs/index-files/index-15.html @@ -1,7 +1,7 @@ - + Q-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,17 +51,19 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    Q

    -
    queue(IService) - Method in class io.github.simplexdevelopment.scheduler.SchedulingSystem
    -
     
    queue(IService) - Method in interface io.github.simplexdevelopment.api.ISchedule
    +
    +
    Queues a service to be executed in a service pool.
    +
    +
    queue(IService) - Method in class io.github.simplexdevelopment.scheduler.SchedulingSystem
     
    queueService(IService) - Method in class io.github.simplexdevelopment.scheduler.ServicePool
     
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-16.html b/docs/index-files/index-16.html index 115e921..257f24e 100644 --- a/docs/index-files/index-16.html +++ b/docs/index-files/index-16.html @@ -1,7 +1,7 @@ - + R-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,25 +51,23 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    R

    -
    rbScheduler - Variable in class io.github.simplexdevelopment.scheduler.ServicePool
    +
    ReactorBukkitScheduler - Class in io.github.simplexdevelopment.scheduler
     
    -
    ReactorBukkitScheduler - Record Class in io.github.simplexdevelopment.scheduler
    +
    ReactorBukkitScheduler(JavaPlugin) - Constructor for class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
     
    -
    ReactorBukkitScheduler(JavaPlugin, BukkitScheduler) - Constructor for record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    -
    -
    Creates an instance of a ReactorBukkitScheduler record class.
    -
    recycle() - Method in class io.github.simplexdevelopment.scheduler.ServicePool
     
    +
    registerServices(PoolHolder) - Method in class io.github.simplexdevelopment.impl.Main
    +
     
    removeService(IService) - Method in class io.github.simplexdevelopment.scheduler.ServicePool
     
    -
    repeating - Variable in class io.github.simplexdevelopment.api.ExecutableService
    -
     
    -
    repeatingPools - Variable in class io.github.simplexdevelopment.scheduler.SchedulingSystem
    -
     
    +
    repeating - Variable in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
    +
    If the service should be executed once or continuously.
    +
    run() - Method in interface io.github.simplexdevelopment.api.IService
     
    runOnce(IService) - Method in interface io.github.simplexdevelopment.api.ISchedule
    @@ -76,7 +75,7 @@ loadScripts(document, 'script');
    runOnce(IService) - Method in class io.github.simplexdevelopment.scheduler.SchedulingSystem
     
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-17.html b/docs/index-files/index-17.html index 8645024..fdb9d1a 100644 --- a/docs/index-files/index-17.html +++ b/docs/index-files/index-17.html @@ -1,7 +1,7 @@ - + S-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,49 +51,57 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    S

    -
    schedule(Runnable) - Method in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    +
    schedule(Runnable) - Method in class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    Delegates to the BukkitScheduler.
    -
    schedule(Runnable, long, TimeUnit) - Method in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    +
    schedule(Runnable, long, TimeUnit) - Method in class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    Delegates to the BukkitScheduler with a delay.
    -
    schedulePeriodically(Runnable, long, long, TimeUnit) - Method in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    +
    schedulePeriodically(Runnable, long, long, TimeUnit) - Method in class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    Delegates to the BukkitScheduler with a delay and a period.
    scheduler - Variable in class io.github.simplexdevelopment.impl.Main
     
    -
    scheduler - Variable in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    -
    -
    The field for the scheduler record component.
    -
    +
    scheduler - Variable in class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    +
     
    scheduler - Variable in class io.github.simplexdevelopment.scheduler.ServicePool
    The scheduler used to run the services in this pool.
    -
    scheduler() - Method in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    -
    -
    Returns the value of the scheduler record component.
    -
    SchedulingSystem<T extends org.bukkit.plugin.java.JavaPlugin> - Class in io.github.simplexdevelopment.scheduler
     
    SchedulingSystem(T) - Constructor for class io.github.simplexdevelopment.scheduler.SchedulingSystem
    Creates a new instance of the scheduling system.
    -
    service_name - Variable in class io.github.simplexdevelopment.api.ExecutableService
    +
    selectedPool - Variable in class io.github.simplexdevelopment.impl.PoolHolder
    +
     
    +
    service_name - Variable in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
    +
    The name of the service.
    +
    +
    ServiceException - Exception in io.github.simplexdevelopment.api
    +
     
    +
    ServiceException(IService) - Constructor for exception io.github.simplexdevelopment.api.ServiceException
    +
    +
    Constructs a new service exception which states the service is not present within any service pools.
    +
    +
    ServiceException(Throwable) - Constructor for exception io.github.simplexdevelopment.api.ServiceException
     
    ServiceImpl - Class in io.github.simplexdevelopment.impl
     
    -
    ServiceImpl(Main) - Constructor for class io.github.simplexdevelopment.impl.ServiceImpl
    +
    ServiceImpl(Main, ServicePool) - Constructor for class io.github.simplexdevelopment.impl.ServiceImpl
     
    serviceManager - Variable in class io.github.simplexdevelopment.scheduler.SchedulingSystem
    -
     
    +
    +
    The service manager to use for controlling service pools.
    +
    ServiceManager - Class in io.github.simplexdevelopment.scheduler
     
    ServiceManager() - Constructor for class io.github.simplexdevelopment.scheduler.ServiceManager
    @@ -101,22 +110,44 @@ loadScripts(document, 'script');
    ServicePool - Class in io.github.simplexdevelopment.scheduler
     
    -
    ServicePool(NamespacedKey, boolean) - Constructor for class io.github.simplexdevelopment.scheduler.ServicePool
    +
    ServicePool(String, boolean) - Constructor for class io.github.simplexdevelopment.scheduler.ServicePool
    This will create a new instance of a Service Pool with a Scheduler as its main scheduler.
    -
    ServicePool(NamespacedKey, JavaPlugin) - Constructor for class io.github.simplexdevelopment.scheduler.ServicePool
    +
    ServicePool(String, JavaPlugin) - Constructor for class io.github.simplexdevelopment.scheduler.ServicePool
    This will create a new instance of a Service Pool with the ReactorBukkitScheduler as its main scheduler.
    -
    servicePools - Variable in class io.github.simplexdevelopment.scheduler.ServiceManager
    +
    servicePoolCollection - Variable in class io.github.simplexdevelopment.impl.PoolHolder
     
    -
    setCancelled(boolean) - Method in class io.github.simplexdevelopment.api.ExecutableService
    +
    ServicePoolException - Exception in io.github.simplexdevelopment.api
    +
     
    +
    ServicePoolException() - Constructor for exception io.github.simplexdevelopment.api.ServicePoolException
    +
    +
    Constructs a new generic service pool exception.
    +
    +
    ServicePoolException(String) - Constructor for exception io.github.simplexdevelopment.api.ServicePoolException
    +
     
    +
    ServicePoolException(Throwable) - Constructor for exception io.github.simplexdevelopment.api.ServicePoolException
    +
     
    +
    servicePools - Variable in class io.github.simplexdevelopment.scheduler.ServiceManager
    +
    +
    A set of ServicePools which are currently active.
    +
    +
    setCancelled(boolean) - Method in class io.github.simplexdevelopment.scheduler.ExecutableService
    Cancels the execution of this service.
    +
    setContext(ServicePool) - Method in class io.github.simplexdevelopment.impl.PoolHolder
    +
     
    setContext(S) - Method in interface io.github.simplexdevelopment.api.Context
     
    +
    setParentPool(ServicePool) - Method in interface io.github.simplexdevelopment.api.IService
    +
    +
    Sets the parent pool for this service.
    +
    +
    setParentPool(ServicePool) - Method in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
     
    start() - Method in interface io.github.simplexdevelopment.api.IService
    The actual start method for the service.
    @@ -131,16 +162,16 @@ loadScripts(document, 'script');
    stop() - Method in class io.github.simplexdevelopment.impl.ServiceImpl
     
    -
    stopService(NamespacedKey, Mono<Disposable>) - Method in class io.github.simplexdevelopment.scheduler.ServicePool
    +
    stopService(String, Mono<Disposable>) - Method in class io.github.simplexdevelopment.scheduler.ServicePool
     
    stopServices(Flux<Disposable>) - Method in class io.github.simplexdevelopment.scheduler.ServicePool
     
    -
    supplyException() - Static method in exception io.github.simplexdevelopment.api.InvalidServicePoolException
    +
    supplyException() - Static method in exception io.github.simplexdevelopment.api.ServicePoolException
     
    -
    supplyException(IService) - Static method in exception io.github.simplexdevelopment.api.InvalidServiceException
    +
    supplyException(IService) - Static method in exception io.github.simplexdevelopment.api.ServiceException
     
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-18.html b/docs/index-files/index-18.html index f5743bd..ee4e576 100644 --- a/docs/index-files/index-18.html +++ b/docs/index-files/index-18.html @@ -1,7 +1,7 @@ - + T-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,7 +51,7 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    T

    takeFromExistingPool(ServicePool, IService...) - Method in class io.github.simplexdevelopment.scheduler.ServiceManager
    @@ -67,12 +68,8 @@ loadScripts(document, 'script');
    Returns a string representation of this record class.
    -
    toString() - Method in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    -
    -
    Returns a string representation of this record class.
    -
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-2.html b/docs/index-files/index-2.html index e891388..163b8d5 100644 --- a/docs/index-files/index-2.html +++ b/docs/index-files/index-2.html @@ -1,7 +1,7 @@ - + B-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,7 +51,7 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    B

    BukkitDisposable - Record Class in io.github.simplexdevelopment.scheduler
    @@ -60,7 +61,7 @@ loadScripts(document, 'script');
    Creates an instance of a BukkitDisposable record class.
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-3.html b/docs/index-files/index-3.html index c08ee36..b63637a 100644 --- a/docs/index-files/index-3.html +++ b/docs/index-files/index-3.html @@ -1,7 +1,7 @@ - + C-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,27 +51,31 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    C

    -
    cancel() - Method in class io.github.simplexdevelopment.api.ExecutableService
    +
    cancel() - Method in class io.github.simplexdevelopment.scheduler.ExecutableService
    Actual stop call, to ensure that the service actually #isCancelled().
    -
    cancelled - Variable in class io.github.simplexdevelopment.api.ExecutableService
    -
     
    +
    cancelled - Variable in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
    +
    Whether the service has been cancelled or not.
    +
    Context<S> - Interface in io.github.simplexdevelopment.api
     
    contextCollection() - Method in interface io.github.simplexdevelopment.api.Context
     
    -
    createServicePool(NamespacedKey, IService...) - Method in class io.github.simplexdevelopment.scheduler.ServiceManager
    +
    contextCollection() - Method in class io.github.simplexdevelopment.impl.PoolHolder
     
    -
    createWorker() - Method in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    +
    createServicePool(String, IService...) - Method in class io.github.simplexdevelopment.scheduler.ServiceManager
    +
     
    +
    createWorker() - Method in class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    A new Scheduler.Worker.
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-4.html b/docs/index-files/index-4.html index 1fbe986..1efa9fa 100644 --- a/docs/index-files/index-4.html +++ b/docs/index-files/index-4.html @@ -1,7 +1,7 @@ - + D-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,27 +51,33 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    D

    DEFAULT - Static variable in class io.github.simplexdevelopment.scheduler.ServicePool
    -
    The default NamespacedKey used to identify unmarked services.
    +
    The default String used to identify unmarked services.
    +
    +
    delay - Variable in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
    +
    How long the service should wait before executing the first time.
    +
    +
    denom - Static variable in class io.github.simplexdevelopment.scheduler.SchedulingSystem
    +
    +
    A denominator to use when registering default service pool names.
    -
    delay - Variable in class io.github.simplexdevelopment.api.ExecutableService
    -
     
    disposables - Variable in class io.github.simplexdevelopment.impl.Main
     
    dispose() - Method in record class io.github.simplexdevelopment.scheduler.BukkitDisposable
    Disposes of the task upstream on the Bukkit scheduler.
    -
    dispose() - Method in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    +
    dispose() - Method in class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    -
    This method does nothing and is unused.
    +
    Deprecated.
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-5.html b/docs/index-files/index-5.html index 9f95fd7..dd7e94a 100644 --- a/docs/index-files/index-5.html +++ b/docs/index-files/index-5.html @@ -1,7 +1,7 @@ - + E-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,43 +51,39 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    E

    -
    emptyServicePool(NamespacedKey, boolean) - Method in class io.github.simplexdevelopment.scheduler.ServiceManager
    +
    emptyServicePool(String, boolean) - Method in class io.github.simplexdevelopment.scheduler.ServiceManager
     
    equals(Object) - Method in record class io.github.simplexdevelopment.scheduler.BukkitDisposable
    Indicates whether some other object is "equal to" this one.
    -
    equals(Object) - Method in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    -
    -
    Indicates whether some other object is "equal to" this one.
    -
    -
    ExecutableService - Class in io.github.simplexdevelopment.api
    +
    ExecutableService - Class in io.github.simplexdevelopment.scheduler
     
    -
    ExecutableService(NamespacedKey) - Constructor for class io.github.simplexdevelopment.api.ExecutableService
    +
    ExecutableService(String) - Constructor for class io.github.simplexdevelopment.scheduler.ExecutableService
    Creates a new instance of an executable service.
    -
    ExecutableService(ServicePool, NamespacedKey) - Constructor for class io.github.simplexdevelopment.api.ExecutableService
    +
    ExecutableService(ServicePool, String) - Constructor for class io.github.simplexdevelopment.scheduler.ExecutableService
    Creates a new instance of an executable service.
    -
    ExecutableService(ServicePool, NamespacedKey, Long, Long, Boolean) - Constructor for class io.github.simplexdevelopment.api.ExecutableService
    +
    ExecutableService(ServicePool, String, Long, Long, Boolean) - Constructor for class io.github.simplexdevelopment.scheduler.ExecutableService
    Creates a new instance of an executable service.
    -
    ExecutableService(ServicePool, NamespacedKey, Long) - Constructor for class io.github.simplexdevelopment.api.ExecutableService
    +
    ExecutableService(ServicePool, String, Long) - Constructor for class io.github.simplexdevelopment.scheduler.ExecutableService
    Creates a new instance of an executable service.
    -
    ExecutableService(ServicePool, NamespacedKey, Long, Long, Boolean, Boolean) - Constructor for class io.github.simplexdevelopment.api.ExecutableService
    +
    ExecutableService(ServicePool, String, Long, Long, Boolean, Boolean) - Constructor for class io.github.simplexdevelopment.scheduler.ExecutableService
    Creates a new instance of an executable service.
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-6.html b/docs/index-files/index-6.html index ff59c92..48cbd0f 100644 --- a/docs/index-files/index-6.html +++ b/docs/index-files/index-6.html @@ -1,7 +1,7 @@ - + F-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,7 +51,7 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    F

    fluxFromCollection() - Method in interface io.github.simplexdevelopment.api.Context
    @@ -64,7 +65,7 @@ loadScripts(document, 'script');
    forceStop(IService) - Method in class io.github.simplexdevelopment.scheduler.SchedulingSystem
     
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-7.html b/docs/index-files/index-7.html index e439d7e..64c559a 100644 --- a/docs/index-files/index-7.html +++ b/docs/index-files/index-7.html @@ -1,7 +1,7 @@ - + G-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,7 +51,7 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    G

    getAssociatedServicePool(IService) - Method in class io.github.simplexdevelopment.scheduler.ServiceManager
    @@ -59,43 +60,41 @@ loadScripts(document, 'script');
     
    getContext() - Method in interface io.github.simplexdevelopment.api.Context
     
    -
    getDefaultNamespacedKey() - Static method in interface io.github.simplexdevelopment.api.IService
    +
    getContext() - Method in class io.github.simplexdevelopment.impl.PoolHolder
     
    getDefaultNamespacedKey() - Static method in class io.github.simplexdevelopment.scheduler.ServicePool
     
    -
    getDelay() - Method in class io.github.simplexdevelopment.api.ExecutableService
    -
     
    getDelay() - Method in interface io.github.simplexdevelopment.api.IService
     
    +
    getDelay() - Method in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
     
    getMainScheduler() - Method in class io.github.simplexdevelopment.scheduler.SchedulingSystem
     
    -
    getNamespacedKey() - Method in class io.github.simplexdevelopment.api.ExecutableService
    +
    getName() - Method in interface io.github.simplexdevelopment.api.Identifier
     
    -
    getNamespacedKey() - Method in interface io.github.simplexdevelopment.api.IService
    +
    getName() - Method in class io.github.simplexdevelopment.scheduler.ExecutableService
     
    -
    getParentPool() - Method in class io.github.simplexdevelopment.api.ExecutableService
    +
    getNumericalId() - Method in interface io.github.simplexdevelopment.api.Identifier
     
    getParentPool() - Method in interface io.github.simplexdevelopment.api.IService
     
    -
    getParentPool() - Method in class io.github.simplexdevelopment.impl.ServiceImpl
    -
     
    -
    getPeriod() - Method in class io.github.simplexdevelopment.api.ExecutableService
    +
    getParentPool() - Method in class io.github.simplexdevelopment.scheduler.ExecutableService
     
    getPeriod() - Method in interface io.github.simplexdevelopment.api.IService
     
    +
    getPeriod() - Method in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
     
    getPlugin() - Method in interface io.github.simplexdevelopment.api.IService
     
    getPlugin() - Method in class io.github.simplexdevelopment.impl.ServiceImpl
     
    getProvidingPlugin() - Method in class io.github.simplexdevelopment.scheduler.SchedulingSystem
     
    -
    getRepeatingPools() - Method in class io.github.simplexdevelopment.scheduler.SchedulingSystem
    -
     
    getScheduler() - Method in class io.github.simplexdevelopment.impl.Main
     
    getScheduler() - Method in class io.github.simplexdevelopment.scheduler.ServicePool
     
    -
    getService(NamespacedKey) - Method in class io.github.simplexdevelopment.scheduler.ServicePool
    +
    getService(String) - Method in class io.github.simplexdevelopment.scheduler.ServicePool
     
    getServiceManager() - Method in interface io.github.simplexdevelopment.api.ISchedule
     
    @@ -103,8 +102,10 @@ loadScripts(document, 'script');
     
    getServicePools() - Method in class io.github.simplexdevelopment.scheduler.ServiceManager
     
    +
    getUniqueId() - Method in interface io.github.simplexdevelopment.api.Identifier
    +
     
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-8.html b/docs/index-files/index-8.html index d21f869..8efa9ca 100644 --- a/docs/index-files/index-8.html +++ b/docs/index-files/index-8.html @@ -1,7 +1,7 @@ - + H-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,19 +51,15 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    H

    hashCode() - Method in record class io.github.simplexdevelopment.scheduler.BukkitDisposable
    Returns a hash code value for this object.
    -
    hashCode() - Method in record class io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    -
    -
    Returns a hash code value for this object.
    -
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index-files/index-9.html b/docs/index-files/index-9.html index 7a4db87..0c00056 100644 --- a/docs/index-files/index-9.html +++ b/docs/index-files/index-9.html @@ -1,7 +1,7 @@ - + I-Index @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Help
  • @@ -50,22 +51,10 @@ loadScripts(document, 'script');

    Index

    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

    I

    -
    InvalidServiceException - Exception in io.github.simplexdevelopment.api
    -
     
    -
    InvalidServiceException(IService) - Constructor for exception io.github.simplexdevelopment.api.InvalidServiceException
    -
     
    -
    InvalidServiceException(Throwable) - Constructor for exception io.github.simplexdevelopment.api.InvalidServiceException
    -
     
    -
    InvalidServicePoolException - Exception in io.github.simplexdevelopment.api
    -
     
    -
    InvalidServicePoolException() - Constructor for exception io.github.simplexdevelopment.api.InvalidServicePoolException
    -
     
    -
    InvalidServicePoolException(String) - Constructor for exception io.github.simplexdevelopment.api.InvalidServicePoolException
    -
     
    -
    InvalidServicePoolException(Throwable) - Constructor for exception io.github.simplexdevelopment.api.InvalidServicePoolException
    +
    Identifier - Interface in io.github.simplexdevelopment.api
     
    io.github.simplexdevelopment.api - package io.github.simplexdevelopment.api
     
    @@ -73,7 +62,7 @@ loadScripts(document, 'script');
     
    io.github.simplexdevelopment.scheduler - package io.github.simplexdevelopment.scheduler
     
    -
    isCancelled() - Method in class io.github.simplexdevelopment.api.ExecutableService
    +
    isCancelled() - Method in class io.github.simplexdevelopment.scheduler.ExecutableService
    Cancels the execution of this service.
    @@ -85,14 +74,14 @@ loadScripts(document, 'script');
    IService - Interface in io.github.simplexdevelopment.api
     
    -
    isPeriodic() - Method in class io.github.simplexdevelopment.api.ExecutableService
    -
     
    isPeriodic() - Method in interface io.github.simplexdevelopment.api.IService
     
    +
    isPeriodic() - Method in class io.github.simplexdevelopment.scheduler.ExecutableService
    +
     
    isValidService(IService) - Method in class io.github.simplexdevelopment.scheduler.ServicePool
     
    -A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Serialized Form +A B C D E F G H I L M N O P Q R S T 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form diff --git a/docs/index.html b/docs/index.html index 637dd3c..70d9d74 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,7 +1,7 @@ - + Overview @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • diff --git a/docs/io/github/simplex/api/ExecutableService.html b/docs/io/github/simplex/api/ExecutableService.html index 7ad34de..818a857 100644 --- a/docs/io/github/simplex/api/ExecutableService.html +++ b/docs/io/github/simplex/api/ExecutableService.html @@ -72,7 +72,7 @@ loadScripts(document, 'script');

    Class ExecutableService

    java.lang.Object -
    io.github.simplexdevelopment.api.ExecutableService
    +
    io.github.simplexdevelopment.scheduler.ExecutableService
    diff --git a/docs/io/github/simplex/api/InvalidServiceException.html b/docs/io/github/simplex/api/InvalidServiceException.html index 6c13243..e8877da 100644 --- a/docs/io/github/simplex/api/InvalidServiceException.html +++ b/docs/io/github/simplex/api/InvalidServiceException.html @@ -75,7 +75,7 @@ loadScripts(document, 'script');
    java.lang.Throwable
    java.lang.Exception
    java.lang.RuntimeException -
    io.github.simplexdevelopment.api.InvalidServiceException
    +
    io.github.simplexdevelopment.api.ServiceException
    @@ -92,7 +92,7 @@ loadScripts(document, 'script');
    See Also:
    diff --git a/docs/io/github/simplex/api/InvalidServicePoolException.html b/docs/io/github/simplex/api/InvalidServicePoolException.html index a17a219..23085bb 100644 --- a/docs/io/github/simplex/api/InvalidServicePoolException.html +++ b/docs/io/github/simplex/api/InvalidServicePoolException.html @@ -75,7 +75,7 @@ loadScripts(document, 'script');
    java.lang.Throwable
    java.lang.Exception
    java.lang.RuntimeException -
    io.github.simplexdevelopment.api.InvalidServicePoolException
    +
    io.github.simplexdevelopment.api.ServicePoolException
    @@ -92,7 +92,7 @@ loadScripts(document, 'script');
    See Also:
    diff --git a/docs/io/github/simplex/impl/ServiceImpl.html b/docs/io/github/simplex/impl/ServiceImpl.html index 864b244..b7c0eb8 100644 --- a/docs/io/github/simplex/impl/ServiceImpl.html +++ b/docs/io/github/simplex/impl/ServiceImpl.html @@ -72,7 +72,7 @@ loadScripts(document, 'script');

    Class ServiceImpl

    java.lang.Object - @@ -146,7 +146,7 @@ loadScripts(document, 'script');
    -

    Methods inherited from class io.github.simplexdevelopment.api.ExecutableService

    +

    Methods inherited from class io.github.simplexdevelopment.api.ExecutableService

    getDelay, getNamespacedKey, getPeriod, isCancelled, isPeriodic, setCancelled

    Methods inherited from class java.lang.Object

    diff --git a/docs/io/github/simplexdevelopment/api/Context.html b/docs/io/github/simplexdevelopment/api/Context.html index d772f4a..2d2ca95 100644 --- a/docs/io/github/simplexdevelopment/api/Context.html +++ b/docs/io/github/simplexdevelopment/api/Context.html @@ -1,7 +1,7 @@ - + Context @@ -36,6 +36,7 @@ loadScripts(document, 'script');
  • Package
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • @@ -72,6 +73,10 @@ loadScripts(document, 'script');

    Interface Context<S>

    +
    +
    All Known Implementing Classes:
    +
    PoolHolder
    +

    public interface Context<S>
    @@ -88,16 +93,16 @@ loadScripts(document, 'script');
    Modifier and Type
    Method
    Description
    - +
    @Nullable Collection<S>
     
    -
    default reactor.core.publisher.Flux<S>
    +
    default @Nullable reactor.core.publisher.Flux<S>
     
    -
    reactor.core.publisher.Mono<S>
    +
    @NotNull reactor.core.publisher.Mono<S>
     
    -
    reactor.core.publisher.Mono<Void>
    +
    @NotNull reactor.core.publisher.Mono<Void>
    setContext(S context)
     
    @@ -117,7 +122,8 @@ loadScripts(document, 'script');
  • getContext

    -
    reactor.core.publisher.Mono<S> getContext()
    +
    @NotNull +@NotNull reactor.core.publisher.Mono<S> getContext()
    Returns:
    A Mono object which contains a single element represented by the definer of this Context class.
    @@ -127,7 +133,8 @@ loadScripts(document, 'script');
  • setContext

    -
    reactor.core.publisher.Mono<Void> setContext(S context)
    +
    @NotNull +@NotNull reactor.core.publisher.Mono<Void> setContext(S context)
    Parameters:
    context - A separate (or identical) object identified by the definer of this Context class.
    @@ -139,7 +146,8 @@ loadScripts(document, 'script');
  • contextCollection

    -
    Collection<S> contextCollection()
    +
    @Nullable +@Nullable Collection<S> contextCollection()
    Returns:
    A collection of objects related to the definer of this Context class.
    @@ -149,7 +157,8 @@ loadScripts(document, 'script');
  • fluxFromCollection

    -
    default reactor.core.publisher.Flux<S> fluxFromCollection()
    +
    @Nullable +default @Nullable reactor.core.publisher.Flux<S> fluxFromCollection()
    Returns:
    A Flux object which contains the values of the contextCollection(), for non-blocking interpretation.
    diff --git a/docs/io/github/simplexdevelopment/api/ExecutableService.html b/docs/io/github/simplexdevelopment/api/ExecutableService.html index e34ec48..d647803 100644 --- a/docs/io/github/simplexdevelopment/api/ExecutableService.html +++ b/docs/io/github/simplexdevelopment/api/ExecutableService.html @@ -72,7 +72,7 @@ loadScripts(document, 'script');

    Class ExecutableService

    java.lang.Object -
    io.github.simplexdevelopment.api.ExecutableService
    +
    io.github.simplexdevelopment.scheduler.ExecutableService
    diff --git a/docs/io/github/simplexdevelopment/api/ISchedule.html b/docs/io/github/simplexdevelopment/api/ISchedule.html index 4dd7c1e..c797a4a 100644 --- a/docs/io/github/simplexdevelopment/api/ISchedule.html +++ b/docs/io/github/simplexdevelopment/api/ISchedule.html @@ -1,7 +1,7 @@ - + ISchedule @@ -36,6 +36,7 @@ loadScripts(document, 'script');
  • Package
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • @@ -101,9 +102,11 @@ loadScripts(document, 'script');
    reactor.core.publisher.Mono<ServiceManager>
     
    -
    reactor.core.publisher.Mono<ServicePool>
    -
    queue(IService service)
    -
     
    +
    @NotNull reactor.core.publisher.Mono<reactor.core.Disposable>
    +
    queue(@NotNull IService service)
    +
    +
    Queues a service to be executed in a service pool.
    +
    reactor.core.publisher.Mono<Void>
    runOnce(IService service)
     
    @@ -134,13 +137,15 @@ loadScripts(document, 'script');
  • queue

    -
    reactor.core.publisher.Mono<ServicePool> queue(IService service)
    +
    @NotNull +@NotNull reactor.core.publisher.Mono<reactor.core.Disposable> queue(@NotNull + @NotNull IService service)
    +
    Queues a service to be executed in a service pool.
    Parameters:
    service - The service to use to locate the associated service pool and queue the service for execution.
    Returns:
    -
    A Mono that can be used to prepare the service for execution within it's associated service pool. - If the service has no associated pool, a new pool will be created.
    +
    A Mono that can be used to cancel the service.
  • diff --git a/docs/io/github/simplexdevelopment/api/IService.html b/docs/io/github/simplexdevelopment/api/IService.html index 442d162..fd41289 100644 --- a/docs/io/github/simplexdevelopment/api/IService.html +++ b/docs/io/github/simplexdevelopment/api/IService.html @@ -1,7 +1,7 @@ - + IService @@ -36,6 +36,7 @@ loadScripts(document, 'script');
  • Package
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • @@ -74,15 +75,15 @@ loadScripts(document, 'script');
    All Superinterfaces:
    -
    Runnable
    +
    Identifier, Runnable
    All Known Implementing Classes:
    -
    ExecutableService, ServiceImpl
    +
    ExecutableService, ServiceImpl

    public interface IService -extends Runnable
    +extends Runnable, Identifier
  • @@ -152,24 +149,6 @@ extends
  • -
    -

    getDefaultNamespacedKey

    -
    @Contract(" -> new") -@NotNull -static @NotNull org.bukkit.NamespacedKey getDefaultNamespacedKey()
    -
    -
  • -
  • -
    -

    getNamespacedKey

    -
    org.bukkit.NamespacedKey getNamespacedKey()
    -
    -
    Returns:
    -
    The NamespacedKey of this service.
    -
    -
    -
  • -
  • isPeriodic

    boolean isPeriodic()
    @@ -245,6 +224,19 @@ extends
    +

    setParentPool

    +
    reactor.core.publisher.Mono<VoidsetParentPool(ServicePool servicePool)
    +
    Sets the parent pool for this service.
    +
    +
    Parameters:
    +
    servicePool - The service pool to attach this service to.
    +
    Returns:
    +
    An encapsulated Mono object representing the set operation.
    +
    +
    +
  • +
  • run

    default void run()
    @@ -254,23 +246,6 @@ extends -

    newNamespacedKey

    -
    -
    This is an easy static call for creating a new namespaced key for services and service pools.
    -
    -
    Parameters:
    -
    space - The namespace of the service.
    -
    key - The key name of the service.
    -
    Returns:
    -
    A NamespacedKey object representing the service.
    -
    -
    -
  • diff --git a/docs/io/github/simplexdevelopment/api/Identifier.html b/docs/io/github/simplexdevelopment/api/Identifier.html new file mode 100644 index 0000000..d15e351 --- /dev/null +++ b/docs/io/github/simplexdevelopment/api/Identifier.html @@ -0,0 +1,165 @@ + + + + +Identifier + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + +

    Interface Identifier

    +
    +
    +
    +
    All Known Subinterfaces:
    +
    IService
    +
    +
    +
    All Known Implementing Classes:
    +
    ExecutableService, ServiceImpl
    +
    +
    +
    public interface Identifier
    +
    +
    +
      + +
    • +
      +

      Method Summary

      +
      +
      +
      +
      +
      Modifier and Type
      +
      Method
      +
      Description
      + + +
       
      +
      default int
      + +
       
      +
      default UUID
      + +
       
      +
      +
      +
      +
      +
    • +
    +
    +
    +
      + +
    • +
      +

      Method Details

      +
        +
      • +
        +

        getName

        +
        String getName()
        +
        +
        Returns:
        +
        The name of the identifiable object in a readable format.
        +
        +
        +
      • +
      • +
        +

        getUniqueId

        +
        default UUID getUniqueId()
        +
        +
        Returns:
        +
        The UUID of the identifiable object, based on the getName() value. + This is calculated using UUID.nameUUIDFromBytes(byte[]).
        +
        +
        +
      • +
      • +
        +

        getNumericalId

        +
        default int getNumericalId()
        +
        +
        Returns:
        +
        The numerical id of the identifiable object, based on the getUniqueId() value. + This is calculated using UUID.hashCode().
        +
        +
        +
      • +
      +
      +
    • +
    +
    + +
    +
    +
    + + diff --git a/docs/io/github/simplexdevelopment/api/InvalidServiceException.html b/docs/io/github/simplexdevelopment/api/InvalidServiceException.html index 528d4c4..3972751 100644 --- a/docs/io/github/simplexdevelopment/api/InvalidServiceException.html +++ b/docs/io/github/simplexdevelopment/api/InvalidServiceException.html @@ -75,7 +75,7 @@ loadScripts(document, 'script');
    java.lang.Throwable
    java.lang.Exception
    java.lang.RuntimeException -
    io.github.simplexdevelopment.api.InvalidServiceException
    +
    io.github.simplexdevelopment.api.ServiceException
    @@ -92,7 +92,7 @@ loadScripts(document, 'script');
    See Also:
    diff --git a/docs/io/github/simplexdevelopment/api/InvalidServicePoolException.html b/docs/io/github/simplexdevelopment/api/InvalidServicePoolException.html index 7e0f8a2..d96f3d0 100644 --- a/docs/io/github/simplexdevelopment/api/InvalidServicePoolException.html +++ b/docs/io/github/simplexdevelopment/api/InvalidServicePoolException.html @@ -75,7 +75,7 @@ loadScripts(document, 'script');
    java.lang.Throwable
    java.lang.Exception
    java.lang.RuntimeException -
    io.github.simplexdevelopment.api.InvalidServicePoolException
    +
    io.github.simplexdevelopment.api.ServicePoolException
    @@ -92,7 +92,7 @@ loadScripts(document, 'script');
    See Also:
  • diff --git a/docs/io/github/simplexdevelopment/api/ServiceException.html b/docs/io/github/simplexdevelopment/api/ServiceException.html new file mode 100644 index 0000000..0b66310 --- /dev/null +++ b/docs/io/github/simplexdevelopment/api/ServiceException.html @@ -0,0 +1,205 @@ + + + + +ServiceException + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + +

    Class ServiceException

    +
    +
    java.lang.Object +
    java.lang.Throwable +
    java.lang.Exception +
    java.lang.RuntimeException +
    io.github.simplexdevelopment.api.ServiceException
    +
    +
    +
    +
    +
    +
    +
    All Implemented Interfaces:
    +
    Serializable
    +
    +
    +
    public class ServiceException +extends RuntimeException
    +
    +
    See Also:
    +
    + +
    +
    +
    +
    + +
    +
    +
      + +
    • +
      +

      Constructor Details

      +
        +
      • +
        +

        ServiceException

        +
        public ServiceException(IService service)
        +
        Constructs a new service exception which states the service is not present within any service pools.
        +
        +
        Parameters:
        +
        service - The service that threw the exception.
        +
        +
        +
      • +
      • +
        +

        ServiceException

        +
        public ServiceException(Throwable th)
        +
        +
        Parameters:
        +
        th - The throwable that was thrown.
        +
        +
        +
      • +
      +
      +
    • + +
    • +
      +

      Method Details

      +
        +
      • +
        +

        supplyException

        +
        public static Supplier<ServiceException> supplyException(IService service)
        +
        +
        Parameters:
        +
        service - The service that threw the exception.
        +
        Returns:
        +
        A supplier that can be used in conjunction with Reactor.
        +
        +
        +
      • +
      +
      +
    • +
    +
    + +
    +
    +
    + + diff --git a/docs/io/github/simplexdevelopment/api/ServicePoolException.html b/docs/io/github/simplexdevelopment/api/ServicePoolException.html new file mode 100644 index 0000000..5a5795e --- /dev/null +++ b/docs/io/github/simplexdevelopment/api/ServicePoolException.html @@ -0,0 +1,215 @@ + + + + +ServicePoolException + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + +

    Class ServicePoolException

    +
    +
    java.lang.Object +
    java.lang.Throwable +
    java.lang.Exception +
    java.lang.RuntimeException +
    io.github.simplexdevelopment.api.ServicePoolException
    +
    +
    +
    +
    +
    +
    +
    All Implemented Interfaces:
    +
    Serializable
    +
    +
    +
    public class ServicePoolException +extends RuntimeException
    +
    +
    See Also:
    +
    + +
    +
    +
    +
    + +
    +
    +
      + +
    • +
      +

      Constructor Details

      +
        +
      • +
        +

        ServicePoolException

        +
        public ServicePoolException()
        +
        Constructs a new generic service pool exception. + This will be thrown when a service attempts to execute without an associated service pool.
        +
        +
      • +
      • +
        +

        ServicePoolException

        +
        public ServicePoolException(@NotNull + @NotNull String string)
        +
        +
        Parameters:
        +
        string - The message to be displayed when the exception is thrown.
        +
        +
        +
      • +
      • +
        +

        ServicePoolException

        +
        public ServicePoolException(Throwable ex)
        +
        +
        Parameters:
        +
        ex - The exception to be thrown.
        +
        +
        +
      • +
      +
      +
    • + +
    • +
      +

      Method Details

      +
        +
      • +
        +

        supplyException

        +
        @Contract(pure=true) +@NotNull +public static @NotNull Supplier<ServicePoolException> supplyException()
        +
        +
        Returns:
        +
        A supplier which can be used in conjunction with Reactor.
        +
        +
        +
      • +
      +
      +
    • +
    +
    + +
    +
    +
    + + diff --git a/docs/io/github/simplexdevelopment/api/package-summary.html b/docs/io/github/simplexdevelopment/api/package-summary.html index 1e57726..715e419 100644 --- a/docs/io/github/simplexdevelopment/api/package-summary.html +++ b/docs/io/github/simplexdevelopment/api/package-summary.html @@ -1,7 +1,7 @@ - + io.github.simplexdevelopment.api @@ -36,6 +36,7 @@ loadScripts(document, 'script');
  • Class
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • @@ -68,23 +69,23 @@ loadScripts(document, 'script'); @@ -59,15 +60,14 @@ loadScripts(document, 'script');
  • @@ -143,6 +141,9 @@ loadScripts(document, 'script');
    void
     
    +
    void
    +
    registerServices(@NotNull PoolHolder poolHolder)
    +
     
    @@ -170,12 +171,6 @@ loadScripts(document, 'script');

    Field Details

    • -
      -

      pool

      -
      public ServicePool pool
      -
      -
    • -
    • scheduler

      private SchedulingSystem<Main> scheduler
      @@ -234,6 +229,13 @@ loadScripts(document, 'script');
    • +
      +

      registerServices

      +
      public void registerServices(@NotNull + @NotNull PoolHolder poolHolder)
      +
      +
    • +
    • getScheduler

      public SchedulingSystem<Main> getScheduler()
      diff --git a/docs/io/github/simplexdevelopment/impl/PoolHolder.html b/docs/io/github/simplexdevelopment/impl/PoolHolder.html new file mode 100644 index 0000000..4035fba --- /dev/null +++ b/docs/io/github/simplexdevelopment/impl/PoolHolder.html @@ -0,0 +1,245 @@ + + + + +PoolHolder + + + + + + + + + + + + + + + +
      + +
      +
      + +
      + +

      Class PoolHolder

      +
      +
      java.lang.Object +
      io.github.simplexdevelopment.impl.PoolHolder
      +
      +
      +
      +
      All Implemented Interfaces:
      +
      Context<ServicePool>
      +
      +
      +
      public class PoolHolder +extends Object +implements Context<ServicePool>
      +
      +
      + +
      +
      +
        + +
      • +
        +

        Field Details

        + +
        +
      • + +
      • +
        +

        Constructor Details

        +
          +
        • +
          +

          PoolHolder

          +
          public PoolHolder(Main plugin)
          +
          +
        • +
        +
        +
      • + +
      • +
        +

        Method Details

        +
          +
        • +
          +

          getContext

          +
          @NotNull +public @NotNull reactor.core.publisher.Mono<ServicePool> getContext()
          +
          +
          Specified by:
          +
          getContext in interface Context<ServicePool>
          +
          Returns:
          +
          A Mono object which contains a single element represented by the definer of this Context class.
          +
          +
          +
        • +
        • +
          +

          setContext

          +
          @NotNull +public @NotNull reactor.core.publisher.Mono<Void> setContext(ServicePool context)
          +
          +
          Specified by:
          +
          setContext in interface Context<ServicePool>
          +
          Parameters:
          +
          context - A separate (or identical) object identified by the definer of this Context class.
          +
          Returns:
          +
          A Mono object which can be used to set the element of this Context class in a non-blocking manner.
          +
          +
          +
        • +
        • +
          +

          contextCollection

          +
          public Collection<ServicePool> contextCollection()
          +
          +
          Specified by:
          +
          contextCollection in interface Context<ServicePool>
          +
          Returns:
          +
          A collection of objects related to the definer of this Context class.
          +
          +
          +
        • +
        +
        +
      • +
      +
      + +
      +
      +
      + + diff --git a/docs/io/github/simplexdevelopment/impl/ServiceImpl.html b/docs/io/github/simplexdevelopment/impl/ServiceImpl.html index 3c99261..493ebdc 100644 --- a/docs/io/github/simplexdevelopment/impl/ServiceImpl.html +++ b/docs/io/github/simplexdevelopment/impl/ServiceImpl.html @@ -1,7 +1,7 @@ - + ServiceImpl @@ -36,6 +36,7 @@ loadScripts(document, 'script');
    • Package
    • Tree
    • +
    • Deprecated
    • Index
    • Help
    @@ -72,18 +73,18 @@ loadScripts(document, 'script');

    Class ServiceImpl

    java.lang.Object -
    All Implemented Interfaces:
    -
    IService, Runnable
    +
    Identifier, IService, Runnable

    public class ServiceImpl -extends ExecutableService
    +extends ExecutableService
    @@ -126,32 +128,32 @@ loadScripts(document, 'script');
    Modifier and Type
    Method
    Description
    -
    reactor.core.publisher.Mono<ServicePool>
    - + +
     
    - - -
     
    -
    reactor.core.publisher.Mono<Void>
    - -
    +
    reactor.core.publisher.Mono<Void>
    + +
    The actual start method for the service.
    -
    reactor.core.publisher.Mono<Void>
    - -
    +
    reactor.core.publisher.Mono<Void>
    + +
    The actual end method for the service.
    -

    Methods inherited from class io.github.simplexdevelopment.api.ExecutableService

    -getDelay, getNamespacedKey, getPeriod, isCancelled, isPeriodic, setCancelled
    +

    Methods inherited from class io.github.simplexdevelopment.scheduler.ExecutableService

    +getDelay, getName, getParentPool, getPeriod, isCancelled, isPeriodic, setCancelled, setParentPool

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +

    Methods inherited from interface io.github.simplexdevelopment.api.Identifier

    +getNumericalId, getUniqueId
    +

    Methods inherited from interface io.github.simplexdevelopment.api.IService

    run
    @@ -180,9 +182,10 @@ loadScripts(document, 'script');

    Constructor Details

    @@ -230,20 +233,6 @@ loadScripts(document, 'script'); -
  • -
    -

    getParentPool

    -
    public reactor.core.publisher.Mono<ServicePool> getParentPool()
    -
    -
    Specified by:
    -
    getParentPool in interface IService
    -
    Overrides:
    -
    getParentPool in class ExecutableService
    -
    Returns:
    -
    The ServicePool which this service is executing on.
    -
    -
    -
  • diff --git a/docs/io/github/simplexdevelopment/impl/package-summary.html b/docs/io/github/simplexdevelopment/impl/package-summary.html index dce6304..39584e3 100644 --- a/docs/io/github/simplexdevelopment/impl/package-summary.html +++ b/docs/io/github/simplexdevelopment/impl/package-summary.html @@ -1,7 +1,7 @@ - + io.github.simplexdevelopment.impl @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Class
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • @@ -70,8 +71,10 @@ loadScripts(document, 'script');
    Description
    Main
     
    -
    ServiceImpl
    +
    PoolHolder
     
    +
    ServiceImpl
    +
     
    diff --git a/docs/io/github/simplexdevelopment/impl/package-tree.html b/docs/io/github/simplexdevelopment/impl/package-tree.html index 97ff96e..825eb7a 100644 --- a/docs/io/github/simplexdevelopment/impl/package-tree.html +++ b/docs/io/github/simplexdevelopment/impl/package-tree.html @@ -1,7 +1,7 @@ - + io.github.simplexdevelopment.impl Class Hierarchy @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • +
  • Deprecated
  • Index
  • Help
  • @@ -59,7 +60,7 @@ loadScripts(document, 'script'); diff --git a/docs/io/github/simplexdevelopment/scheduler/BukkitDisposable.html b/docs/io/github/simplexdevelopment/scheduler/BukkitDisposable.html index 7d674c0..f52c111 100644 --- a/docs/io/github/simplexdevelopment/scheduler/BukkitDisposable.html +++ b/docs/io/github/simplexdevelopment/scheduler/BukkitDisposable.html @@ -1,7 +1,7 @@ - + BukkitDisposable @@ -36,6 +36,7 @@ loadScripts(document, 'script');
  • Package
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • diff --git a/docs/io/github/simplexdevelopment/scheduler/ExecutableService.html b/docs/io/github/simplexdevelopment/scheduler/ExecutableService.html new file mode 100644 index 0000000..932f6ee --- /dev/null +++ b/docs/io/github/simplexdevelopment/scheduler/ExecutableService.html @@ -0,0 +1,550 @@ + + + + +ExecutableService + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + +

    Class ExecutableService

    +
    +
    java.lang.Object +
    io.github.simplexdevelopment.scheduler.ExecutableService
    +
    +
    +
    +
    All Implemented Interfaces:
    +
    Identifier, IService, Runnable
    +
    +
    +
    Direct Known Subclasses:
    +
    ServiceImpl
    +
    +
    +
    public abstract class ExecutableService +extends Object +implements IService
    +
    +
    + +
    +
    +
      + +
    • +
      +

      Field Details

      +
        +
      • +
        +

        service_name

        +
        private final String service_name
        +
        The name of the service.
        +
        +
      • +
      • +
        +

        delay

        +
        private final long delay
        +
        How long the service should wait before executing the first time.
        +
        +
      • +
      • +
        +

        period

        +
        private final long period
        +
        How long the service should wait between executions.
        +
        +
      • +
      • +
        +

        repeating

        +
        private final boolean repeating
        +
        If the service should be executed once or continuously.
        +
        +
      • +
      • +
        +

        mayInterruptWhenRunning

        +
        private final boolean mayInterruptWhenRunning
        +
        If the service should be allowed to stop while executing.
        +
        +
      • +
      • +
        +

        parentPool

        +
        private ServicePool parentPool
        +
        The service's execution thread.
        +
        +
      • +
      • +
        +

        cancelled

        +
        private boolean cancelled
        +
        Whether the service has been cancelled or not.
        +
        +
      • +
      +
      +
    • + +
    • +
      +

      Constructor Details

      +
        +
      • +
        +

        ExecutableService

        +
        public ExecutableService(@NotNull + @NotNull String service_name)
        +
        Creates a new instance of an executable service. + Each service is registered with a String, + to allow for easy identification within the associated ServicePool.
        +
        +
        Parameters:
        +
        service_name - A namespaced key which can be used to identify the service.
        +
        +
        +
      • +
      • +
        +

        ExecutableService

        +
        public ExecutableService(@Nullable + @Nullable ServicePool parentPool, + @NotNull + @NotNull String service_name)
        +
        Creates a new instance of an executable service. + Each service is registered with a String, + to allow for easy identification within the associated ServicePool.
        +
        +
        Parameters:
        +
        parentPool - The ServicePool which this service is executing on.
        +
        service_name - A namespaced key which can be used to identify the service.
        +
        +
        +
      • +
      • +
        +

        ExecutableService

        +
        public ExecutableService(@Nullable + @Nullable ServicePool parentPool, + @NotNull + @NotNull String service_name, + @Nullable + @Nullable Long delay)
        +
        Creates a new instance of an executable service. + The timings are measured in ticks (20 ticks per second). + You do not need to explicitly define a delay. + Each service is registered with a String, + to allow for easy identification within the associated ServicePool.
        +
        +
        Parameters:
        +
        parentPool - The ServicePool which this service is executing on.
        +
        service_name - A namespaced key which can be used to identify the service.
        +
        delay - A specified amount of time (in ticks) to wait before the service runs.
        +
        +
        +
      • +
      • +
        +

        ExecutableService

        +
        public ExecutableService(@Nullable + @Nullable ServicePool parentPool, + @NotNull + @NotNull String service_name, + @NotNull + @NotNull Long delay, + @NotNull + @NotNull Long period, + @NotNull + @NotNull Boolean repeating)
        +
        Creates a new instance of an executable service. + The timings are measured in ticks (20 ticks per second). + You do not need to explicitly define a delay or a period, + however if you have flagged repeating as true, and the period is null, + then the period will automatically be set to 20 minutes. + Each service is registered with a String, + to allow for easy identification within the associated ServicePool.
        +
        +
        Parameters:
        +
        parentPool - The ServicePool which this service is executing on.
        +
        service_name - A namespaced key which can be used to identify the service.
        +
        delay - A specified amount of time (in ticks) to wait before the service runs.
        +
        period - How long the service should wait between service executions (in ticks).
        +
        repeating - If the service should be scheduled for repeated executions or not.
        +
        +
        +
      • +
      • +
        +

        ExecutableService

        +
        public ExecutableService(@Nullable + @Nullable ServicePool parentPool, + @NotNull + @NotNull String service_name, + @Nullable + @Nullable Long delay, + @Nullable + @Nullable Long period, + @NotNull + @NotNull Boolean repeating, + @NotNull + @NotNull Boolean mayInterruptWhenRunning)
        +
        Creates a new instance of an executable service. + The timings are measured in ticks (20 ticks per second). + You do not need to explicitly define a delay or a period, + however if you have flagged repeating as true, and the period is null, + then the period will automatically be set to 20 minutes. + Each service is registered with a String, + to allow for easy identification within the associated ServicePool.
        +
        +
        Parameters:
        +
        parentPool - The ServicePool which this service is executing on.
        +
        service_name - A namespaced key which can be used to identify the service.
        +
        delay - A specified amount of time (in ticks) to wait before the service runs.
        +
        period - How long the service should wait between service executions (in ticks).
        +
        repeating - If the service should be scheduled for repeated executions or not.
        +
        mayInterruptWhenRunning - If the service can be cancelled during execution.
        +
        +
        +
      • +
      +
      +
    • + +
    • +
      +

      Method Details

      +
        +
      • +
        +

        getDelay

        +
        public long getDelay()
        +
        +
        Specified by:
        +
        getDelay in interface IService
        +
        Returns:
        +
        How long the service should wait before executing the first time.
        +
        +
        +
      • +
      • +
        +

        getPeriod

        +
        public long getPeriod()
        +
        +
        Specified by:
        +
        getPeriod in interface IService
        +
        Returns:
        +
        How long the service should wait between subsequent executions.
        +
        +
        +
      • +
      • +
        +

        isPeriodic

        +
        public boolean isPeriodic()
        +
        +
        Specified by:
        +
        isPeriodic in interface IService
        +
        Returns:
        +
        If the service should be scheduled for repeated executions or not.
        +
        +
        +
      • +
      • +
        +

        isCancelled

        +
        public boolean isCancelled()
        +
        Cancels the execution of this service.
        +
        +
        Returns:
        +
        true if the service was cancelled, false if not.
        +
        +
        +
      • +
      • +
        +

        setCancelled

        +
        public reactor.core.publisher.Mono<Void> setCancelled(boolean cancel)
        +
        Cancels the execution of this service.
        +
        +
        Parameters:
        +
        cancel - Whether the service should be cancelled or not.
        +
        +
        +
      • +
      • +
        +

        cancel

        +
        @Contract(pure=true) +reactor.core.publisher.Mono<Void> cancel()
        +
        Actual stop call, to ensure that the service actually #isCancelled().
        +
        +
      • +
      • +
        +

        getParentPool

        +
        public reactor.core.publisher.Mono<ServicePool> getParentPool()
        +
        +
        Specified by:
        +
        getParentPool in interface IService
        +
        Returns:
        +
        The ServicePool which this service is executing on.
        +
        +
        +
      • +
      • +
        +

        getName

        +
        public String getName()
        +
        +
        Specified by:
        +
        getName in interface Identifier
        +
        Returns:
        +
        The name of the identifiable object in a readable format.
        +
        +
        +
      • +
      • +
        +

        setParentPool

        +
        public reactor.core.publisher.Mono<Void> setParentPool(ServicePool servicePool)
        +
        Description copied from interface: IService
        +
        Sets the parent pool for this service.
        +
        +
        Specified by:
        +
        setParentPool in interface IService
        +
        Parameters:
        +
        servicePool - The service pool to attach this service to.
        +
        Returns:
        +
        An encapsulated Mono object representing the set operation.
        +
        +
        +
      • +
      +
      +
    • +
    +
    + +
    +
    +
    + + diff --git a/docs/io/github/simplexdevelopment/scheduler/ReactorBukkitScheduler.html b/docs/io/github/simplexdevelopment/scheduler/ReactorBukkitScheduler.html index 419d442..f192f03 100644 --- a/docs/io/github/simplexdevelopment/scheduler/ReactorBukkitScheduler.html +++ b/docs/io/github/simplexdevelopment/scheduler/ReactorBukkitScheduler.html @@ -1,12 +1,12 @@ - + ReactorBukkitScheduler - + @@ -36,6 +36,7 @@ loadScripts(document, 'script');
  • Package
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • @@ -69,21 +70,19 @@ loadScripts(document, 'script');
    -

    Record Class ReactorBukkitScheduler

    +

    Class ReactorBukkitScheduler

    java.lang.Object -
    java.lang.Record
    io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler
    -
    All Implemented Interfaces:
    reactor.core.Disposable, reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Worker

    -
    public record ReactorBukkitScheduler(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.scheduler.BukkitScheduler scheduler) -extends Record +
    public final class ReactorBukkitScheduler +extends Object implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Worker
    @@ -111,14 +110,10 @@ implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Wo
    Description
    private final org.bukkit.plugin.java.JavaPlugin
    -
    -
    The field for the plugin record component.
    -
    +
     
    private final org.bukkit.scheduler.BukkitScheduler
    -
    -
    The field for the scheduler record component.
    -
    +
     
    @@ -130,11 +125,8 @@ implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Wo
    Constructor
    Description
    -
    ReactorBukkitScheduler(org.bukkit.plugin.java.JavaPlugin plugin, - org.bukkit.scheduler.BukkitScheduler scheduler)
    -
    -
    Creates an instance of a ReactorBukkitScheduler record class.
    -
    +
    ReactorBukkitScheduler(org.bukkit.plugin.java.JavaPlugin plugin)
    +
     
    @@ -143,7 +135,7 @@ implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Wo

    Method Summary

    -
    +
    Modifier and Type
    @@ -154,62 +146,37 @@ implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Wo
    A new Scheduler.Worker.
    -
    void
    - -
    -
    This method does nothing and is unused.
    -
    -
    final boolean
    - -
    -
    Indicates whether some other object is "equal to" this one.
    -
    -
    final int
    - -
    -
    Returns a hash code value for this object.
    -
    -
    org.bukkit.plugin.java.JavaPlugin
    - -
    -
    Returns the value of the plugin record component.
    -
    -
    @NotNull reactor.core.Disposable
    -
    schedule(@NotNull Runnable task)
    -
    -
    Delegates to the BukkitScheduler.
    +
    void
    + +
    +
    Deprecated.
    @NotNull reactor.core.Disposable
    -
    schedule(@NotNull Runnable task, - long delay, - @Nullable TimeUnit unit)
    +
    schedule(@NotNull Runnable task)
    -
    Delegates to the BukkitScheduler with a delay.
    +
    Delegates to the BukkitScheduler.
    @NotNull reactor.core.Disposable
    -
    schedulePeriodically(@NotNull Runnable task, +
    schedule(@NotNull Runnable task, + long delay, + @Nullable TimeUnit unit)
    +
    +
    Delegates to the BukkitScheduler with a delay.
    +
    +
    @NotNull reactor.core.Disposable
    +
    schedulePeriodically(@NotNull Runnable task, long initialDelay, long period, @Nullable TimeUnit unit)
    -
    -
    Delegates to the BukkitScheduler with a delay and a period.
    -
    -
    org.bukkit.scheduler.BukkitScheduler
    -
    -
    Returns the value of the scheduler record component.
    -
    -
    final String
    - -
    -
    Returns a string representation of this record class.
    +
    Delegates to the BukkitScheduler with a delay and a period.

    Methods inherited from class java.lang.Object

    -clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface reactor.core.Disposable

    isDisposed
    @@ -231,14 +198,12 @@ implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Wo

    plugin

    private final org.bukkit.plugin.java.JavaPlugin plugin
    -
    The field for the plugin record component.
  • scheduler

    private final org.bukkit.scheduler.BukkitScheduler scheduler
    -
    The field for the scheduler record component.
  • @@ -250,16 +215,9 @@ implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Wo

    Constructor Details

    • -
      +

      ReactorBukkitScheduler

      -
      public ReactorBukkitScheduler(org.bukkit.plugin.java.JavaPlugin plugin, - org.bukkit.scheduler.BukkitScheduler scheduler)
      -
      Creates an instance of a ReactorBukkitScheduler record class.
      -
      -
      Parameters:
      -
      plugin - the value for the plugin record component
      -
      scheduler - the value for the scheduler record component
      -
      +
      public ReactorBukkitScheduler(org.bukkit.plugin.java.JavaPlugin plugin)
    @@ -296,7 +254,7 @@ implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Wo public @NotNull reactor.core.Disposable schedule(@NotNull @NotNull Runnable task, long delay, - @Nullable + @Deprecated @Nullable @Nullable TimeUnit unit)
    Delegates to the BukkitScheduler with a delay.
    @@ -322,7 +280,7 @@ implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Wo @NotNull Runnable task, long initialDelay, long period, - @Nullable + @Deprecated @Nullable @Nullable TimeUnit unit)
    Delegates to the BukkitScheduler with a delay and a period. The initial delay may be 0L, but the period must be greater than 0L.
    @@ -359,7 +317,9 @@ implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Wo
  • dispose

    -
    public void dispose()
    +
    @Deprecated +public void dispose()
    +
    Deprecated.
    This method does nothing and is unused.
    Specified by:
    @@ -369,69 +329,6 @@ implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Wo
  • -
  • -
    -

    toString

    -
    public final String toString()
    -
    Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
    -
    -
    Specified by:
    -
    toString in class Record
    -
    Returns:
    -
    a string representation of this object
    -
    -
    -
  • -
  • -
    -

    hashCode

    -
    public final int hashCode()
    -
    Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
    -
    -
    Specified by:
    -
    hashCode in class Record
    -
    Returns:
    -
    a hash code value for this object
    -
    -
    -
  • -
  • -
    -

    equals

    -
    public final boolean equals(Object o)
    -
    Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
    -
    -
    Specified by:
    -
    equals in class Record
    -
    Parameters:
    -
    o - the object with which to compare
    -
    Returns:
    -
    true if this object is the same as the o argument; false otherwise.
    -
    -
    -
  • -
  • -
    -

    plugin

    -
    public org.bukkit.plugin.java.JavaPlugin plugin()
    -
    Returns the value of the plugin record component.
    -
    -
    Returns:
    -
    the value of the plugin record component
    -
    -
    -
  • -
  • -
    -

    scheduler

    -
    public org.bukkit.scheduler.BukkitScheduler scheduler()
    -
    Returns the value of the scheduler record component.
    -
    -
    Returns:
    -
    the value of the scheduler record component
    -
    -
    -
  • diff --git a/docs/io/github/simplexdevelopment/scheduler/SchedulingSystem.html b/docs/io/github/simplexdevelopment/scheduler/SchedulingSystem.html index 88146d3..f2830e4 100644 --- a/docs/io/github/simplexdevelopment/scheduler/SchedulingSystem.html +++ b/docs/io/github/simplexdevelopment/scheduler/SchedulingSystem.html @@ -1,7 +1,7 @@ - + SchedulingSystem @@ -36,6 +36,7 @@ loadScripts(document, 'script');
  • Package
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • @@ -95,18 +96,26 @@ implements Modifier and Type
    Field
    Description
    -
    - -
     
    -
    private final T
    - -
     
    -
    private final Set<ServicePool>
    - -
     
    +
    (package private) static int
    + +
    +
    A denominator to use when registering default service pool names.
    +
    + + +
    +
    The main scheduler which this system runs on.
    +
    +
    private final T
    + +
    +
    The plugin to use for registering tasks.
    +
    private final ServiceManager
    -
     
    +
    +
    The service manager to use for controlling service pools.
    +
    @@ -148,18 +157,17 @@ implements @NotNull reactor.core.publisher.Mono<T>
     
    - - +
    @NotNull reactor.core.publisher.Mono<ServiceManager>
    +
     
    -
    @NotNull reactor.core.publisher.Mono<ServiceManager>
    - -
     
    -
    @NotNull reactor.core.publisher.Mono<ServicePool>
    -
    queue(@NotNull IService service)
    +
    @NotNull reactor.core.publisher.Mono<reactor.core.Disposable>
    +
    queue(@NotNull IService service)
    +
    +
    Queues a service to be executed in a service pool.
    +
    +
    @NotNull reactor.core.publisher.Mono<Void>
    +
    runOnce(IService service)
     
    -
    @NotNull reactor.core.publisher.Mono<Void>
    -
    runOnce(IService service)
    -
     
    @@ -178,27 +186,32 @@ implements
  • +
    +

    denom

    +
    static int denom
    +
    A denominator to use when registering default service pool names.
    +
    +
  • +
  • serviceManager

    +
    The service manager to use for controlling service pools.
  • plugin

    private final T extends org.bukkit.plugin.java.JavaPlugin plugin
    -
    -
  • -
  • -
    -

    repeatingPools

    -
    private final Set<ServicePool> repeatingPools
    +
    The plugin to use for registering tasks. This should be an instance of your plugin.
  • mainScheduler

    private final ReactorBukkitScheduler mainScheduler
    +
    The main scheduler which this system runs on. This is an abstraction of the BukkitScheduler, + and as a result runs on the Main server thread.
  • @@ -229,17 +242,6 @@ implements
  • -
    -

    getRepeatingPools

    -
    -
    -
    Returns:
    -
    A set of ServicePools which contain repeating services.
    -
    -
    -
  • -
  • getServiceManager

    @NotNull @@ -256,16 +258,17 @@ implements

    queue

    @NotNull -public @NotNull reactor.core.publisher.Mono<ServicePoolqueue(@NotNull +public @NotNull reactor.core.publisher.Mono<reactor.core.Disposable> queue(@NotNull @NotNull IService service)
    +
    Description copied from interface: ISchedule
    +
    Queues a service to be executed in a service pool.
    Specified by:
    queue in interface ISchedule
    Parameters:
    service - The service to use to locate the associated service pool and queue the service for execution.
    Returns:
    -
    A Mono that can be used to prepare the service for execution within it's associated service pool. - If the service has no associated pool, a new pool will be created.
    +
    A Mono that can be used to cancel the service.
  • diff --git a/docs/io/github/simplexdevelopment/scheduler/ServiceManager.html b/docs/io/github/simplexdevelopment/scheduler/ServiceManager.html index e0363e5..453d190 100644 --- a/docs/io/github/simplexdevelopment/scheduler/ServiceManager.html +++ b/docs/io/github/simplexdevelopment/scheduler/ServiceManager.html @@ -1,7 +1,7 @@ - + ServiceManager @@ -36,6 +36,7 @@ loadScripts(document, 'script');
  • Package
  • Tree
  • +
  • Deprecated
  • Index
  • Help
  • @@ -92,7 +93,9 @@ loadScripts(document, 'script');
    Description
    private final Set<ServicePool>
    -
     
    +
    +
    A set of ServicePools which are currently active.
    +
    @@ -127,11 +130,11 @@ loadScripts(document, 'script'); IService... services)
     
    @NotNull reactor.core.publisher.Mono<ServicePool>
    -
    createServicePool(org.bukkit.NamespacedKey poolName, +
    createServicePool(String poolName, IService... services)
     
    @NotNull reactor.core.publisher.Mono<ServicePool>
    -
    emptyServicePool(org.bukkit.NamespacedKey poolName, +
    emptyServicePool(String poolName, boolean multithreaded)
     
    @NotNull reactor.core.publisher.Mono<ServicePool>
    @@ -144,7 +147,7 @@ loadScripts(document, 'script');
     
    @NotNull reactor.core.publisher.Mono<ServicePool>
    -
    multithreadedServicePool(org.bukkit.NamespacedKey name, +
     
    @NotNull reactor.core.publisher.Mono<ServicePool>
    @@ -172,6 +175,7 @@ loadScripts(document, 'script');

    servicePools

    private final Set<ServicePool> servicePools
    +
    A set of ServicePools which are currently active.
    @@ -202,12 +206,12 @@ loadScripts(document, 'script');

    Method Details

    • -
      +

      createServicePool

      @Contract(pure=true, value="_, _ -> new") @NotNull -public @NotNull reactor.core.publisher.Mono<ServicePool> createServicePool(org.bukkit.NamespacedKey poolName, +public @NotNull reactor.core.publisher.Mono<ServicePool> createServicePool(String poolName, IService... services)
      Parameters:
      @@ -220,12 +224,12 @@ loadScripts(document, 'script');
    • -
      +

      multithreadedServicePool

      @Contract(pure=true, value="_, _ -> new") @NotNull -public @NotNull reactor.core.publisher.Mono<ServicePool> multithreadedServicePool(org.bukkit.NamespacedKey name, +public @NotNull reactor.core.publisher.Mono<ServicePool> multithreadedServicePool(String name, IService... services)
      Parameters:
      @@ -238,12 +242,12 @@ loadScripts(document, 'script');
    • -
      +

      emptyServicePool

      @Contract(pure=true, value="_, _ -> new") @NotNull -public @NotNull reactor.core.publisher.Mono<ServicePool> emptyServicePool(org.bukkit.NamespacedKey poolName, +public @NotNull reactor.core.publisher.Mono<ServicePool> emptyServicePool(String poolName, boolean multithreaded)
      Parameters:
      diff --git a/docs/io/github/simplexdevelopment/scheduler/ServicePool.html b/docs/io/github/simplexdevelopment/scheduler/ServicePool.html index 7f4d9db..063f485 100644 --- a/docs/io/github/simplexdevelopment/scheduler/ServicePool.html +++ b/docs/io/github/simplexdevelopment/scheduler/ServicePool.html @@ -1,7 +1,7 @@ - + ServicePool @@ -36,6 +36,7 @@ loadScripts(document, 'script');
    • Package
    • Tree
    • +
    • Deprecated
    • Index
    • Help
    @@ -95,22 +96,19 @@ loadScripts(document, 'script');
    A collection of services related to this service pool.
    -
    private static final org.bukkit.NamespacedKey
    +
    private static final String
    -
    The default NamespacedKey used to identify unmarked services.
    +
    The default String used to identify unmarked services.
    -
    private final org.bukkit.NamespacedKey
    +
    private final String
    -
    The key used to identify this service pool.
    +
    The name used to identify this service pool.
    - - -
     
    -
    private final reactor.core.scheduler.Scheduler
    - -
    +
    private final reactor.core.scheduler.Scheduler
    + +
    The scheduler used to run the services in this pool.
    @@ -124,12 +122,12 @@ loadScripts(document, 'script');
    Constructor
    Description
    -
    ServicePool(org.bukkit.NamespacedKey name, +
    ServicePool(String name, boolean multithreaded)
    This will create a new instance of a Service Pool with a Scheduler as its main scheduler.
    -
    ServicePool(org.bukkit.NamespacedKey name, +
    ServicePool(String name, org.bukkit.plugin.java.JavaPlugin plugin)
    This will create a new instance of a Service Pool with the ReactorBukkitScheduler as its main scheduler.
    @@ -154,14 +152,14 @@ loadScripts(document, 'script');
    @NotNull Set<IService>
     
    -
    (package private) static org.bukkit.NamespacedKey
    +
    (package private) static String
     
    reactor.core.scheduler.Scheduler
     
    @NotNull reactor.core.publisher.Mono<IService>
    -
    getService(org.bukkit.NamespacedKey service_name)
    +
    getService(String service_name)
     
    (package private) boolean
    @@ -179,7 +177,7 @@ loadScripts(document, 'script');
     
    @NotNull reactor.core.publisher.Mono<Void>
    -
    stopService(@NotNull org.bukkit.NamespacedKey service_name, +
    stopService(@NotNull String service_name, @Nullable reactor.core.publisher.Mono<reactor.core.Disposable> disposable)
     
    @NotNull reactor.core.publisher.Mono<Void>
    @@ -205,8 +203,16 @@ loadScripts(document, 'script');
  • DEFAULT

    -
    private static final org.bukkit.NamespacedKey DEFAULT
    -
    The default NamespacedKey used to identify unmarked services. This will cause errors if left unchecked.
    +
    private static final String DEFAULT
    +
    The default String used to identify unmarked services. This will cause errors if left unchecked.
    +
    +
    See Also:
    +
    + +
    +
  • @@ -226,14 +232,8 @@ loadScripts(document, 'script');
  • name

    -
    private final org.bukkit.NamespacedKey name
    -
    The key used to identify this service pool.
    -
    -
  • -
  • -
    -

    rbScheduler

    -
    private final ReactorBukkitScheduler rbScheduler
    +
    private final String name
    +
    The name used to identify this service pool.
  • @@ -245,9 +245,9 @@ loadScripts(document, 'script');

    Constructor Details

    • -
      +

      ServicePool

      -
      public ServicePool(org.bukkit.NamespacedKey name, +
      public ServicePool(String name, boolean multithreaded)
      This will create a new instance of a Service Pool with a Scheduler as its main scheduler. This should be used if you'd like to execute tasks without communicating on the main server thread.
      @@ -259,9 +259,9 @@ loadScripts(document, 'script');
    • -
      +

      ServicePool

      -
      public ServicePool(org.bukkit.NamespacedKey name, +
      public ServicePool(String name, org.bukkit.plugin.java.JavaPlugin plugin)
      This will create a new instance of a Service Pool with the ReactorBukkitScheduler as its main scheduler. This should be used if you'd like to execute tasks while communicating on the main server thread.
      @@ -282,7 +282,7 @@ loadScripts(document, 'script');
    • getDefaultNamespacedKey

      -
      static org.bukkit.NamespacedKey getDefaultNamespacedKey()
      +
      static String getDefaultNamespacedKey()
      Returns:
      The default namespaced key to use if one is not assigned.
      @@ -331,8 +331,8 @@ loadScripts(document, 'script');
      Parameters:
      service - The name of the service to queue. This should be a service that is located within this service pool. - If you name a service that is stored within another service pool, - this method will throw an error.
      + If you name a service that is stored within another service pool, + this method will throw an error.
      Returns:
      A Mono object which contains a Disposable element which can be used to destroy the registered service.
      @@ -365,11 +365,11 @@ loadScripts(document, 'script');
    • -
      +

      stopService

      @NotNull public @NotNull reactor.core.publisher.Mono<Void> stopService(@NotNull - @NotNull org.bukkit.NamespacedKey service_name, + @NotNull String service_name, @Nullable @Nullable reactor.core.publisher.Mono<reactor.core.Disposable> disposable)
      @@ -382,10 +382,10 @@ loadScripts(document, 'script');
    • -
      +

      getService

      @NotNull -public @NotNull reactor.core.publisher.Mono<IService> getService(org.bukkit.NamespacedKey service_name)
      +public @NotNull reactor.core.publisher.Mono<IService> getService(String service_name)
    • Parameters:
      service_name - The name of the service to get.
      diff --git a/docs/io/github/simplexdevelopment/scheduler/package-summary.html b/docs/io/github/simplexdevelopment/scheduler/package-summary.html index e8bab64..38d79ba 100644 --- a/docs/io/github/simplexdevelopment/scheduler/package-summary.html +++ b/docs/io/github/simplexdevelopment/scheduler/package-summary.html @@ -1,7 +1,7 @@ - + io.github.simplexdevelopment.scheduler @@ -36,6 +36,7 @@ loadScripts(document, 'script');
    • Class
    • Tree
    • +
    • Deprecated
    • Index
    • Help
    @@ -75,14 +76,16 @@ loadScripts(document, 'script');
    Description
     
    - -
     
    -
    SchedulingSystem<T extends org.bukkit.plugin.java.JavaPlugin>
    -
     
    - +
     
    - +
     
    +
    SchedulingSystem<T extends org.bukkit.plugin.java.JavaPlugin>
    +
     
    + +
     
    + +
     
    diff --git a/docs/io/github/simplexdevelopment/scheduler/package-tree.html b/docs/io/github/simplexdevelopment/scheduler/package-tree.html index f21567d..06fdd8e 100644 --- a/docs/io/github/simplexdevelopment/scheduler/package-tree.html +++ b/docs/io/github/simplexdevelopment/scheduler/package-tree.html @@ -1,7 +1,7 @@ - + io.github.simplexdevelopment.scheduler Class Hierarchy @@ -32,6 +32,7 @@ loadScripts(document, 'script');
  • Package
  • Class
  • +
  • Deprecated
  • Index
  • Help
  • @@ -59,10 +60,11 @@ loadScripts(document, 'script');
    • java.lang.Object
        +
      • io.github.simplexdevelopment.scheduler.ExecutableService (implements io.github.simplexdevelopment.api.IService)
      • +
      • io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler (implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Worker)
      • java.lang.Record
        • io.github.simplexdevelopment.scheduler.BukkitDisposable (implements reactor.core.Disposable)
        • -
        • io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler (implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Worker)
      • io.github.simplexdevelopment.scheduler.SchedulingSystem<T> (implements io.github.simplexdevelopment.api.ISchedule)
      • diff --git a/docs/member-search-index.js b/docs/member-search-index.js index 12e206d..c70528e 100644 --- a/docs/member-search-index.js +++ b/docs/member-search-index.js @@ -1 +1 @@ -memberSearchIndex = [{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"addService(IService)","u":"addService(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"addToExistingPool(ServicePool, IService...)","u":"addToExistingPool(io.github.simplexdevelopment.scheduler.ServicePool,io.github.simplexdevelopment.api.IService...)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"associatedServices"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"BukkitDisposable(BukkitTask)","u":"%3Cinit%3E(org.bukkit.scheduler.BukkitTask)"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"cancel()"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"cancelled"},{"p":"io.github.simplexdevelopment.api","c":"Context","l":"contextCollection()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"createServicePool(NamespacedKey, IService...)","u":"createServicePool(org.bukkit.NamespacedKey,io.github.simplexdevelopment.api.IService...)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"createWorker()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"DEFAULT"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"delay"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"disposables"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"dispose()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"dispose()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"emptyServicePool(NamespacedKey, boolean)","u":"emptyServicePool(org.bukkit.NamespacedKey,boolean)"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"equals(Object)","u":"equals(java.lang.Object)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"equals(Object)","u":"equals(java.lang.Object)"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"ExecutableService(NamespacedKey)","u":"%3Cinit%3E(org.bukkit.NamespacedKey)"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"ExecutableService(ServicePool, NamespacedKey)","u":"%3Cinit%3E(io.github.simplexdevelopment.scheduler.ServicePool,org.bukkit.NamespacedKey)"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"ExecutableService(ServicePool, NamespacedKey, Long)","u":"%3Cinit%3E(io.github.simplexdevelopment.scheduler.ServicePool,org.bukkit.NamespacedKey,java.lang.Long)"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"ExecutableService(ServicePool, NamespacedKey, Long, Long, Boolean)","u":"%3Cinit%3E(io.github.simplexdevelopment.scheduler.ServicePool,org.bukkit.NamespacedKey,java.lang.Long,java.lang.Long,java.lang.Boolean)"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"ExecutableService(ServicePool, NamespacedKey, Long, Long, Boolean, Boolean)","u":"%3Cinit%3E(io.github.simplexdevelopment.scheduler.ServicePool,org.bukkit.NamespacedKey,java.lang.Long,java.lang.Long,java.lang.Boolean,java.lang.Boolean)"},{"p":"io.github.simplexdevelopment.api","c":"Context","l":"fluxFromCollection()"},{"p":"io.github.simplexdevelopment.api","c":"ISchedule","l":"forceStart(IService)","u":"forceStart(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"forceStart(IService)","u":"forceStart(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.api","c":"ISchedule","l":"forceStop(IService)","u":"forceStop(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"forceStop(IService)","u":"forceStop(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"getAssociatedServicePool(IService)","u":"getAssociatedServicePool(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"getAssociatedServices()"},{"p":"io.github.simplexdevelopment.api","c":"Context","l":"getContext()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"getDefaultNamespacedKey()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"getDefaultNamespacedKey()"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"getDelay()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"getDelay()"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"getMainScheduler()"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"getNamespacedKey()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"getNamespacedKey()"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"getParentPool()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"getParentPool()"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"getParentPool()"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"getPeriod()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"getPeriod()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"getPlugin()"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"getPlugin()"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"getProvidingPlugin()"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"getRepeatingPools()"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"getScheduler()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"getScheduler()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"getService(NamespacedKey)","u":"getService(org.bukkit.NamespacedKey)"},{"p":"io.github.simplexdevelopment.api","c":"ISchedule","l":"getServiceManager()"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"getServiceManager()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"getServicePools()"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"hashCode()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"hashCode()"},{"p":"io.github.simplexdevelopment.api","c":"InvalidServiceException","l":"InvalidServiceException(IService)","u":"%3Cinit%3E(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.api","c":"InvalidServiceException","l":"InvalidServiceException(Throwable)","u":"%3Cinit%3E(java.lang.Throwable)"},{"p":"io.github.simplexdevelopment.api","c":"InvalidServicePoolException","l":"InvalidServicePoolException()","u":"%3Cinit%3E()"},{"p":"io.github.simplexdevelopment.api","c":"InvalidServicePoolException","l":"InvalidServicePoolException(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"io.github.simplexdevelopment.api","c":"InvalidServicePoolException","l":"InvalidServicePoolException(Throwable)","u":"%3Cinit%3E(java.lang.Throwable)"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"isCancelled()"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"isDisposed()"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"isPeriodic()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"isPeriodic()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"isValidService(IService)","u":"isValidService(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"locateServiceWithinPools(IService)","u":"locateServiceWithinPools(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"Main()","u":"%3Cinit%3E()"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"mainScheduler"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"mayInterruptWhenRunning"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"multithreadedServicePool(NamespacedKey, IService...)","u":"multithreadedServicePool(org.bukkit.NamespacedKey,io.github.simplexdevelopment.api.IService...)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"name"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"newNamespacedKey(String, String)","u":"newNamespacedKey(java.lang.String,java.lang.String)"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"onDisable()"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"onEnable()"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"parentPool"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"period"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"plugin"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"plugin"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"plugin"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"plugin()"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"pool"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"queue(IService)","u":"queue(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.api","c":"ISchedule","l":"queue(IService)","u":"queue(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"queueService(IService)","u":"queueService(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"rbScheduler"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"ReactorBukkitScheduler(JavaPlugin, BukkitScheduler)","u":"%3Cinit%3E(org.bukkit.plugin.java.JavaPlugin,org.bukkit.scheduler.BukkitScheduler)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"recycle()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"removeService(IService)","u":"removeService(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"repeating"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"repeatingPools"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"run()"},{"p":"io.github.simplexdevelopment.api","c":"ISchedule","l":"runOnce(IService)","u":"runOnce(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"runOnce(IService)","u":"runOnce(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"schedule(Runnable)","u":"schedule(java.lang.Runnable)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"schedule(Runnable, long, TimeUnit)","u":"schedule(java.lang.Runnable,long,java.util.concurrent.TimeUnit)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"schedulePeriodically(Runnable, long, long, TimeUnit)","u":"schedulePeriodically(java.lang.Runnable,long,long,java.util.concurrent.TimeUnit)"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"scheduler"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"scheduler"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"scheduler"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"scheduler()"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"SchedulingSystem(T)","u":"%3Cinit%3E(T)"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"service_name"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"ServiceImpl(Main)","u":"%3Cinit%3E(io.github.simplexdevelopment.impl.Main)"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"serviceManager"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"ServiceManager()","u":"%3Cinit%3E()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"ServicePool(NamespacedKey, boolean)","u":"%3Cinit%3E(org.bukkit.NamespacedKey,boolean)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"ServicePool(NamespacedKey, JavaPlugin)","u":"%3Cinit%3E(org.bukkit.NamespacedKey,org.bukkit.plugin.java.JavaPlugin)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"servicePools"},{"p":"io.github.simplexdevelopment.api","c":"ExecutableService","l":"setCancelled(boolean)"},{"p":"io.github.simplexdevelopment.api","c":"Context","l":"setContext(S)"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"start()"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"start()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"startServices()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"stop()"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"stop()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"stopService(NamespacedKey, Mono)","u":"stopService(org.bukkit.NamespacedKey,reactor.core.publisher.Mono)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"stopServices(Flux)","u":"stopServices(reactor.core.publisher.Flux)"},{"p":"io.github.simplexdevelopment.api","c":"InvalidServicePoolException","l":"supplyException()"},{"p":"io.github.simplexdevelopment.api","c":"InvalidServiceException","l":"supplyException(IService)","u":"supplyException(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"takeFromExistingPool(ServicePool, IService...)","u":"takeFromExistingPool(io.github.simplexdevelopment.scheduler.ServicePool,io.github.simplexdevelopment.api.IService...)"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"task"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"task()"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"toString()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"toString()"}];updateSearchResults(); \ No newline at end of file +memberSearchIndex = [{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"addService(IService)","u":"addService(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"addToExistingPool(ServicePool, IService...)","u":"addToExistingPool(io.github.simplexdevelopment.scheduler.ServicePool,io.github.simplexdevelopment.api.IService...)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"associatedServices"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"BukkitDisposable(BukkitTask)","u":"%3Cinit%3E(org.bukkit.scheduler.BukkitTask)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"cancel()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"cancelled"},{"p":"io.github.simplexdevelopment.api","c":"Context","l":"contextCollection()"},{"p":"io.github.simplexdevelopment.impl","c":"PoolHolder","l":"contextCollection()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"createServicePool(String, IService...)","u":"createServicePool(java.lang.String,io.github.simplexdevelopment.api.IService...)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"createWorker()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"DEFAULT"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"delay"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"denom"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"disposables"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"dispose()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"dispose()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"emptyServicePool(String, boolean)","u":"emptyServicePool(java.lang.String,boolean)"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"equals(Object)","u":"equals(java.lang.Object)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"ExecutableService(ServicePool, String)","u":"%3Cinit%3E(io.github.simplexdevelopment.scheduler.ServicePool,java.lang.String)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"ExecutableService(ServicePool, String, Long)","u":"%3Cinit%3E(io.github.simplexdevelopment.scheduler.ServicePool,java.lang.String,java.lang.Long)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"ExecutableService(ServicePool, String, Long, Long, Boolean)","u":"%3Cinit%3E(io.github.simplexdevelopment.scheduler.ServicePool,java.lang.String,java.lang.Long,java.lang.Long,java.lang.Boolean)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"ExecutableService(ServicePool, String, Long, Long, Boolean, Boolean)","u":"%3Cinit%3E(io.github.simplexdevelopment.scheduler.ServicePool,java.lang.String,java.lang.Long,java.lang.Long,java.lang.Boolean,java.lang.Boolean)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"ExecutableService(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"io.github.simplexdevelopment.api","c":"Context","l":"fluxFromCollection()"},{"p":"io.github.simplexdevelopment.api","c":"ISchedule","l":"forceStart(IService)","u":"forceStart(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"forceStart(IService)","u":"forceStart(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.api","c":"ISchedule","l":"forceStop(IService)","u":"forceStop(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"forceStop(IService)","u":"forceStop(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"getAssociatedServicePool(IService)","u":"getAssociatedServicePool(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"getAssociatedServices()"},{"p":"io.github.simplexdevelopment.api","c":"Context","l":"getContext()"},{"p":"io.github.simplexdevelopment.impl","c":"PoolHolder","l":"getContext()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"getDefaultNamespacedKey()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"getDelay()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"getDelay()"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"getMainScheduler()"},{"p":"io.github.simplexdevelopment.api","c":"Identifier","l":"getName()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"getName()"},{"p":"io.github.simplexdevelopment.api","c":"Identifier","l":"getNumericalId()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"getParentPool()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"getParentPool()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"getPeriod()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"getPeriod()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"getPlugin()"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"getPlugin()"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"getProvidingPlugin()"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"getScheduler()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"getScheduler()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"getService(String)","u":"getService(java.lang.String)"},{"p":"io.github.simplexdevelopment.api","c":"ISchedule","l":"getServiceManager()"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"getServiceManager()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"getServicePools()"},{"p":"io.github.simplexdevelopment.api","c":"Identifier","l":"getUniqueId()"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"hashCode()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"isCancelled()"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"isDisposed()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"isPeriodic()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"isPeriodic()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"isValidService(IService)","u":"isValidService(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"locateServiceWithinPools(IService)","u":"locateServiceWithinPools(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"Main()","u":"%3Cinit%3E()"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"mainScheduler"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"mayInterruptWhenRunning"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"multithreadedServicePool(String, IService...)","u":"multithreadedServicePool(java.lang.String,io.github.simplexdevelopment.api.IService...)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"name"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"onDisable()"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"onEnable()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"parentPool"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"period"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"plugin"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"plugin"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"plugin"},{"p":"io.github.simplexdevelopment.impl","c":"PoolHolder","l":"PoolHolder(Main)","u":"%3Cinit%3E(io.github.simplexdevelopment.impl.Main)"},{"p":"io.github.simplexdevelopment.api","c":"ISchedule","l":"queue(IService)","u":"queue(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"queue(IService)","u":"queue(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"queueService(IService)","u":"queueService(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"ReactorBukkitScheduler(JavaPlugin)","u":"%3Cinit%3E(org.bukkit.plugin.java.JavaPlugin)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"recycle()"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"registerServices(PoolHolder)","u":"registerServices(io.github.simplexdevelopment.impl.PoolHolder)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"removeService(IService)","u":"removeService(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"repeating"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"run()"},{"p":"io.github.simplexdevelopment.api","c":"ISchedule","l":"runOnce(IService)","u":"runOnce(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"runOnce(IService)","u":"runOnce(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"schedule(Runnable)","u":"schedule(java.lang.Runnable)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"schedule(Runnable, long, TimeUnit)","u":"schedule(java.lang.Runnable,long,java.util.concurrent.TimeUnit)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"schedulePeriodically(Runnable, long, long, TimeUnit)","u":"schedulePeriodically(java.lang.Runnable,long,long,java.util.concurrent.TimeUnit)"},{"p":"io.github.simplexdevelopment.impl","c":"Main","l":"scheduler"},{"p":"io.github.simplexdevelopment.scheduler","c":"ReactorBukkitScheduler","l":"scheduler"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"scheduler"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"SchedulingSystem(T)","u":"%3Cinit%3E(T)"},{"p":"io.github.simplexdevelopment.impl","c":"PoolHolder","l":"selectedPool"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"service_name"},{"p":"io.github.simplexdevelopment.api","c":"ServiceException","l":"ServiceException(IService)","u":"%3Cinit%3E(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.api","c":"ServiceException","l":"ServiceException(Throwable)","u":"%3Cinit%3E(java.lang.Throwable)"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"ServiceImpl(Main, ServicePool)","u":"%3Cinit%3E(io.github.simplexdevelopment.impl.Main,io.github.simplexdevelopment.scheduler.ServicePool)"},{"p":"io.github.simplexdevelopment.scheduler","c":"SchedulingSystem","l":"serviceManager"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"ServiceManager()","u":"%3Cinit%3E()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"ServicePool(String, boolean)","u":"%3Cinit%3E(java.lang.String,boolean)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"ServicePool(String, JavaPlugin)","u":"%3Cinit%3E(java.lang.String,org.bukkit.plugin.java.JavaPlugin)"},{"p":"io.github.simplexdevelopment.impl","c":"PoolHolder","l":"servicePoolCollection"},{"p":"io.github.simplexdevelopment.api","c":"ServicePoolException","l":"ServicePoolException()","u":"%3Cinit%3E()"},{"p":"io.github.simplexdevelopment.api","c":"ServicePoolException","l":"ServicePoolException(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"io.github.simplexdevelopment.api","c":"ServicePoolException","l":"ServicePoolException(Throwable)","u":"%3Cinit%3E(java.lang.Throwable)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"servicePools"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"setCancelled(boolean)"},{"p":"io.github.simplexdevelopment.api","c":"Context","l":"setContext(S)"},{"p":"io.github.simplexdevelopment.impl","c":"PoolHolder","l":"setContext(ServicePool)","u":"setContext(io.github.simplexdevelopment.scheduler.ServicePool)"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"setParentPool(ServicePool)","u":"setParentPool(io.github.simplexdevelopment.scheduler.ServicePool)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ExecutableService","l":"setParentPool(ServicePool)","u":"setParentPool(io.github.simplexdevelopment.scheduler.ServicePool)"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"start()"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"start()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"startServices()"},{"p":"io.github.simplexdevelopment.api","c":"IService","l":"stop()"},{"p":"io.github.simplexdevelopment.impl","c":"ServiceImpl","l":"stop()"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"stopService(String, Mono)","u":"stopService(java.lang.String,reactor.core.publisher.Mono)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServicePool","l":"stopServices(Flux)","u":"stopServices(reactor.core.publisher.Flux)"},{"p":"io.github.simplexdevelopment.api","c":"ServicePoolException","l":"supplyException()"},{"p":"io.github.simplexdevelopment.api","c":"ServiceException","l":"supplyException(IService)","u":"supplyException(io.github.simplexdevelopment.api.IService)"},{"p":"io.github.simplexdevelopment.scheduler","c":"ServiceManager","l":"takeFromExistingPool(ServicePool, IService...)","u":"takeFromExistingPool(io.github.simplexdevelopment.scheduler.ServicePool,io.github.simplexdevelopment.api.IService...)"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"task"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"task()"},{"p":"io.github.simplexdevelopment.scheduler","c":"BukkitDisposable","l":"toString()"}];updateSearchResults(); \ No newline at end of file diff --git a/docs/overview-summary.html b/docs/overview-summary.html index f6dc9a5..1f464c9 100644 --- a/docs/overview-summary.html +++ b/docs/overview-summary.html @@ -1,7 +1,7 @@ - + Generated Documentation (Untitled) diff --git a/docs/overview-tree.html b/docs/overview-tree.html index ed5f22b..8d6c76c 100644 --- a/docs/overview-tree.html +++ b/docs/overview-tree.html @@ -1,7 +1,7 @@ - + Class Hierarchy @@ -32,6 +32,7 @@ loadScripts(document, 'script');
      • Package
      • Class
      • +
      • Deprecated
      • Index
      • Help
      @@ -61,7 +62,7 @@ loadScripts(document, 'script');
      • java.lang.Object
          -
        • io.github.simplexdevelopment.api.ExecutableService (implements io.github.simplexdevelopment.api.IService) +
        • io.github.simplexdevelopment.scheduler.ExecutableService (implements io.github.simplexdevelopment.api.IService) @@ -75,10 +76,11 @@ loadScripts(document, 'script');
      • +
      • io.github.simplexdevelopment.impl.PoolHolder (implements io.github.simplexdevelopment.api.Context<S>)
      • +
      • io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler (implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Worker)
      • java.lang.Record
        • io.github.simplexdevelopment.scheduler.BukkitDisposable (implements reactor.core.Disposable)
        • -
        • io.github.simplexdevelopment.scheduler.ReactorBukkitScheduler (implements reactor.core.scheduler.Scheduler, reactor.core.scheduler.Scheduler.Worker)
      • io.github.simplexdevelopment.scheduler.SchedulingSystem<T> (implements io.github.simplexdevelopment.api.ISchedule)
      • @@ -90,8 +92,8 @@ loadScripts(document, 'script'); @@ -106,10 +108,15 @@ loadScripts(document, 'script');

        Interface Hierarchy

        • io.github.simplexdevelopment.api.Context<S>
        • +
        • io.github.simplexdevelopment.api.Identifier + +
        • io.github.simplexdevelopment.api.ISchedule
        • java.lang.Runnable
            -
          • io.github.simplexdevelopment.api.IService
          • +
          • io.github.simplexdevelopment.api.IService (also extends io.github.simplexdevelopment.api.Identifier)
        diff --git a/docs/serialized-form.html b/docs/serialized-form.html index b6e0548..0df8a68 100644 --- a/docs/serialized-form.html +++ b/docs/serialized-form.html @@ -1,7 +1,7 @@ - + Serialized Form @@ -32,6 +32,7 @@ loadScripts(document, 'script');
      • Package
      • Class
      • Tree
      • +
      • Deprecated
      • Index
      • Help
      @@ -56,15 +57,15 @@ loadScripts(document, 'script');

      Package io.github.simplexdevelopment.api

      diff --git a/docs/tag-search-index.js b/docs/tag-search-index.js index f38b3cb..bf10aaf 100644 --- a/docs/tag-search-index.js +++ b/docs/tag-search-index.js @@ -1 +1 @@ -tagSearchIndex = [{"l":"Serialized Form","h":"","u":"serialized-form.html"}];updateSearchResults(); \ No newline at end of file +tagSearchIndex = [{"l":"Constant Field Values","h":"","u":"constant-values.html"},{"l":"Serialized Form","h":"","u":"serialized-form.html"}];updateSearchResults(); \ No newline at end of file diff --git a/docs/type-search-index.js b/docs/type-search-index.js index fba3818..66f278f 100644 --- a/docs/type-search-index.js +++ b/docs/type-search-index.js @@ -1 +1 @@ -typeSearchIndex = [{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"io.github.simplexdevelopment.scheduler","l":"BukkitDisposable"},{"p":"io.github.simplexdevelopment.api","l":"Context"},{"p":"io.github.simplexdevelopment.api","l":"ExecutableService"},{"p":"io.github.simplexdevelopment.api","l":"InvalidServiceException"},{"p":"io.github.simplexdevelopment.api","l":"InvalidServicePoolException"},{"p":"io.github.simplexdevelopment.api","l":"ISchedule"},{"p":"io.github.simplexdevelopment.api","l":"IService"},{"p":"io.github.simplexdevelopment.impl","l":"Main"},{"p":"io.github.simplexdevelopment.scheduler","l":"ReactorBukkitScheduler"},{"p":"io.github.simplexdevelopment.scheduler","l":"SchedulingSystem"},{"p":"io.github.simplexdevelopment.impl","l":"ServiceImpl"},{"p":"io.github.simplexdevelopment.scheduler","l":"ServiceManager"},{"p":"io.github.simplexdevelopment.scheduler","l":"ServicePool"}];updateSearchResults(); \ No newline at end of file +typeSearchIndex = [{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"io.github.simplexdevelopment.scheduler","l":"BukkitDisposable"},{"p":"io.github.simplexdevelopment.api","l":"Context"},{"p":"io.github.simplexdevelopment.scheduler","l":"ExecutableService"},{"p":"io.github.simplexdevelopment.api","l":"Identifier"},{"p":"io.github.simplexdevelopment.api","l":"ISchedule"},{"p":"io.github.simplexdevelopment.api","l":"IService"},{"p":"io.github.simplexdevelopment.impl","l":"Main"},{"p":"io.github.simplexdevelopment.impl","l":"PoolHolder"},{"p":"io.github.simplexdevelopment.scheduler","l":"ReactorBukkitScheduler"},{"p":"io.github.simplexdevelopment.scheduler","l":"SchedulingSystem"},{"p":"io.github.simplexdevelopment.api","l":"ServiceException"},{"p":"io.github.simplexdevelopment.impl","l":"ServiceImpl"},{"p":"io.github.simplexdevelopment.scheduler","l":"ServiceManager"},{"p":"io.github.simplexdevelopment.scheduler","l":"ServicePool"},{"p":"io.github.simplexdevelopment.api","l":"ServicePoolException"}];updateSearchResults(); \ No newline at end of file diff --git a/src/main/java/io/github/simplexdevelopment/api/Context.java b/src/main/java/io/github/simplexdevelopment/api/Context.java index 2c0becd..3d9e688 100644 --- a/src/main/java/io/github/simplexdevelopment/api/Context.java +++ b/src/main/java/io/github/simplexdevelopment/api/Context.java @@ -1,31 +1,34 @@ package io.github.simplexdevelopment.api; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.util.Collection; +import java.util.Objects; public interface Context { /** * @return A Mono object which contains a single element represented by the definer of this Context class. */ - Mono getContext(); + @NotNull Mono getContext(); /** * @param context A separate (or identical) object identified by the definer of this Context class. * @return A Mono object which can be used to set the element of this Context class in a non-blocking manner. */ - Mono setContext(S context); + @NotNull Mono setContext(S context); /** * @return A collection of objects related to the definer of this Context class. */ - Collection contextCollection(); + @Nullable Collection contextCollection(); /** * @return A Flux object which contains the values of the {@link Context#contextCollection()}, for non-blocking interpretation. */ - default Flux fluxFromCollection() { - return Flux.fromIterable(contextCollection()); + default @Nullable Flux fluxFromCollection() { + return contextCollection() == null ? null : Flux.fromIterable(Objects.requireNonNull(contextCollection())); } } diff --git a/src/main/java/io/github/simplexdevelopment/api/ISchedule.java b/src/main/java/io/github/simplexdevelopment/api/ISchedule.java index c5e5545..656dc23 100644 --- a/src/main/java/io/github/simplexdevelopment/api/ISchedule.java +++ b/src/main/java/io/github/simplexdevelopment/api/ISchedule.java @@ -1,7 +1,8 @@ package io.github.simplexdevelopment.api; import io.github.simplexdevelopment.scheduler.ServiceManager; -import io.github.simplexdevelopment.scheduler.ServicePool; +import org.jetbrains.annotations.NotNull; +import reactor.core.Disposable; import reactor.core.publisher.Mono; public interface ISchedule { @@ -12,11 +13,12 @@ public interface ISchedule { Mono getServiceManager(); /** + * Queues a service to be executed in a service pool. + * * @param service The service to use to locate the associated service pool and queue the service for execution. - * @return A Mono that can be used to prepare the service for execution within it's associated service pool. - * If the service has no associated pool, a new pool will be created. + * @return A Mono that can be used to cancel the service. */ - Mono queue(IService service); + @NotNull Mono queue(@NotNull IService service); /** * @param service The service to run once. @@ -35,4 +37,4 @@ public interface ISchedule { * @return A Mono object which can be used to forcefully start the service with {@link Mono#subscribe()}. */ Mono forceStart(IService service); -} +} \ No newline at end of file diff --git a/src/main/java/io/github/simplexdevelopment/api/IService.java b/src/main/java/io/github/simplexdevelopment/api/IService.java index e900228..6201b35 100644 --- a/src/main/java/io/github/simplexdevelopment/api/IService.java +++ b/src/main/java/io/github/simplexdevelopment/api/IService.java @@ -1,22 +1,12 @@ package io.github.simplexdevelopment.api; import io.github.simplexdevelopment.scheduler.ServicePool; -import org.bukkit.NamespacedKey; import org.bukkit.plugin.java.JavaPlugin; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import reactor.core.publisher.Mono; -public interface IService extends Runnable { - @Contract(" -> new") - static @NotNull NamespacedKey getDefaultNamespacedKey() { - return new NamespacedKey("simplex_ss", "default_service_name"); - } - - /** - * @return The NamespacedKey of this service. - */ - NamespacedKey getNamespacedKey(); +public interface IService extends Runnable, Identifier { /** * @return If the service should be scheduled for repeated executions or not. @@ -60,24 +50,16 @@ public interface IService extends Runnable { */ Mono getParentPool(); + /** + * Sets the parent pool for this service. + * + * @param servicePool The service pool to attach this service to. + * @return An encapsulated Mono object representing the set operation. + */ + Mono setParentPool(ServicePool servicePool); + @Override default void run() { - start().subscribeOn(getParentPool() - .map(ServicePool::getScheduler) - .blockOptional() - .orElseThrow(InvalidServicePoolException.supplyException())) - .subscribe(); - } - - /** - * This is an easy static call for creating a new namespaced key for services and service pools. - * - * @param space The namespace of the service. - * @param key The key name of the service. - * @return A NamespacedKey object representing the service. - */ - @Contract("_, _ -> new") - static @NotNull NamespacedKey newNamespacedKey(String space, String key) { - return new NamespacedKey(space, key); + start().subscribe(); } } diff --git a/src/main/java/io/github/simplexdevelopment/api/Identifier.java b/src/main/java/io/github/simplexdevelopment/api/Identifier.java new file mode 100644 index 0000000..c29e7c4 --- /dev/null +++ b/src/main/java/io/github/simplexdevelopment/api/Identifier.java @@ -0,0 +1,26 @@ +package io.github.simplexdevelopment.api; + +import java.util.UUID; + +public interface Identifier { + /** + * @return The name of the identifiable object in a readable format. + */ + String getName(); + + /** + * @return The UUID of the identifiable object, based on the {@link Identifier#getName()} value. + * This is calculated using {@link UUID#nameUUIDFromBytes(byte[])}. + */ + default UUID getUniqueId() { + return UUID.nameUUIDFromBytes(getName().getBytes()); + } + + /** + * @return The numerical id of the identifiable object, based on the {@link Identifier#getUniqueId()} value. + * This is calculated using {@link UUID#hashCode()}. + */ + default int getNumericalId() { + return getUniqueId().hashCode(); + } +} diff --git a/src/main/java/io/github/simplexdevelopment/api/InvalidServiceException.java b/src/main/java/io/github/simplexdevelopment/api/InvalidServiceException.java deleted file mode 100644 index 7306a85..0000000 --- a/src/main/java/io/github/simplexdevelopment/api/InvalidServiceException.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.github.simplexdevelopment.api; - -import java.util.function.Supplier; - -public class InvalidServiceException extends RuntimeException { - public InvalidServiceException(IService service) { - super("The service " + service.getNamespacedKey().getKey() + " is not present within any service pool."); - } - - public InvalidServiceException(Throwable th) { - super(th); - } - - public static Supplier supplyException(IService service) { - return () -> new InvalidServiceException(service); - } -} diff --git a/src/main/java/io/github/simplexdevelopment/api/InvalidServicePoolException.java b/src/main/java/io/github/simplexdevelopment/api/InvalidServicePoolException.java deleted file mode 100644 index 3ac425c..0000000 --- a/src/main/java/io/github/simplexdevelopment/api/InvalidServicePoolException.java +++ /dev/null @@ -1,25 +0,0 @@ -package io.github.simplexdevelopment.api; - -import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.NotNull; - -import java.util.function.Supplier; - -public class InvalidServicePoolException extends RuntimeException { - public InvalidServicePoolException() { - super("There is no service pool associated with this service. The service will be automatically recycled."); - } - - public InvalidServicePoolException(@NotNull String string) { - super(string); - } - - public InvalidServicePoolException(Throwable ex) { - super(ex); - } - - @Contract(pure = true) - public static @NotNull Supplier supplyException() { - return InvalidServicePoolException::new; - } -} diff --git a/src/main/java/io/github/simplexdevelopment/api/ServiceException.java b/src/main/java/io/github/simplexdevelopment/api/ServiceException.java new file mode 100644 index 0000000..506b73f --- /dev/null +++ b/src/main/java/io/github/simplexdevelopment/api/ServiceException.java @@ -0,0 +1,29 @@ +package io.github.simplexdevelopment.api; + +import java.util.function.Supplier; + +public class ServiceException extends RuntimeException { + /** + * Constructs a new service exception which states the service is not present within any service pools. + * + * @param service The service that threw the exception. + */ + public ServiceException(IService service) { + super("The service " + service.getName() + " is not present within any service pool."); + } + + /** + * @param th The throwable that was thrown. + */ + public ServiceException(Throwable th) { + super(th); + } + + /** + * @param service The service that threw the exception. + * @return A supplier that can be used in conjunction with Reactor. + */ + public static Supplier supplyException(IService service) { + return () -> new ServiceException(service); + } +} diff --git a/src/main/java/io/github/simplexdevelopment/api/ServicePoolException.java b/src/main/java/io/github/simplexdevelopment/api/ServicePoolException.java new file mode 100644 index 0000000..6f58f4f --- /dev/null +++ b/src/main/java/io/github/simplexdevelopment/api/ServicePoolException.java @@ -0,0 +1,38 @@ +package io.github.simplexdevelopment.api; + +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + +import java.util.function.Supplier; + +public class ServicePoolException extends RuntimeException { + /** + * Constructs a new generic service pool exception. + * This will be thrown when a service attempts to execute without an associated service pool. + */ + public ServicePoolException() { + super("There is no service pool associated with this service. The service will be automatically recycled."); + } + + /** + * @param string The message to be displayed when the exception is thrown. + */ + public ServicePoolException(@NotNull String string) { + super(string); + } + + /** + * @param ex The exception to be thrown. + */ + public ServicePoolException(Throwable ex) { + super(ex); + } + + /** + * @return A supplier which can be used in conjunction with Reactor. + */ + @Contract(pure = true) + public static @NotNull Supplier supplyException() { + return ServicePoolException::new; + } +} diff --git a/src/main/java/io/github/simplexdevelopment/impl/Main.java b/src/main/java/io/github/simplexdevelopment/impl/Main.java index d618d7a..4b628df 100644 --- a/src/main/java/io/github/simplexdevelopment/impl/Main.java +++ b/src/main/java/io/github/simplexdevelopment/impl/Main.java @@ -1,29 +1,32 @@ package io.github.simplexdevelopment.impl; -import io.github.simplexdevelopment.api.IService; import io.github.simplexdevelopment.scheduler.SchedulingSystem; -import io.github.simplexdevelopment.scheduler.ServiceManager; -import io.github.simplexdevelopment.scheduler.ServicePool; import org.bukkit.plugin.java.JavaPlugin; +import org.jetbrains.annotations.NotNull; import reactor.core.Disposable; import reactor.core.publisher.Flux; +import java.util.HashSet; import java.util.Objects; +import java.util.Set; public class Main extends JavaPlugin { - public ServicePool pool = new ServicePool(IService.newNamespacedKey("pool", "one"), true); private SchedulingSystem
      scheduler; private Flux disposables; @Override public void onEnable() { + // Plugin startup logic + // Create a new instance of the scheduling system. this.scheduler = new SchedulingSystem<>(this); - IService service = new ServiceImpl(this); - service.getParentPool().subscribe(element -> disposables = element.startServices()); + // This will register all the services and set our Flux object above. + registerServices(new PoolHolder(this)); } @Override public void onDisable() { + // Plugin shutdown logic + // This will dispose of all the services we have previously registered in our Flux object. scheduler.getServiceManager().subscribe(manager -> { manager.getServicePools().doOnEach(signal -> Objects.requireNonNull(signal.get()) .stopServices(disposables) @@ -31,6 +34,27 @@ public class Main extends JavaPlugin { }); } + public void registerServices(@NotNull PoolHolder poolHolder) { + // This set will be used to set the Flux object + // that will be used to stop the services when the plugin is disabled. + Set dispos = new HashSet<>(); + + // Register services here + ServiceImpl impl = new ServiceImpl(this, poolHolder.getContext().block()); + + // This will register the service to the service pool. + dispos.add(scheduler.getMainScheduler().schedule(impl)); + // OR + scheduler.queue(impl).subscribe(dispos::add); + // OR + scheduler.getServiceManager() + .flatMap(manager -> manager.createServicePool("newPool", impl)) + .subscribe(p -> p.queueService(impl).subscribe(dispos::add)); + + // This will set the Flux object on our previously made set, so that we can use it later on. + disposables = Flux.fromIterable(dispos); + } + public SchedulingSystem
      getScheduler() { return this.scheduler; } diff --git a/src/main/java/io/github/simplexdevelopment/impl/PoolHolder.java b/src/main/java/io/github/simplexdevelopment/impl/PoolHolder.java new file mode 100644 index 0000000..c1e1c3d --- /dev/null +++ b/src/main/java/io/github/simplexdevelopment/impl/PoolHolder.java @@ -0,0 +1,36 @@ +package io.github.simplexdevelopment.impl; + +import io.github.simplexdevelopment.api.Context; +import io.github.simplexdevelopment.scheduler.ServicePool; +import org.jetbrains.annotations.NotNull; +import reactor.core.publisher.Mono; + +import java.util.ArrayList; +import java.util.Collection; + +public class PoolHolder implements Context { + private final Collection servicePoolCollection = new ArrayList<>(); + private ServicePool selectedPool; + + public PoolHolder(Main plugin) { + this.servicePoolCollection.add(new ServicePool("Pool-One", plugin)); + this.servicePoolCollection.add(new ServicePool("Pool-Two", true)); + this.servicePoolCollection.add(new ServicePool("Pool-Three", false)); + this.selectedPool = servicePoolCollection.stream().findFirst().orElseGet(() -> new ServicePool("Default", plugin)); + } + + @Override + public @NotNull Mono getContext() { + return Mono.just(selectedPool); + } + + @Override + public @NotNull Mono setContext(ServicePool context) { + return Mono.just(context).doOnNext(pool -> this.selectedPool = pool).then(); + } + + @Override + public Collection contextCollection() { + return servicePoolCollection; + } +} diff --git a/src/main/java/io/github/simplexdevelopment/impl/ServiceImpl.java b/src/main/java/io/github/simplexdevelopment/impl/ServiceImpl.java index 781a293..ab6c470 100644 --- a/src/main/java/io/github/simplexdevelopment/impl/ServiceImpl.java +++ b/src/main/java/io/github/simplexdevelopment/impl/ServiceImpl.java @@ -1,7 +1,6 @@ package io.github.simplexdevelopment.impl; -import io.github.simplexdevelopment.api.ExecutableService; -import io.github.simplexdevelopment.api.IService; +import io.github.simplexdevelopment.scheduler.ExecutableService; import io.github.simplexdevelopment.scheduler.ServicePool; import org.bukkit.plugin.java.JavaPlugin; import reactor.core.publisher.Mono; @@ -9,8 +8,8 @@ import reactor.core.publisher.Mono; public class ServiceImpl extends ExecutableService { private final Main plugin; - public ServiceImpl(Main plugin) { - super(plugin.pool, IService.getDefaultNamespacedKey(), 0L, 20 * 60 * 20L, true, false); + public ServiceImpl(Main plugin, ServicePool pool) { + super(pool, "default", 0L, 20 * 60 * 20L, true, false); this.plugin = plugin; } @@ -34,12 +33,4 @@ public class ServiceImpl extends ExecutableService { public Main getPlugin() { return plugin; } - - @Override - public Mono getParentPool() { - return getPlugin() - .getScheduler() - .getServiceManager() - .flatMap(manager -> manager.getAssociatedServicePool(this)); - } } diff --git a/src/main/java/io/github/simplexdevelopment/api/ExecutableService.java b/src/main/java/io/github/simplexdevelopment/scheduler/ExecutableService.java similarity index 74% rename from src/main/java/io/github/simplexdevelopment/api/ExecutableService.java rename to src/main/java/io/github/simplexdevelopment/scheduler/ExecutableService.java index 8999d20..870a2c5 100644 --- a/src/main/java/io/github/simplexdevelopment/api/ExecutableService.java +++ b/src/main/java/io/github/simplexdevelopment/scheduler/ExecutableService.java @@ -1,7 +1,6 @@ -package io.github.simplexdevelopment.api; +package io.github.simplexdevelopment.scheduler; -import io.github.simplexdevelopment.scheduler.ServicePool; -import org.bukkit.NamespacedKey; +import io.github.simplexdevelopment.api.IService; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -10,43 +9,75 @@ import reactor.core.publisher.Mono; import java.util.Objects; public abstract class ExecutableService implements IService { - private final NamespacedKey service_name; + /** + * The name of the service. + */ + private final String service_name; + /** + * How long the service should wait before executing the first time. + */ private final long delay; + /** + * How long the service should wait between executions. + */ private final long period; + /** + * If the service should be executed once or continuously. + */ private final boolean repeating; + /** + * If the service should be allowed to stop while executing. + */ private final boolean mayInterruptWhenRunning; - - private boolean cancelled = false; + /** + * The service's execution thread. + */ private ServicePool parentPool; + /** + * Whether the service has been cancelled or not. + */ + private boolean cancelled = false; /** * Creates a new instance of an executable service. - * Each service is registered with a {@link NamespacedKey}, + * Each service is registered with a {@link String}, * to allow for easy identification within the associated {@link ServicePool}. * * @param service_name A namespaced key which can be used to identify the service. */ - public ExecutableService(@NotNull NamespacedKey service_name) { - this((new ServicePool(IService.newNamespacedKey("", ""), false)), service_name, 0L, 0L, false, false); + public ExecutableService(@NotNull String service_name) { + this((new ServicePool("defaultPool" + SchedulingSystem.denom, false)), + service_name, + 0L, + 0L, + false, + false); + + SchedulingSystem.denom++; } /** * Creates a new instance of an executable service. - * Each service is registered with a {@link NamespacedKey}, + * Each service is registered with a {@link String}, * to allow for easy identification within the associated {@link ServicePool}. * * @param parentPool The {@link ServicePool} which this service is executing on. * @param service_name A namespaced key which can be used to identify the service. */ - public ExecutableService(@Nullable ServicePool parentPool, @NotNull NamespacedKey service_name) { - this(parentPool, service_name, 0L, 0L, false, false); + public ExecutableService(@Nullable ServicePool parentPool, @NotNull String service_name) { + this(parentPool, + service_name, + 0L, + 0L, + false, + false); } /** * Creates a new instance of an executable service. * The timings are measured in ticks (20 ticks per second). * You do not need to explicitly define a delay. - * Each service is registered with a {@link NamespacedKey}, + * Each service is registered with a {@link String}, * to allow for easy identification within the associated {@link ServicePool}. * * @param parentPool The {@link ServicePool} which this service is executing on. @@ -55,9 +86,14 @@ public abstract class ExecutableService implements IService { */ public ExecutableService( @Nullable ServicePool parentPool, - @NotNull NamespacedKey service_name, + @NotNull String service_name, @Nullable Long delay) { - this(parentPool, service_name, delay, 0L, false, false); + this(parentPool, + service_name, + delay, + 0L, + false, + false); } /** @@ -66,7 +102,7 @@ public abstract class ExecutableService implements IService { * You do not need to explicitly define a delay or a period, * however if you have flagged {@link #repeating} as true, and the period is null, * then the period will automatically be set to 20 minutes. - * Each service is registered with a {@link NamespacedKey}, + * Each service is registered with a {@link String}, * to allow for easy identification within the associated {@link ServicePool}. * * @param parentPool The {@link ServicePool} which this service is executing on. @@ -77,11 +113,15 @@ public abstract class ExecutableService implements IService { */ public ExecutableService( @Nullable ServicePool parentPool, - @NotNull NamespacedKey service_name, + @NotNull String service_name, @NotNull Long delay, @NotNull Long period, @NotNull Boolean repeating) { - this(parentPool, service_name, delay, period, repeating, false); + this(parentPool, + service_name, + delay, period, + repeating, + false); } /** @@ -90,7 +130,7 @@ public abstract class ExecutableService implements IService { * You do not need to explicitly define a delay or a period, * however if you have flagged {@link #repeating} as true, and the period is null, * then the period will automatically be set to 20 minutes. - * Each service is registered with a {@link NamespacedKey}, + * Each service is registered with a {@link String}, * to allow for easy identification within the associated {@link ServicePool}. * * @param parentPool The {@link ServicePool} which this service is executing on. @@ -102,7 +142,7 @@ public abstract class ExecutableService implements IService { */ public ExecutableService( @Nullable ServicePool parentPool, - @NotNull NamespacedKey service_name, + @NotNull String service_name, @Nullable Long delay, @Nullable Long period, @NotNull Boolean repeating, @@ -115,11 +155,6 @@ public abstract class ExecutableService implements IService { this.parentPool = parentPool; } - @Override - public NamespacedKey getNamespacedKey() { - return service_name; - } - @Override public long getDelay() { return delay; @@ -173,4 +208,14 @@ public abstract class ExecutableService implements IService { public Mono getParentPool() { return Mono.just(parentPool); } + + @Override + public String getName() { + return service_name; + } + + @Override + public Mono setParentPool(ServicePool servicePool) { + return Mono.just(servicePool).doOnNext(pool -> this.parentPool = pool).then(); + } } diff --git a/src/main/java/io/github/simplexdevelopment/scheduler/ReactorBukkitScheduler.java b/src/main/java/io/github/simplexdevelopment/scheduler/ReactorBukkitScheduler.java index b0904e8..352e002 100644 --- a/src/main/java/io/github/simplexdevelopment/scheduler/ReactorBukkitScheduler.java +++ b/src/main/java/io/github/simplexdevelopment/scheduler/ReactorBukkitScheduler.java @@ -40,7 +40,7 @@ public final class ReactorBukkitScheduler * @return A disposable that can be used to cancel the task. */ @Override - public @NotNull Disposable schedule(@NotNull Runnable task, long delay, @Nullable TimeUnit unit) { + public @NotNull Disposable schedule(@NotNull Runnable task, long delay, @Deprecated @Nullable TimeUnit unit) { return new BukkitDisposable(scheduler.runTaskLater(plugin, task, delay)); } @@ -56,7 +56,7 @@ public final class ReactorBukkitScheduler * @return A disposable that can be used to cancel the task. */ @Override - public @NotNull Disposable schedulePeriodically(@NotNull Runnable task, long initialDelay, long period, @Nullable TimeUnit unit) { + public @NotNull Disposable schedulePeriodically(@NotNull Runnable task, long initialDelay, long period, @Deprecated @Nullable TimeUnit unit) { if (period <= 0L) { throw new IllegalArgumentException("Period must be greater than 0L"); } @@ -78,6 +78,7 @@ public final class ReactorBukkitScheduler * This method does nothing and is unused. */ @Override + @Deprecated public void dispose() { } } diff --git a/src/main/java/io/github/simplexdevelopment/scheduler/SchedulingSystem.java b/src/main/java/io/github/simplexdevelopment/scheduler/SchedulingSystem.java index 61416a7..2efabee 100644 --- a/src/main/java/io/github/simplexdevelopment/scheduler/SchedulingSystem.java +++ b/src/main/java/io/github/simplexdevelopment/scheduler/SchedulingSystem.java @@ -6,40 +6,39 @@ import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitScheduler; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; +import reactor.core.Disposable; import reactor.core.publisher.Mono; -import reactor.core.scheduler.Scheduler; -import reactor.core.scheduler.Schedulers; - -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; public final class SchedulingSystem implements ISchedule { + /** + * A denominator to use when registering default service pool names. + */ + static int denom = 0; + /** + * The service manager to use for controlling service pools. + */ private final ServiceManager serviceManager; + /** + * The plugin to use for registering tasks. This should be an instance of your plugin. + */ private final T plugin; - private final Set repeatingPools; + /** + * The main scheduler which this system runs on. This is an abstraction of the {@link BukkitScheduler}, + * and as a result runs on the Main server thread. + */ private final ReactorBukkitScheduler mainScheduler; /** * Creates a new instance of the scheduling system. This is used to manage the scheduling of services. * - * @param plugin The plugin to use for this scheduling system. This should be an instance of your plugin. + * @param plugin The plugin to use for this scheduling system. This should be an instance of your plugin. */ public SchedulingSystem(T plugin) { this.serviceManager = new ServiceManager(); this.plugin = plugin; - this.repeatingPools = new HashSet<>(); this.mainScheduler = new ReactorBukkitScheduler(plugin); } - /** - * @return A set of {@link ServicePool}s which contain repeating services. - */ - @Contract(pure = true) - public Set getRepeatingPools() { - return repeatingPools; - } - @Override public @NotNull Mono getServiceManager() { return Mono.just(serviceManager); @@ -47,20 +46,19 @@ public final class SchedulingSystem implements ISchedule { @Override @NotNull - public Mono queue(@NotNull IService service) { - return getServiceManager().flatMap(serviceManager -> { - Mono pool = serviceManager.getAssociatedServicePool(service); - return pool.defaultIfEmpty(Objects.requireNonNull(serviceManager - .createServicePool(ServicePool.getDefaultNamespacedKey(), service) - .block())); - }); + public Mono queue(@NotNull IService service) { + return getServiceManager() + .flatMap(manager -> manager.getAssociatedServicePool(service)) + .flatMap(pool -> pool.queueService(service)); } @Override public @NotNull Mono runOnce(IService service) { - return Mono.just(service).doOnNext(s -> { - s.start().then(s.stop()).subscribe(); - }).then(); + return Mono.just(service) + .doOnNext(s -> s.start() + .then(s.stop()) + .subscribe()) + .then(); } @Override diff --git a/src/main/java/io/github/simplexdevelopment/scheduler/ServiceManager.java b/src/main/java/io/github/simplexdevelopment/scheduler/ServiceManager.java index 5533ef0..5cf65ef 100644 --- a/src/main/java/io/github/simplexdevelopment/scheduler/ServiceManager.java +++ b/src/main/java/io/github/simplexdevelopment/scheduler/ServiceManager.java @@ -1,7 +1,6 @@ package io.github.simplexdevelopment.scheduler; import io.github.simplexdevelopment.api.IService; -import org.bukkit.NamespacedKey; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import reactor.core.publisher.Flux; @@ -12,6 +11,9 @@ import java.util.HashSet; import java.util.Set; public final class ServiceManager { + /** + * A set of {@link ServicePool}s which are currently active. + */ private final Set servicePools; /** @@ -32,7 +34,7 @@ public final class ServiceManager { * This service pool will execute each service consecutively within a singular non-blocking thread. */ @Contract(pure = true, value = "_, _ -> new") - public @NotNull Mono createServicePool(NamespacedKey poolName, IService... services) { + public @NotNull Mono createServicePool(String poolName, IService... services) { ServicePool pool = new ServicePool(poolName, false); Flux.fromIterable(Arrays.asList(services)).doOnEach(s -> pool.addService(s.get())); return Mono.just(pool); @@ -45,7 +47,7 @@ public final class ServiceManager { * This service pool will execute each service across a set of non-blocking threads. */ @Contract(pure = true, value = "_, _ -> new") - public @NotNull Mono multithreadedServicePool(NamespacedKey name, IService... services) { + public @NotNull Mono multithreadedServicePool(String name, IService... services) { ServicePool pool = new ServicePool(name, true); Flux.fromIterable(Arrays.asList(services)).doOnEach(s -> pool.addService(s.get())); return Mono.just(pool); @@ -60,7 +62,7 @@ public final class ServiceManager { * or by using {@link ServicePool#addService(IService)}. */ @Contract(pure = true, value = "_, _ -> new") - public @NotNull Mono emptyServicePool(NamespacedKey poolName, boolean multithreaded) { + public @NotNull Mono emptyServicePool(String poolName, boolean multithreaded) { ServicePool pool = new ServicePool(poolName, multithreaded); return Mono.just(pool); } diff --git a/src/main/java/io/github/simplexdevelopment/scheduler/ServicePool.java b/src/main/java/io/github/simplexdevelopment/scheduler/ServicePool.java index c939e98..d332463 100644 --- a/src/main/java/io/github/simplexdevelopment/scheduler/ServicePool.java +++ b/src/main/java/io/github/simplexdevelopment/scheduler/ServicePool.java @@ -1,7 +1,6 @@ package io.github.simplexdevelopment.scheduler; import io.github.simplexdevelopment.api.IService; -import org.bukkit.NamespacedKey; import org.bukkit.plugin.java.JavaPlugin; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; @@ -18,9 +17,9 @@ import java.util.concurrent.TimeUnit; public final class ServicePool { /** - * The default {@link NamespacedKey} used to identify unmarked services. This will cause errors if left unchecked. + * The default {@link String} used to identify unmarked services. This will cause errors if left unchecked. */ - private static final NamespacedKey DEFAULT = new NamespacedKey("simplex_ss", "default_service_pool"); + private static final String DEFAULT = "default_service_pool"; /** * A collection of services related to this service pool. */ @@ -30,9 +29,9 @@ public final class ServicePool { */ private final Scheduler scheduler; /** - * The key used to identify this service pool. + * The name used to identify this service pool. */ - private final NamespacedKey name; + private final String name; /** * This will create a new instance of a Service Pool with a {@link Scheduler} as its main scheduler. @@ -41,7 +40,7 @@ public final class ServicePool { * @param name The name of this service pool. * @param multithreaded Whether this service pool should be multithreaded, or operate upon a single thread. */ - public ServicePool(NamespacedKey name, boolean multithreaded) { + public ServicePool(String name, boolean multithreaded) { this.name = name; this.associatedServices = new HashSet<>(); if (multithreaded) { @@ -57,7 +56,7 @@ public final class ServicePool { * * @param name The name of this service pool. */ - public ServicePool(NamespacedKey name, JavaPlugin plugin) { + public ServicePool(String name, JavaPlugin plugin) { this.name = name; this.associatedServices = new HashSet<>(); this.scheduler = new ReactorBukkitScheduler(plugin); @@ -66,7 +65,7 @@ public final class ServicePool { /** * @return The default namespaced key to use if one is not assigned. */ - static NamespacedKey getDefaultNamespacedKey() { + static String getDefaultNamespacedKey() { return DEFAULT; } @@ -140,7 +139,7 @@ public final class ServicePool { * @param disposable A {@link Disposable} object which contains the service that should be disposed. * @return A {@link Mono} object which can be used to stop the service. */ - public @NotNull Mono stopService(@NotNull NamespacedKey service_name, @Nullable Mono disposable) { + public @NotNull Mono stopService(@NotNull String service_name, @Nullable Mono disposable) { getService(service_name).doOnNext(IService::stop).subscribe(); if (disposable != null) { disposable.doOnNext(Disposable::dispose).subscribe(); @@ -152,9 +151,9 @@ public final class ServicePool { * @param service_name The name of the service to get. * @return A {@link Mono} object which contains the service. */ - public @NotNull Mono getService(NamespacedKey service_name) { + public @NotNull Mono getService(String service_name) { return Flux.fromIterable(getAssociatedServices()) - .filter(service -> service.getNamespacedKey().equals(service_name)) + .filter(service -> service.getName().equals(service_name)) .next(); }