| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.util; |
| | |
| | | |
| | | boolean innerCancel(final boolean mayInterruptIfRunning) |
| | | { |
| | | if (!setStatePending()) |
| | | if (!isCancelable() || !setStatePending()) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 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. |
| | | * |