ProtocolLib/Javadoc/com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html
Kristian S. Stangeland 0622322ef4 Merged.
2012-10-17 07:58:24 +02:00

466 lines
20 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_07) on Thu Oct 11 02:58:30 CEST 2012 -->
<title>BackgroundCompiler</title>
<meta name="date" content="2012-10-11">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="BackgroundCompiler";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BackgroundCompiler.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../../com/comphenix/protocol/reflect/compiler/CompiledStructureModifier.html" title="class in com.comphenix.protocol.reflect.compiler"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html" target="_top">Frames</a></li>
<li><a href="BackgroundCompiler.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.comphenix.protocol.reflect.compiler</div>
<h2 title="Class BackgroundCompiler" class="title">Class BackgroundCompiler</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.comphenix.protocol.reflect.compiler.BackgroundCompiler</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">BackgroundCompiler</span>
extends java.lang.Object</pre>
<div class="block">Compiles structure modifiers on a background thread.
<p>
This is necessary as we cannot block the main thread.</div>
<dl><dt><span class="strong">Author:</span></dt>
<dd>Kristian</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#SHUTDOWN_DELAY_MS">SHUTDOWN_DELAY_MS</a></strong></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#BackgroundCompiler(java.lang.ClassLoader)">BackgroundCompiler</a></strong>(java.lang.ClassLoader&nbsp;loader)</code>
<div class="block">Initialize a background compiler.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#BackgroundCompiler(java.lang.ClassLoader, java.util.concurrent.ExecutorService)">BackgroundCompiler</a></strong>(java.lang.ClassLoader&nbsp;loader,
java.util.concurrent.ExecutorService&nbsp;executor)</code>
<div class="block">Initialize a background compiler utilizing the given thread pool.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/comphenix/protocol/reflect/compiler/StructureCompiler.html" title="class in com.comphenix.protocol.reflect.compiler">StructureCompiler</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#getCompiler()">getCompiler</a></strong>()</code>
<div class="block">Retrieve the current structure compiler.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html" title="class in com.comphenix.protocol.reflect.compiler">BackgroundCompiler</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#getInstance()">getInstance</a></strong>()</code>
<div class="block">Retrieves the current background compiler.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#isEnabled()">isEnabled</a></strong>()</code>
<div class="block">Retrieve whether or not the background compiler is enabled.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#scheduleCompilation(java.util.Map, java.lang.Class)">scheduleCompilation</a></strong>(java.util.Map&lt;java.lang.Class,<a href="../../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&gt;&nbsp;cache,
java.lang.Class&nbsp;key)</code>
<div class="block">Ensure that the indirectly given structure modifier is eventually compiled.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&lt;TKey&gt;&nbsp;void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#scheduleCompilation(com.comphenix.protocol.reflect.StructureModifier, com.comphenix.protocol.reflect.compiler.CompileListener)">scheduleCompilation</a></strong>(<a href="../../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;TKey&gt;&nbsp;uncompiled,
<a href="../../../../../com/comphenix/protocol/reflect/compiler/CompileListener.html" title="interface in com.comphenix.protocol.reflect.compiler">CompileListener</a>&lt;TKey&gt;&nbsp;listener)</code>
<div class="block">Ensure that the given structure modifier is eventually compiled.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#setEnabled(boolean)">setEnabled</a></strong>(boolean&nbsp;enabled)</code>
<div class="block">Sets whether or not the background compiler is enabled.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#setInstance(com.comphenix.protocol.reflect.compiler.BackgroundCompiler)">setInstance</a></strong>(<a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html" title="class in com.comphenix.protocol.reflect.compiler">BackgroundCompiler</a>&nbsp;backgroundCompiler)</code>
<div class="block">Sets the single background compiler we're using.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#shutdownAll()">shutdownAll</a></strong>()</code>
<div class="block">Clean up after ourselves using the default timeout.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#shutdownAll(long, java.util.concurrent.TimeUnit)">shutdownAll</a></strong>(long&nbsp;timeout,
java.util.concurrent.TimeUnit&nbsp;unit)</code>
<div class="block">Clean up after ourselves.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="SHUTDOWN_DELAY_MS">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SHUTDOWN_DELAY_MS</h4>
<pre>public static final&nbsp;int SHUTDOWN_DELAY_MS</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.comphenix.protocol.reflect.compiler.BackgroundCompiler.SHUTDOWN_DELAY_MS">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="BackgroundCompiler(java.lang.ClassLoader)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>BackgroundCompiler</h4>
<pre>public&nbsp;BackgroundCompiler(java.lang.ClassLoader&nbsp;loader)</pre>
<div class="block">Initialize a background compiler.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>loader</code> - - class loader from Bukkit.</dd></dl>
</li>
</ul>
<a name="BackgroundCompiler(java.lang.ClassLoader, java.util.concurrent.ExecutorService)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>BackgroundCompiler</h4>
<pre>public&nbsp;BackgroundCompiler(java.lang.ClassLoader&nbsp;loader,
java.util.concurrent.ExecutorService&nbsp;executor)</pre>
<div class="block">Initialize a background compiler utilizing the given thread pool.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>loader</code> - - class loader from Bukkit.</dd><dd><code>executor</code> - - thread pool we'll use.</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getInstance()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInstance</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html" title="class in com.comphenix.protocol.reflect.compiler">BackgroundCompiler</a>&nbsp;getInstance()</pre>
<div class="block">Retrieves the current background compiler.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Current background compiler.</dd></dl>
</li>
</ul>
<a name="setInstance(com.comphenix.protocol.reflect.compiler.BackgroundCompiler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setInstance</h4>
<pre>public static&nbsp;void&nbsp;setInstance(<a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html" title="class in com.comphenix.protocol.reflect.compiler">BackgroundCompiler</a>&nbsp;backgroundCompiler)</pre>
<div class="block">Sets the single background compiler we're using.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>backgroundCompiler</code> - - current background compiler, or NULL if the library is not loaded.</dd></dl>
</li>
</ul>
<a name="scheduleCompilation(java.util.Map, java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scheduleCompilation</h4>
<pre>public&nbsp;void&nbsp;scheduleCompilation(java.util.Map&lt;java.lang.Class,<a href="../../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&gt;&nbsp;cache,
java.lang.Class&nbsp;key)</pre>
<div class="block">Ensure that the indirectly given structure modifier is eventually compiled.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cache</code> - - store of structure modifiers.</dd><dd><code>key</code> - - key of the structure modifier to compile.</dd></dl>
</li>
</ul>
<a name="scheduleCompilation(com.comphenix.protocol.reflect.StructureModifier, com.comphenix.protocol.reflect.compiler.CompileListener)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scheduleCompilation</h4>
<pre>public&nbsp;&lt;TKey&gt;&nbsp;void&nbsp;scheduleCompilation(<a href="../../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>&lt;TKey&gt;&nbsp;uncompiled,
<a href="../../../../../com/comphenix/protocol/reflect/compiler/CompileListener.html" title="interface in com.comphenix.protocol.reflect.compiler">CompileListener</a>&lt;TKey&gt;&nbsp;listener)</pre>
<div class="block">Ensure that the given structure modifier is eventually compiled.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>uncompiled</code> - - structure modifier to compile.</dd><dd><code>listener</code> - - listener responsible for responding to the compilation.</dd></dl>
</li>
</ul>
<a name="shutdownAll()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>shutdownAll</h4>
<pre>public&nbsp;void&nbsp;shutdownAll()</pre>
<div class="block">Clean up after ourselves using the default timeout.</div>
</li>
</ul>
<a name="shutdownAll(long, java.util.concurrent.TimeUnit)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>shutdownAll</h4>
<pre>public&nbsp;void&nbsp;shutdownAll(long&nbsp;timeout,
java.util.concurrent.TimeUnit&nbsp;unit)</pre>
<div class="block">Clean up after ourselves.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>timeout</code> - - the maximum time to wait.</dd><dd><code>unit</code> - - the time unit of the timeout argument.</dd></dl>
</li>
</ul>
<a name="isEnabled()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEnabled</h4>
<pre>public&nbsp;boolean&nbsp;isEnabled()</pre>
<div class="block">Retrieve whether or not the background compiler is enabled.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>TRUE if it is enabled, FALSE otherwise.</dd></dl>
</li>
</ul>
<a name="setEnabled(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setEnabled</h4>
<pre>public&nbsp;void&nbsp;setEnabled(boolean&nbsp;enabled)</pre>
<div class="block">Sets whether or not the background compiler is enabled.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>enabled</code> - - TRUE to enable it, FALSE otherwise.</dd></dl>
</li>
</ul>
<a name="getCompiler()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getCompiler</h4>
<pre>public&nbsp;<a href="../../../../../com/comphenix/protocol/reflect/compiler/StructureCompiler.html" title="class in com.comphenix.protocol.reflect.compiler">StructureCompiler</a>&nbsp;getCompiler()</pre>
<div class="block">Retrieve the current structure compiler.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Current structure compiler.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BackgroundCompiler.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../../com/comphenix/protocol/reflect/compiler/CompiledStructureModifier.html" title="class in com.comphenix.protocol.reflect.compiler"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html" target="_top">Frames</a></li>
<li><a href="BackgroundCompiler.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>