com.quartercode.quarterbukkit.api.thread
Class ThreadUtil

java.lang.Object
  extended by com.quartercode.quarterbukkit.api.thread.ThreadUtil

public class ThreadUtil
extends java.lang.Object

This class is for handle the Bukkit-Thread-Errors. It will manage the called method with their actions.


Method Summary
static void check()
          Checks if the current Thread is valid for Bukkit-API-functions and throws an IllegalThreadStateException if not.
static void check(java.lang.Thread thread)
          Checks if a Thread is valid for Bukkit-API-functions and throws an IllegalThreadStateException if not.
static java.lang.Thread getBukkitThrad()
          Returns the initalized Bukkit-Main-Thread.
static void initalizeThread()
          Initalizes the Thread management.
static boolean isInBukkitThread()
          Checks if the current Thread is the Bukkit-Main-Thread.
static boolean isInBukkitThread(java.lang.Thread thread)
          Checks if a Thread is the Bukkit-Main-Thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initalizeThread

public static void initalizeThread()
Initalizes the Thread management. This can only be called one time.


getBukkitThrad

public static java.lang.Thread getBukkitThrad()
Returns the initalized Bukkit-Main-Thread.

Returns:
The Bukkit-Main-Thread.

isInBukkitThread

public static boolean isInBukkitThread()
Checks if the current Thread is the Bukkit-Main-Thread.

Returns:
If the current Thread is valid for Bukkit-API-functions.

isInBukkitThread

public static boolean isInBukkitThread(java.lang.Thread thread)
Checks if a Thread is the Bukkit-Main-Thread.

Parameters:
thread - The Thread to check.
Returns:
If the Thread is valid for Bukkit-API-functions.

check

public static void check()
Checks if the current Thread is valid for Bukkit-API-functions and throws an IllegalThreadStateException if not.


check

public static void check(java.lang.Thread thread)
Checks if a Thread is valid for Bukkit-API-functions and throws an IllegalThreadStateException if not.

Parameters:
thread - The Thread to check.