<divclass="inheritance"title="Inheritance Tree"><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">java.lang.Object</a>
<divclass="type-signature"><spanclass="modifiers">public final class </span><spanclass="element-name type-name-label">ServiceManager</span>
<spanclass="extends-implements">extends <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">Object</a></span></div>
<divclass="block">The ServiceManager is a factory class for managing <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler"><code>ServicePool</code></a>s.
You can use this class for easy creation of <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler"><code>ServicePool</code></a>s,
as well as adding and removing <ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api"><code>IService</code></a>s from the pool. You can create an
and even create a <ahref="#multithreadedServicePool(java.lang.String,io.github.simplexdevelopment.api.IService...)"><code>multithreadedServicePool(String, IService...)</code></a>.</div>
<divclass="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#bukkitServicePool(java.lang.String,org.bukkit.plugin.java.JavaPlugin,io.github.simplexdevelopment.api.IService...)"class="member-name-link">bukkitServicePool</a><wbr>(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> poolName,
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#createServicePool(java.lang.String,io.github.simplexdevelopment.api.IService...)"class="member-name-link">createServicePool</a><wbr>(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> poolName,
<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>... services)</code></div>
<divclass="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></code></div>
<divclass="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#emptyBukkitServicePool(java.lang.String,org.bukkit.plugin.java.JavaPlugin)"class="member-name-link">emptyBukkitServicePool</a><wbr>(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> poolName,
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#emptyServicePool(java.lang.String,boolean)"class="member-name-link">emptyServicePool</a><wbr>(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> poolName,
<divclass="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></code></div>
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#multithreadedServicePool(java.lang.String,io.github.simplexdevelopment.api.IService...)"class="member-name-link">multithreadedServicePool</a><wbr>(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> name,
<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>... services)</code></div>
<h3id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">Object</a></h3>
<code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()"title="class or interface in java.lang"class="external-link">clone</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)"title="class or interface in java.lang"class="external-link">equals</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()"title="class or interface in java.lang"class="external-link">finalize</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()"title="class or interface in java.lang"class="external-link">getClass</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()"title="class or interface in java.lang"class="external-link">hashCode</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()"title="class or interface in java.lang"class="external-link">notify</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()"title="class or interface in java.lang"class="external-link">notifyAll</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()"title="class or interface in java.lang"class="external-link">toString</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()"title="class or interface in java.lang"class="external-link">wait</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)"title="class or interface in java.lang"class="external-link">wait</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)"title="class or interface in java.lang"class="external-link">wait</a></code></div>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></span> <spanclass="element-name">createServicePool</span><wbr><spanclass="parameters">(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> poolName,
<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>... services)</span></div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>poolName</code> - The name of the service pool.</dd>
<dd><code>services</code> - The services to register within the service pool.</dd>
<dt>Returns:</dt>
<dd>A <code>Mono</code> object which contains a <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler"><code>ServicePool</code></a> element.
This service pool will execute each service consecutively within a singular non-blocking thread.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></span> <spanclass="element-name">emptyBukkitServicePool</span><wbr><spanclass="parameters">(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> poolName,
<dd><code>poolName</code> - The name of the service pool.</dd>
<dd><code>plugin</code> - The plugin which will be used to register the service pool.</dd>
<dt>Returns:</dt>
<dd>A <code>Mono</code> object which contains a <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler"><code>ServicePool</code></a> element.
This Service Pool will execute each service within the main server thread.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></span> <spanclass="element-name">bukkitServicePool</span><wbr><spanclass="parameters">(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> poolName,
org.bukkit.plugin.java.JavaPlugin plugin,
<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>... services)</span></div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>poolName</code> - The name of the service pool.</dd>
<dd><code>plugin</code> - The plugin which will be used to register the service pool.</dd>
<dd><code>services</code> - The services to register within the service pool.</dd>
<dt>Returns:</dt>
<dd>A <code>Mono</code> object which contains a <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler"><code>ServicePool</code></a> element.
This Service Pool will execute each service within the main server thread.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></span> <spanclass="element-name">multithreadedServicePool</span><wbr><spanclass="parameters">(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> name,
<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>... services)</span></div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - The name of the service pool.</dd>
<dd><code>services</code> - The services to register within the service pool.</dd>
<dt>Returns:</dt>
<dd>A <code>Mono</code> object which contains a <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler"><code>ServicePool</code></a> element.
This service pool will execute each service across a set of non-blocking threads.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></span> <spanclass="element-name">emptyServicePool</span><wbr><spanclass="parameters">(<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"title="class or interface in java.lang"class="external-link">String</a> poolName,
boolean multithreaded)</span></div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>poolName</code> - The name of the service pool.</dd>
<dd><code>multithreaded</code> - Whether the service pool should be multithreaded, or operate upon a single thread.</dd>
<dt>Returns:</dt>
<dd>A <code>Mono</code> object which contains a <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler"><code>ServicePool</code></a> element.
This pool is empty, meaning it contains no services. Any attempt to run services on this pool while it remains empty will either fail or error.
You can add services to this pool by using <ahref="#addToExistingPool(io.github.simplexdevelopment.scheduler.ServicePool,io.github.simplexdevelopment.api.IService...)"><code>addToExistingPool(ServicePool, IService...)</code></a>,
or by using <code>ServicePool.addService(IService)</code>.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></span> <spanclass="element-name">addToExistingPool</span><wbr><spanclass="parameters">(@NotNull
@NotNull <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a> pool,
<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>... services)</span></div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>pool</code> - The service pool to add to.</dd>
<dd><code>services</code> - The services to register within the service pool.</dd>
<dt>Returns:</dt>
<dd>A <code>Mono</code> object which contains the <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler"><code>ServicePool</code></a> element that now contains the registered services.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></span> <spanclass="element-name">takeFromExistingPool</span><wbr><spanclass="parameters">(@NotNull
@NotNull <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a> pool,
<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>... services)</span></div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>pool</code> - The service pool to take from.</dd>
<dd><code>services</code> - The services to remove from the pool.</dd>
<dt>Returns:</dt>
<dd>A <code>Mono</code> object which contains the <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler"><code>ServicePool</code></a> that no longer contains the removed services.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Flux<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></span> <spanclass="element-name">getServicePools</span>()</div>
<dlclass="notes">
<dt>Returns:</dt>
<dd>A <code>Flux</code> object which contains all the service pools currently available.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">boolean</span> <spanclass="element-name">locateServiceWithinPools</span><wbr><spanclass="parameters">(<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a> service)</span></div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>service</code> - The service to locate.</dd>
<dt>Returns:</dt>
<dd>True if the service is somewhere within a service pool, false otherwise.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler">ServicePool</a>></span> <spanclass="element-name">getAssociatedServicePool</span><wbr><spanclass="parameters">(<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a> service)</span></div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>service</code> - The service pool to call from.</dd>
<dt>Returns:</dt>
<dd>A <code>Mono</code> object which contains a <ahref="ServicePool.html"title="class in io.github.simplexdevelopment.scheduler"><code>ServicePool</code></a> element which contains the specified service.
If no service pool can be found, an empty Mono is returned.</dd>