Search in sources :

Example 1 with QueueDrain

use of me.botsko.prism.actionlibs.QueueDrain in project Prism-Bukkit by prism.

the class Prism method onDisable.

/**
 * Shutdown.
 */
@Override
public void onDisable() {
    Bukkit.getPluginManager().callEvent(EventHelper.createUnLoadEvent());
    if (getConfig().getBoolean("prism.query.force-write-queue-on-shutdown")) {
        final QueueDrain drainer = new QueueDrain(this);
        drainer.forceDrainQueue();
    }
    if (!ApiHandler.disable()) {
        log("Possible errors unhooking dependencies...");
    }
    Bukkit.getScheduler().cancelTasks(this);
    // Close prismDataSource connections when plugin disables
    if (prismDataSource != null) {
        prismDataSource.dispose();
    }
    log("Closing plugin.");
    for (Handler handler : prismLog.getHandlers()) {
        handler.close();
    }
    super.onDisable();
}
Also used : QueueDrain(me.botsko.prism.actionlibs.QueueDrain) FileHandler(java.util.logging.FileHandler) Handler(java.util.logging.Handler) PrismParameterHandler(me.botsko.prism.parameters.PrismParameterHandler)

Aggregations

FileHandler (java.util.logging.FileHandler)1 Handler (java.util.logging.Handler)1 QueueDrain (me.botsko.prism.actionlibs.QueueDrain)1 PrismParameterHandler (me.botsko.prism.parameters.PrismParameterHandler)1