<!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 Dec 27 17:42:38 CET 2012 --> <title>BackgroundCompiler</title> <meta name="date" content="2012-12-27"> <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: </li> <li>Nested | </li> <li><a href="#field_summary">Field</a> | </li> <li><a href="#constructor_summary">Constr</a> | </li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field_detail">Field</a> | </li> <li><a href="#constructor_detail">Constr</a> | </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"> </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> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#THREAD_FORMAT">THREAD_FORMAT</a></strong></code> <div class="block">The default format for the name of new worker threads.</div> </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"> </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, com.comphenix.protocol.error.ErrorReporter)">BackgroundCompiler</a></strong>(java.lang.ClassLoader loader, <a href="../../../../../com/comphenix/protocol/error/ErrorReporter.html" title="interface in com.comphenix.protocol.error">ErrorReporter</a> reporter)</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, com.comphenix.protocol.error.ErrorReporter, java.util.concurrent.ExecutorService)">BackgroundCompiler</a></strong>(java.lang.ClassLoader loader, <a href="../../../../../com/comphenix/protocol/error/ErrorReporter.html" title="interface in com.comphenix.protocol.error">ErrorReporter</a> reporter, java.util.concurrent.ExecutorService 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"> </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<java.lang.Class,<a href="../../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>> cache, java.lang.Class 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><TKey> 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><TKey> uncompiled, <a href="../../../../../com/comphenix/protocol/reflect/compiler/CompileListener.html" title="interface in com.comphenix.protocol.reflect.compiler">CompileListener</a><TKey> 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 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> 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 timeout, java.util.concurrent.TimeUnit 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 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="THREAD_FORMAT"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>THREAD_FORMAT</h4> <pre>public static final java.lang.String THREAD_FORMAT</pre> <div class="block">The default format for the name of new worker threads.</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.comphenix.protocol.reflect.compiler.BackgroundCompiler.THREAD_FORMAT">Constant Field Values</a></dd></dl> </li> </ul> <a name="SHUTDOWN_DELAY_MS"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>SHUTDOWN_DELAY_MS</h4> <pre>public static final 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, com.comphenix.protocol.error.ErrorReporter)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>BackgroundCompiler</h4> <pre>public BackgroundCompiler(java.lang.ClassLoader loader, <a href="../../../../../com/comphenix/protocol/error/ErrorReporter.html" title="interface in com.comphenix.protocol.error">ErrorReporter</a> reporter)</pre> <div class="block">Initialize a background compiler. <p> Uses the default <a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html#THREAD_FORMAT"><code>THREAD_FORMAT</code></a> to name worker threads.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>loader</code> - - class loader from Bukkit.</dd><dd><code>reporter</code> - - current error reporter.</dd></dl> </li> </ul> <a name="BackgroundCompiler(java.lang.ClassLoader, com.comphenix.protocol.error.ErrorReporter, java.util.concurrent.ExecutorService)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>BackgroundCompiler</h4> <pre>public BackgroundCompiler(java.lang.ClassLoader loader, <a href="../../../../../com/comphenix/protocol/error/ErrorReporter.html" title="interface in com.comphenix.protocol.error">ErrorReporter</a> reporter, java.util.concurrent.ExecutorService 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>reporter</code> - - current error reporter.</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 <a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html" title="class in com.comphenix.protocol.reflect.compiler">BackgroundCompiler</a> 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 void setInstance(<a href="../../../../../com/comphenix/protocol/reflect/compiler/BackgroundCompiler.html" title="class in com.comphenix.protocol.reflect.compiler">BackgroundCompiler</a> 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 void scheduleCompilation(java.util.Map<java.lang.Class,<a href="../../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>> cache, java.lang.Class 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 <TKey> void scheduleCompilation(<a href="../../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><TKey> uncompiled, <a href="../../../../../com/comphenix/protocol/reflect/compiler/CompileListener.html" title="interface in com.comphenix.protocol.reflect.compiler">CompileListener</a><TKey> 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 void 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 void shutdownAll(long timeout, java.util.concurrent.TimeUnit 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 boolean 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 void setEnabled(boolean 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 <a href="../../../../../com/comphenix/protocol/reflect/compiler/StructureCompiler.html" title="class in com.comphenix.protocol.reflect.compiler">StructureCompiler</a> 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: </li> <li>Nested | </li> <li><a href="#field_summary">Field</a> | </li> <li><a href="#constructor_summary">Constr</a> | </li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field_detail">Field</a> | </li> <li><a href="#constructor_detail">Constr</a> | </li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>