forked from Bukkit/Bukkit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow plugins to inhibit (un)loading.
- Loading branch information
Stéphan Kochen
committed
Feb 25, 2011
1 parent
8e20c6f
commit db94ded
Showing
7 changed files
with
164 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/org/bukkit/plugin/PluginInhibitException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.bukkit.plugin; | ||
|
||
/** | ||
* Thrown when a plugin requests to inhibit loading or unloading. | ||
*/ | ||
public final class PluginInhibitException extends Exception { | ||
private static final long serialVersionUID = 3857877689996365765L; | ||
private final Plugin plugin; | ||
|
||
/** | ||
* Constructor with associated plugin. | ||
* | ||
* Specifying a plugin using this constructor allows the PluginManager to | ||
* do cleanup of any resources the plugin may have already registered. | ||
* | ||
* @param plugin The plugin that requested inhibition | ||
*/ | ||
public PluginInhibitException(Plugin plugin) { | ||
super(); | ||
this.plugin = plugin; | ||
} | ||
|
||
/** | ||
* Default constructor. | ||
* | ||
* The preferred constructor is | ||
* {@link PluginInhibitException#PluginInhibitException(Plugin)}. | ||
* This constructor is only to be used if no cleanup is necessary. | ||
*/ | ||
public PluginInhibitException() { | ||
super(); | ||
this.plugin = null; | ||
} | ||
|
||
/** | ||
* Get the plugin that requested inhibition. | ||
* | ||
* @return A Plugin instance | ||
*/ | ||
public Plugin getPlugin() { | ||
return plugin; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters