<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">ServicePool</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>
</section>
<sectionclass="summary">
<ulclass="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<sectionclass="field-summary"id="field-summary">
<h2>Field Summary</h2>
<divclass="caption"><span>Fields</span></div>
<divclass="summary-table three-column-summary">
<divclass="table-header col-first">Modifier and Type</div>
<divclass="col-first even-row-color"><code>private final <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html"title="class or interface in java.util"class="external-link">Set</a><<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>></code></div>
<divclass="col-first odd-row-color"><code>private static final <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></code></div>
<divclass="block">The default <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"><code>String</code></a> used to identify unmarked services.</div>
<divclass="col-first even-row-color"><code>private final <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></code></div>
<divclass="col-constructor-name even-row-color"><code><ahref="#%3Cinit%3E(java.lang.String,boolean)"class="member-name-link">ServicePool</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,
<divclass="col-constructor-name odd-row-color"><code><ahref="#%3Cinit%3E(java.lang.String,org.bukkit.plugin.java.JavaPlugin)"class="member-name-link">ServicePool</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,
<divclass="block">This will create a new instance of a Service Pool with the <ahref="ReactorBukkitScheduler.html"title="class in io.github.simplexdevelopment.scheduler"><code>ReactorBukkitScheduler</code></a> as its main scheduler.</div>
<divclass="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>@NotNull <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html"title="class or interface in java.util"class="external-link">Set</a><<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>></code></div>
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#getService(java.lang.String)"class="member-name-link">getService</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> service_name)</code></div>
<divclass="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>@NotNull reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></code></div>
<divclass="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><ahref="#stopService(java.lang.String,reactor.core.publisher.Mono)"class="member-name-link">stopService</a><wbr>(@NotNull <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> service_name,
<divclass="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>@NotNull reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></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>
<divclass="member-signature"><spanclass="modifiers">private static final</span> <spanclass="return-type"><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></span> <spanclass="element-name">DEFAULT</span></div>
<divclass="block">The default <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"><code>String</code></a> used to identify unmarked services. This will cause errors if left unchecked.</div>
<dlclass="notes">
<dt>See Also:</dt>
<dd>
<ulclass="see-list">
<li><ahref="../../../../constant-values.html#io.github.simplexdevelopment.scheduler.ServicePool.DEFAULT">Constant Field Values</a></li>
<divclass="member-signature"><spanclass="modifiers">private final</span> <spanclass="return-type"><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html"title="class or interface in java.util"class="external-link">Set</a><<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>></span> <spanclass="element-name">associatedServices</span></div>
<divclass="block">A collection of services related to this service pool.</div>
<divclass="member-signature"><spanclass="modifiers">private final</span> <spanclass="return-type"><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></span> <spanclass="element-name">name</span></div>
<divclass="block">The name used to identify this service pool.</div>
<divclass="member-signature"><spanclass="modifiers">public</span> <spanclass="element-name">ServicePool</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,
<divclass="member-signature"><spanclass="modifiers">public</span> <spanclass="element-name">ServicePool</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,
<divclass="block">This will create a new instance of a Service Pool with the <ahref="ReactorBukkitScheduler.html"title="class in io.github.simplexdevelopment.scheduler"><code>ReactorBukkitScheduler</code></a> as its main scheduler.
This should be used if you'd like to execute tasks while communicating on the main server thread.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - The name of this service pool.</dd>
<divclass="member-signature"><spanclass="modifiers">static</span> <spanclass="return-type"><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></span> <spanclass="element-name">getDefaultNamespacedKey</span>()</div>
<divclass="member-signature"><spanclass="return-type">void</span> <spanclass="element-name">addService</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> - Add a service to the pool's service collection.</dd>
<divclass="member-signature"><spanclass="return-type">boolean</span> <spanclass="element-name">isValidService</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 check against this pool.</dd>
<dt>Returns:</dt>
<dd>Whether the service is registered with this pool.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html"title="class or interface in java.util"class="external-link">Set</a><<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>></span> <spanclass="element-name">getAssociatedServices</span>()</div>
<dlclass="notes">
<dt>Returns:</dt>
<dd>A <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html"title="class or interface in java.util"class="external-link"><code>Set</code></a> of <ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api"><code>IService</code></a> objects which are registered with this pool.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<reactor.core.Disposable></span> <spanclass="element-name">queueService</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 name of the service to queue. This should be a service that is located within this service pool.
<dd>A <code>Flux</code> object which contains a collection of <code>Disposable</code> elements,
which can be used to destroy the registered services using <ahref="#stopServices(reactor.core.publisher.Flux)"><code>stopServices(Flux)</code></a>.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></span> <spanclass="element-name">stopServices</span><wbr><spanclass="parameters">(@NotNull
<dd><code>disposableThread</code> - A <code>reactor.core.publisher.Flux<reactor.core.Disposable></code> which contains all the services that should be disposed..</dd>
<dt>Returns:</dt>
<dd>A <code>reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></code> object which can be used to stop the services.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></span> <spanclass="element-name">stopService</span><wbr><spanclass="parameters">(@NotNull
@NotNull <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> service_name,
<dd><code>service_name</code> - The name of the service to stop.</dd>
<dd><code>disposable</code> - A <code>Disposable</code> object which contains the service that should be disposed.</dd>
<dt>Returns:</dt>
<dd>A <code>reactor.core.publisher.Mono<<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Void.html"title="class or interface in java.lang"class="external-link">Void</a>></code> object which can be used to stop the service.</dd>
</span><spanclass="modifiers">public</span> <spanclass="return-type">@NotNull reactor.core.publisher.Mono<<ahref="../api/IService.html"title="interface in io.github.simplexdevelopment.api">IService</a>></span> <spanclass="element-name">getService</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> service_name)</span></div>
<divclass="member-signature"><spanclass="return-type">void</span> <spanclass="element-name">removeService</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 remove from the pool's service collection.</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">recycle</span>()</div>
<dlclass="notes">
<dt>Returns:</dt>
<dd>This service pool after being cleared of all services.
You will need to register services with this pool again before using it.</dd>