blob: b1a425da373fbe48ccfe0bf1a1dedf18b9820d72 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX">
<link rel="canonical" href="https://ignite.apache.org/releases/1.6.0/javadoc/org/apache/ignite/IgniteScheduler.html" />
<!-- Generated by javadoc (version 1.7.0_80) on Wed May 18 17:03:56 MSK 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IgniteScheduler (Ignite 1.6.0)</title>
<meta name="date" content="2016-05-18">
<link rel="stylesheet" type="text/css" href="../../../javadoc.css" title="Style">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-61232409-1', 'auto');
ga('send', 'pageview');
</script></head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IgniteScheduler (Ignite 1.6.0)";
}
//-->
</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/IgniteScheduler.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-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>Ignite - In-Memory Data Fabric</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/ignite/IgniteQueue.html" title="interface in org.apache.ignite"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../org/apache/ignite/IgniteSemaphore.html" title="interface in org.apache.ignite"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/ignite/IgniteScheduler.html" target="_top">Frames</a></li>
<li><a href="IgniteScheduler.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>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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">org.apache.ignite</div>
<h2 title="Interface IgniteScheduler" class="title">Interface IgniteScheduler</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="strong">IgniteScheduler</span></pre>
<div class="block">Provides functionality for scheduling jobs locally using UNIX cron-based syntax.
Instance of <code>GridScheduler</code> is obtained from grid as follows:
<pre name="code" class="java">
GridScheduler s = Ignition.ignite().scheduler();
</pre>
<p>
Scheduler supports standard UNIX <code>cron</code> format with optional prefix of
<tt>{n1, n2}</tt>, where <code>n1</code> is delay of scheduling in seconds and
<code>n2</code> is the number of execution. Both parameters are optional.
Here's an example of scheduling a closure that broadcasts a message
to all nodes five times, once every minute, with initial delay of two seconds:
<pre name="code" class="java">
Ignition.ignite().scheduler().scheduleLocal(
GridSchedulerFuture&lt;?&gt; = Ignition.ignite().scheduler().scheduleLocal(new Callable&lt;Object&gt;() {
&#64;Override public Object call() throws IgniteCheckedException {
g.broadcast(new GridCallable() {...}).get();
}
}, "{2, 5} * * * * *" // 2 seconds delay with 5 executions only.
);
</pre></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== 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>&lt;R&gt;&nbsp;<a href="../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a>&lt;R&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/ignite/IgniteScheduler.html#callLocal(java.util.concurrent.Callable)">callLocal</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a>&lt;R&gt;&nbsp;c)</code>
<div class="block">Executes given callable on internal system thread pool asynchronously.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a>&lt;?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/ignite/IgniteScheduler.html#runLocal(java.lang.Runnable)">runLocal</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;r)</code>
<div class="block">Executes given closure on internal system thread pool asynchronously.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&lt;R&gt;&nbsp;<a href="../../../org/apache/ignite/scheduler/SchedulerFuture.html" title="interface in org.apache.ignite.scheduler">SchedulerFuture</a>&lt;R&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/ignite/IgniteScheduler.html#scheduleLocal(java.util.concurrent.Callable,%20java.lang.String)">scheduleLocal</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a>&lt;R&gt;&nbsp;c,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;ptrn)</code>
<div class="block">Schedules job for execution using local <b>cron-based</b> scheduling.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/ignite/scheduler/SchedulerFuture.html" title="interface in org.apache.ignite.scheduler">SchedulerFuture</a>&lt;?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/ignite/IgniteScheduler.html#scheduleLocal(java.lang.Runnable,%20java.lang.String)">scheduleLocal</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;job,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;ptrn)</code>
<div class="block">Schedules job for execution using local <b>cron-based</b> scheduling.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="runLocal(java.lang.Runnable)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>runLocal</h4>
<pre><a href="../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a>&lt;?&gt;&nbsp;runLocal(@Nullable
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;r)</pre>
<div class="block">Executes given closure on internal system thread pool asynchronously.
<p>
Note that class <a href="../../../org/apache/ignite/lang/IgniteRunnable.html" title="interface in org.apache.ignite.lang"><code>IgniteRunnable</code></a> implements <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang"><code>Runnable</code></a> and class <a href="../../../org/apache/ignite/lang/IgniteOutClosure.html" title="interface in org.apache.ignite.lang"><code>IgniteOutClosure</code></a>
implements <a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent"><code>Callable</code></a> interface.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - Runnable to execute. If <code>null</code> - this method is no-op.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Future for this execution.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../org/apache/ignite/IgniteScheduler.html#callLocal(java.util.concurrent.Callable)"><code>callLocal(Callable)</code></a>,
<a href="../../../org/apache/ignite/lang/IgniteClosure.html" title="interface in org.apache.ignite.lang"><code>IgniteClosure</code></a></dd></dl>
</li>
</ul>
<a name="callLocal(java.util.concurrent.Callable)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>callLocal</h4>
<pre>&lt;R&gt;&nbsp;<a href="../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a>&lt;R&gt;&nbsp;callLocal(@Nullable
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a>&lt;R&gt;&nbsp;c)</pre>
<div class="block">Executes given callable on internal system thread pool asynchronously.
<p>
Note that class <a href="../../../org/apache/ignite/lang/IgniteRunnable.html" title="interface in org.apache.ignite.lang"><code>IgniteRunnable</code></a> implements <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang"><code>Runnable</code></a> and class <a href="../../../org/apache/ignite/lang/IgniteOutClosure.html" title="interface in org.apache.ignite.lang"><code>IgniteOutClosure</code></a>
implements <a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent"><code>Callable</code></a> interface.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>R</code> - Type of the return value for the closure.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>c</code> - Callable to execute. If <code>null</code> - this method is no-op.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Future for this execution.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../org/apache/ignite/IgniteScheduler.html#runLocal(java.lang.Runnable)"><code>runLocal(Runnable)</code></a>,
<a href="../../../org/apache/ignite/lang/IgniteOutClosure.html" title="interface in org.apache.ignite.lang"><code>IgniteOutClosure</code></a></dd></dl>
</li>
</ul>
<a name="scheduleLocal(java.lang.Runnable, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scheduleLocal</h4>
<pre><a href="../../../org/apache/ignite/scheduler/SchedulerFuture.html" title="interface in org.apache.ignite.scheduler">SchedulerFuture</a>&lt;?&gt;&nbsp;scheduleLocal(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;job,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;ptrn)</pre>
<div class="block">Schedules job for execution using local <b>cron-based</b> scheduling.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>job</code> - Job to schedule to run as a background cron-based job.
If <code>null</code> - this method is no-op.</dd><dd><code>ptrn</code> - Scheduling pattern in UNIX cron format with optional prefix <tt>{n1, n2}</tt>
where <code>n1</code> is delay of scheduling in seconds and <code>n2</code> is the number of execution. Both
parameters are optional.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Scheduled execution future.</dd></dl>
</li>
</ul>
<a name="scheduleLocal(java.util.concurrent.Callable, java.lang.String)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>scheduleLocal</h4>
<pre>&lt;R&gt;&nbsp;<a href="../../../org/apache/ignite/scheduler/SchedulerFuture.html" title="interface in org.apache.ignite.scheduler">SchedulerFuture</a>&lt;R&gt;&nbsp;scheduleLocal(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a>&lt;R&gt;&nbsp;c,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;ptrn)</pre>
<div class="block">Schedules job for execution using local <b>cron-based</b> scheduling.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>c</code> - Job to schedule to run as a background cron-based job.</dd><dd><code>ptrn</code> - Scheduling pattern in UNIX cron format with optional prefix <tt>{n1, n2}</tt>
where <code>n1</code> is delay of scheduling in seconds and <code>n2</code> is the number of execution. Both
parameters are optional.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Scheduled execution future.</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/IgniteScheduler.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-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>Ignite - In-Memory Data Fabric</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/ignite/IgniteQueue.html" title="interface in org.apache.ignite"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../org/apache/ignite/IgniteSemaphore.html" title="interface in org.apache.ignite"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/ignite/IgniteScheduler.html" target="_top">Frames</a></li>
<li><a href="IgniteScheduler.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>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><table width="100%" border="0" cellspacing=0 cellpadding=0 style="padding: 5px"> <tr> <td> <table style="padding-left: 0; margin: 0"> <tbody style="padding: 0; margin: 0"> <tr style="padding: 0; margin: 0"> <td> <a target=_blank href="https://ignite.apache.org"><nobr>2015 Copyright &#169; Apache Software Foundation</nobr></a> </td> </tr> </tbody> </table> </td> <td width="100%" align="right" valign="center"> <a href="https://twitter.com/ApacheIgnite" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @ApacheIgnite</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> </td> </tr> <tr> <td colspan="2" valign="top" align="left"> <table style="padding-left: 0; margin: 0"> <tbody style="padding: 0; margin: 0"> <tr style="padding: 0; margin: 0"> <td> <b>Ignite Fabric</b> </td> <td>:&nbsp;&nbsp; ver. <strong>1.6.0</strong> </td> </tr> <tr style="padding: 0; margin: 0"> <td> <b>Release Date</b> </td> <td>:&nbsp;&nbsp; May 18 2016 </td> </tr> </tbody> </table> </td> </tr> </table></small></p>
</body>
</html>