blob: 094af900164b6cc94f8fa8032a90b75fe53ff9c3 [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>
<!-- Generated by javadoc -->
<title>DistributedLockService (Apache Geode 1.15.0)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DistributedLockService (Apache Geode 1.15.0)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":9,"i2":9,"i3":9,"i4":6,"i5":9,"i6":6,"i7":6,"i8":9,"i9":6,"i10":6,"i11":38,"i12":6,"i13":6,"i14":38,"i15":6};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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="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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/geode/distributed/ConfigurationProperties.html" title="interface in org.apache.geode.distributed"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/geode/distributed/DistributedMember.html" title="interface in org.apache.geode.distributed"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/geode/distributed/DistributedLockService.html" target="_top">Frames</a></li>
<li><a href="DistributedLockService.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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><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>Field&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">org.apache.geode.distributed</div>
<h2 title="Class DistributedLockService" class="title">Class DistributedLockService</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.geode.distributed.DistributedLockService</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">DistributedLockService</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block"><p>
A named instance of DistributedLockService defines a space for locking arbitrary names across the
distributed system defined by a specified distribution manager. Any number of
DistributedLockService instances can be created with different service names. For all processes
in the distributed system that have created an instance of DistributedLockService with the same
name, no more than one thread is permitted to own the lock on a given name in that instance at
any point in time. Additionally, a thread can lock the entire service, preventing any other
threads in the system from locking the service or any names in the service.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" 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="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#DistributedLockService--">DistributedLockService</a></span>()</code>
<div class="block">Public instance creation is prohibited - use <a href="../../../../org/apache/geode/distributed/DistributedLockService.html#create-java.lang.String-org.apache.geode.distributed.DistributedSystem-"><code>create(String, DistributedSystem)</code></a></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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#becomeLockGrantor--">becomeLockGrantor</a></span>()</code>
<div class="block">Specifies this member to become the grantor for this lock service.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#becomeLockGrantor-java.lang.String-">becomeLockGrantor</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;serviceName)</code>
<div class="block">Specifies that this member should become the grantor for the named locking service.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/geode/distributed/DistributedLockService.html" title="class in org.apache.geode.distributed">DistributedLockService</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#create-java.lang.String-org.apache.geode.distributed.DistributedSystem-">create</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;serviceName,
<a href="../../../../org/apache/geode/distributed/DistributedSystem.html" title="class in org.apache.geode.distributed">DistributedSystem</a>&nbsp;ds)</code>
<div class="block">Create a DistributedLockService with the given serviceName for the given DistributedSystem.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#destroy-java.lang.String-">destroy</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;serviceName)</code>
<div class="block">Destroy a previously created DistributedLockService with the given <code>serviceName</code>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#freeResources-java.lang.Object-">freeResources</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;name)</code>
<div class="block">Free internal resources associated with the given <code>name</code>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/geode/distributed/DistributedLockService.html" title="class in org.apache.geode.distributed">DistributedLockService</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#getServiceNamed-java.lang.String-">getServiceNamed</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;serviceName)</code>
<div class="block">Look up and return the DistributedLockService with the given name, if it has been created in
this VM.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#isHeldByCurrentThread-java.lang.Object-">isHeldByCurrentThread</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;name)</code>
<div class="block">Determine whether the current thread owns the lock on the given object.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#isLockGrantor--">isLockGrantor</a></span>()</code>
<div class="block">Returns true if this member is currently the lock authority responsible for granting locks for
this service.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#isLockGrantor-java.lang.String-">isLockGrantor</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;serviceName)</code>
<div class="block">Returns true if this member is the grantor for the named service.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#isLockingSuspendedByCurrentThread--">isLockingSuspendedByCurrentThread</a></span>()</code>
<div class="block">Determine whether the current thread has suspended locking in this DistributedLockService.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#lock-java.lang.Object-long-long-">lock</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;name,
long&nbsp;waitTimeMillis,
long&nbsp;leaseTimeMillis)</code>
<div class="block">
Attempts to acquire a lock named <code>name</code>.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#lockInterruptibly-java.lang.Object-long-long-">lockInterruptibly</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;name,
long&nbsp;waitTimeMillis,
long&nbsp;leaseTimeMillis)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">as of GemFire 5.1, use <a href="../../../../org/apache/geode/distributed/DistributedLockService.html#lock-java.lang.Object-long-long-"><code>lock(Object, long, long)</code></a> with waitTimeMillis
instead</span></div>
</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#resumeLocking--">resumeLocking</a></span>()</code>
<div class="block">Allow locking to resume in this DistributedLockService instance.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#suspendLocking-long-">suspendLocking</a></span>(long&nbsp;waitTimeMillis)</code>
<div class="block">Suspend granting of locks in this service.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#suspendLockingInterruptibly-long-">suspendLockingInterruptibly</a></span>(long&nbsp;waitTimeMillis)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">as of GemFire 5.1, use <a href="../../../../org/apache/geode/distributed/DistributedLockService.html#suspendLocking-long-"><code>suspendLocking(long)</code></a> with waitTimeMillis instead</span></div>
</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#unlock-java.lang.Object-">unlock</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;name)</code>
<div class="block">Release the lock previously granted for the given <code>name</code>.</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.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="DistributedLockService--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DistributedLockService</h4>
<pre>protected&nbsp;DistributedLockService()</pre>
<div class="block">Public instance creation is prohibited - use <a href="../../../../org/apache/geode/distributed/DistributedLockService.html#create-java.lang.String-org.apache.geode.distributed.DistributedSystem-"><code>create(String, DistributedSystem)</code></a></div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="create-java.lang.String-org.apache.geode.distributed.DistributedSystem-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/geode/distributed/DistributedLockService.html" title="class in org.apache.geode.distributed">DistributedLockService</a>&nbsp;create(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;serviceName,
<a href="../../../../org/apache/geode/distributed/DistributedSystem.html" title="class in org.apache.geode.distributed">DistributedSystem</a>&nbsp;ds)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></pre>
<div class="block">Create a DistributedLockService with the given serviceName for the given DistributedSystem.
This DistributedLockService will continue to manage locks until <code><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#destroy-java.lang.String-"><code>destroy(java.lang.String)</code></a></code>
is called, or <code>ds</code> is disconnected, at which point any locks that were held by this
instance are released.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>serviceName</code> - the name of the DistributedLockService to create.</dd>
<dd><code>ds</code> - the <code>DistributedSystem</code> for the new service instance to use for
distributed lock messaging.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the newly created DistributedLockService</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if serviceName is an illegal name or this process has already
created a DistributedLockService with the given <code>serviceName</code>.</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if this process is in the middle of disconnecting from the
<code>DistributedSystem</code></dd>
</dl>
</li>
</ul>
<a name="getServiceNamed-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getServiceNamed</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/geode/distributed/DistributedLockService.html" title="class in org.apache.geode.distributed">DistributedLockService</a>&nbsp;getServiceNamed(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;serviceName)</pre>
<div class="block">Look up and return the DistributedLockService with the given name, if it has been created in
this VM. If it has not been created, return null.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>serviceName</code> - the name of the DistributedLockService to look up</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the DistributedLockService with the given name, or null if it hasn't been created in
this VM.</dd>
</dl>
</li>
</ul>
<a name="destroy-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>destroy</h4>
<pre>public static&nbsp;void&nbsp;destroy(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;serviceName)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></pre>
<div class="block">Destroy a previously created DistributedLockService with the given <code>serviceName</code>.
Any locks currently held in this DistributedLockService by this process are released. Attempts
to access a destroyed lock service will result in a <a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed"><code>LockServiceDestroyedException</code></a> being
thrown.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>serviceName</code> - the name of the instance to destroy, previously supplied in the
<code>create(String, DistributedSystem)</code> invocation.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if this process hasn't created a DistributedLockService with
the given <code>serviceName</code> and <code>dm</code>.</dd>
</dl>
</li>
</ul>
<a name="lock-java.lang.Object-long-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>lock</h4>
<pre>public abstract&nbsp;boolean&nbsp;lock(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;name,
long&nbsp;waitTimeMillis,
long&nbsp;leaseTimeMillis)</pre>
<div class="block"><p>
Attempts to acquire a lock named <code>name</code>. Returns <code>true</code> as soon as the
lock is acquired. If the lock is currently held by another thread in this or any other process
in the distributed system, or another thread in the system has locked the entire service, this
method keeps trying to acquire the lock for up to <code>waitTimeMillis</code> before giving up
and returning <code>false</code>. If the lock is acquired, it is held until
<code>unlock(Object name)</code> is invoked, or until <code>leaseTimeMillis</code> milliseconds
have passed since the lock was granted - whichever comes first.
<p>
Locks are reentrant. If a thread invokes this method n times on the same instance, specifying
the same <code>name</code>, without an intervening release or lease expiration expiration on
the lock, the thread must invoke <code>unlock(name)</code> the same number of times before the
lock is released (unless the lease expires). When this method is invoked for a lock that is
already acquired, the lease time will be set to the maximum of the remaining least time from
the previous invocation, or <code>leaseTimeMillis</code>
<p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the lock to acquire in this service. This object must conform to the
general contract of <code>equals(Object)</code> and <code>hashCode()</code> as described
in <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang"><code>Object.hashCode()</code></a>.</dd>
<dd><code>waitTimeMillis</code> - the number of milliseconds to try to acquire the lock before giving up
and returning false. A value of -1 causes this method to block until the lock is
acquired. A value of 0 causes this method to return false without waiting for the lock
if the lock is held by another member or thread.</dd>
<dd><code>leaseTimeMillis</code> - the number of milliseconds to hold the lock after granting it, before
automatically releasing it if it hasn't already been released by invoking
<a href="../../../../org/apache/geode/distributed/DistributedLockService.html#unlock-java.lang.Object-"><code>unlock(Object)</code></a>. If <code>leaseTimeMillis</code> is -1, hold the lock until
explicitly unlocked.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the lock was acquired, false if the timeout <code>waitTimeMillis</code> passed
without acquiring the lock.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if this lock service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="lockInterruptibly-java.lang.Object-long-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>lockInterruptibly</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public abstract&nbsp;boolean&nbsp;lockInterruptibly(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;name,
long&nbsp;waitTimeMillis,
long&nbsp;leaseTimeMillis)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">as of GemFire 5.1, use <a href="../../../../org/apache/geode/distributed/DistributedLockService.html#lock-java.lang.Object-long-long-"><code>lock(Object, long, long)</code></a> with waitTimeMillis
instead</span></div>
<div class="block"><p>
Attempts to acquire a lock named <code>name</code>. Returns <code>true</code> as soon as the
lock is acquired. If the lock is currently held by another thread in this or any other process
in the distributed system, or another thread in the system has locked the entire service, this
method keeps trying to acquire the lock for up to <code>waitTimeMillis</code> before giving up
and returning <code>false</code>. If the lock is acquired, it is held until
<code>unlock(Object name)</code> is invoked, or until <code>leaseTimeMillis</code> milliseconds
have passed since the lock was granted - whichever comes first.
<p>
Locks are reentrant. If a thread invokes this method n times on the same instance, specifying
the same <code>name</code>, without an intervening release or lease expiration expiration on
the lock, the thread must invoke <code>unlock(name)</code> the same number of times before the
lock is released (unless the lease expires). When this method is invoked for a lock that is
already acquired, the lease time will be set to the maximum of the remaining least time from
the previous invocation, or <code>leaseTimeMillis</code>
<p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the lock to acquire in this service. This object must conform to the
general contract of <code>equals(Object)</code> and <code>hashCode()</code> as described
in <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang"><code>Object.hashCode()</code></a>.</dd>
<dd><code>waitTimeMillis</code> - the number of milliseconds to try to acquire the lock before giving up
and returning false. A value of -1 causes this method to block until the lock is
acquired.</dd>
<dd><code>leaseTimeMillis</code> - the number of milliseconds to hold the lock after granting it, before
automatically releasing it if it hasn't already been released by invoking
<a href="../../../../org/apache/geode/distributed/DistributedLockService.html#unlock-java.lang.Object-"><code>unlock(Object)</code></a>. If <code>leaseTimeMillis</code> is -1, hold the lock until
explicitly unlocked.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the lock was acquired, false if the timeout <code>waitTimeMillis</code> passed
without acquiring the lock.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - if the thread is interrupted before or during this method.</dd>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if this lock service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="unlock-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unlock</h4>
<pre>public abstract&nbsp;void&nbsp;unlock(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;name)
throws <a href="../../../../org/apache/geode/distributed/LeaseExpiredException.html" title="class in org.apache.geode.distributed">LeaseExpiredException</a></pre>
<div class="block">Release the lock previously granted for the given <code>name</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the object to unlock in this service.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/geode/distributed/LockNotHeldException.html" title="class in org.apache.geode.distributed">LockNotHeldException</a></code> - if the current thread is not the owner of this lock</dd>
<dd><code><a href="../../../../org/apache/geode/distributed/LeaseExpiredException.html" title="class in org.apache.geode.distributed">LeaseExpiredException</a></code> - if the current thread was the owner of this lock, but it's lease
has expired.</dd>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if the service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="isHeldByCurrentThread-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isHeldByCurrentThread</h4>
<pre>public abstract&nbsp;boolean&nbsp;isHeldByCurrentThread(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;name)</pre>
<div class="block">Determine whether the current thread owns the lock on the given object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the lock object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the current thread owns the lock for <code>name</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if this service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="suspendLockingInterruptibly-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>suspendLockingInterruptibly</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public abstract&nbsp;boolean&nbsp;suspendLockingInterruptibly(long&nbsp;waitTimeMillis)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">as of GemFire 5.1, use <a href="../../../../org/apache/geode/distributed/DistributedLockService.html#suspendLocking-long-"><code>suspendLocking(long)</code></a> with waitTimeMillis instead</span></div>
<div class="block">Suspend granting of locks in this service. When locking has been suspended, no other thread in
the distributed system will be granted a lock for any new or existing name in that service
until locking is resumed by the thread that suspended it. Only one thread at a time in a
distributed system is permitted suspend locking on a given DistributedLockService instance.
This method blocks until lock suspension can be granted to the current thread, and all
outstanding locks on names in this service held by other threads in the distributed system have
been released, or until <code>waitTimeMillis</code> milliseconds have passed without
successfully granting suspension.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>waitTimeMillis</code> - the number of milliseconds to try to acquire suspension before giving up
and returning false. A value of -1 causes this method to block until suspension is
granted.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if suspension was granted, false if the timeout <code>waitTimeMillis</code> passed
before it could be granted.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if the current thread already has suspended locking on this
instance.</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - if the current thread is interrupted.</dd>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if the service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="suspendLocking-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>suspendLocking</h4>
<pre>public abstract&nbsp;boolean&nbsp;suspendLocking(long&nbsp;waitTimeMillis)</pre>
<div class="block">Suspend granting of locks in this service. When locking has been suspended, no other thread in
the distributed system will be granted a lock for any new or existing name in that service
until locking is resumed by the thread that suspended it. Only one thread at a time in a
distributed system is permitted suspend locking on a given DistributedLockService instance.
This method blocks until lock suspension can be granted to the current thread, and all
outstanding locks on names in this service held by other threads in the distributed system have
been released, or until <code>waitTimeMillis</code> milliseconds have passed without
successfully granting suspension.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>waitTimeMillis</code> - the number of milliseconds to try to acquire suspension before giving up
and returning false. A value of -1 causes this method to block until suspension is
granted. A value of 0 causes this method to return false without waiting for the lock if
the lock is held by another member or thread.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if suspension was granted, false if the timeout <code>waitTimeMillis</code> passed
before it could be granted.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if the current thread already has suspended locking on this
instance</dd>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if the service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="resumeLocking--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resumeLocking</h4>
<pre>public abstract&nbsp;void&nbsp;resumeLocking()</pre>
<div class="block">Allow locking to resume in this DistributedLockService instance.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if the current thread didn't previously suspend locking</dd>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if the service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="isLockingSuspendedByCurrentThread--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isLockingSuspendedByCurrentThread</h4>
<pre>public abstract&nbsp;boolean&nbsp;isLockingSuspendedByCurrentThread()</pre>
<div class="block">Determine whether the current thread has suspended locking in this DistributedLockService.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if locking is suspended by the current thread.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if this service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="freeResources-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>freeResources</h4>
<pre>public abstract&nbsp;void&nbsp;freeResources(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;name)</pre>
<div class="block">Free internal resources associated with the given <code>name</code>. This may reduce this VM's
memory use, but may also prohibit performance optimizations if <code>name</code> is
subsequently locked in this VM.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the lock object</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if this service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="becomeLockGrantor--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>becomeLockGrantor</h4>
<pre>public abstract&nbsp;void&nbsp;becomeLockGrantor()</pre>
<div class="block">Specifies this member to become the grantor for this lock service. The grantor will be the lock
authority which is responsible for handling all lock requests for this service. Other members
will request locks from this member. Locking for this member is optimized as it will not
require messaging to acquire a given lock.
<p>
Calls to this method will block until grantor authority has been transferred to this member.
<p>
If another member calls <code>becomeLockGrantor</code> after this member, that member will
transfer grantor authority from this member to itself.
<p>
This operation should not be invoked repeatedly in an application. It is possible to create a
lock service and have two or more members endlessly calling becomeLockGrantor to transfer
grantorship back and forth.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if this service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="becomeLockGrantor-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>becomeLockGrantor</h4>
<pre>public static&nbsp;void&nbsp;becomeLockGrantor(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;serviceName)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></pre>
<div class="block">Specifies that this member should become the grantor for the named locking service.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>serviceName</code> - the name of the locking service</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>serviceName</code> does not refer to any registered
locking service in this process</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#becomeLockGrantor--"><code>becomeLockGrantor()</code></a></dd>
</dl>
</li>
</ul>
<a name="isLockGrantor--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isLockGrantor</h4>
<pre>public abstract&nbsp;boolean&nbsp;isLockGrantor()</pre>
<div class="block">Returns true if this member is currently the lock authority responsible for granting locks for
this service. This can be explicitly requested by calling
<a href="../../../../org/apache/geode/distributed/DistributedLockService.html#becomeLockGrantor--"><code>becomeLockGrantor()</code></a>. If no member
has explicitly requested grantor authority, then one member participating in the service will
be implicitly selected. In either case, this method returns true if the calling member is the
grantor.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this member is the grantor for this service</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/geode/distributed/LockServiceDestroyedException.html" title="class in org.apache.geode.distributed">LockServiceDestroyedException</a></code> - if lock service has been destroyed</dd>
</dl>
</li>
</ul>
<a name="isLockGrantor-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isLockGrantor</h4>
<pre>public static&nbsp;boolean&nbsp;isLockGrantor(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;serviceName)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></pre>
<div class="block">Returns true if this member is the grantor for the named service.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>serviceName</code> - the name of the locking service</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this member is the grantor for this service</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>serviceName</code> does not refer to any registered
locking service in this process</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/geode/distributed/DistributedLockService.html#isLockGrantor--"><code>isLockGrantor()</code></a></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>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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="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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/geode/distributed/ConfigurationProperties.html" title="interface in org.apache.geode.distributed"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/geode/distributed/DistributedMember.html" title="interface in org.apache.geode.distributed"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/geode/distributed/DistributedLockService.html" target="_top">Frames</a></li>
<li><a href="DistributedLockService.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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><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>Field&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>