From 6439bba5cc09d6febc59bdc9e0d9bc25f1f1eb18 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Wed, 01 Sep 2010 09:04:15 +0000
Subject: [PATCH] Various improvements:
---
sdk/src/com/sun/opends/sdk/util/AbstractFutureResult.java | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/sdk/src/com/sun/opends/sdk/util/AbstractFutureResult.java b/sdk/src/com/sun/opends/sdk/util/AbstractFutureResult.java
index a0b0120..1d478d0 100644
--- a/sdk/src/com/sun/opends/sdk/util/AbstractFutureResult.java
+++ b/sdk/src/com/sun/opends/sdk/util/AbstractFutureResult.java
@@ -22,7 +22,7 @@
* CDDL HEADER END
*
*
- * Copyright 2009 Sun Microsystems, Inc.
+ * Copyright 2009-2010 Sun Microsystems, Inc.
*/
package com.sun.opends.sdk.util;
@@ -125,7 +125,7 @@
boolean innerCancel(final boolean mayInterruptIfRunning)
{
- if (!setStatePending())
+ if (!isCancelable() || !setStatePending())
{
return false;
}
@@ -410,6 +410,20 @@
/**
+ * Indicates whether this future result can be canceled.
+ *
+ * @return {@code true} if this future result is cancelable or {@code false}
+ * otherwise.
+ */
+ protected boolean isCancelable()
+ {
+ // Return true by default.
+ return true;
+ }
+
+
+
+ /**
* Appends a string representation of this future's state to the provided
* builder.
*
--
Gitblit v1.10.0