Revision 47839 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.compat/org.gvsig.compat.api/src/main/java/org/gvsig/compat/net/ICancellable.java

View differences:

ICancellable.java
24 24
package org.gvsig.compat.net;
25 25

  
26 26
/**
27
 * <p>When a task is accessing to remote data, takes an indeterminate time, and occasionally gets locked. That's
28
 * the reason a task should support to be cancelable.</p>
29
 * <p><code>ICancellable</code> interface is designed for getting information about the cancellation of a
30
 * task of downloading remote information.</p>
27
 * <p>
28
 * When a task is accessing to remote data, takes an indeterminate time, and
29
 * occasionally gets locked. That's the reason a task should support to be
30
 * cancelable.</p>
31
 * <p>
32
 * <code>ICancellable</code> interface is designed for getting information about
33
 * the cancellation of a task of downloading remote information.</p>
31 34
 */
32 35
public interface ICancellable {
33
	/**
34
	 * <p>Returns <code>true</code> if a download or a group of downloads tasks has been canceled.</p>
35
	 * 
36
	 * @return <code>true</code> if a download or a group of downloads tasks has been canceled, otherwise <code>false</code>
37
	 */
38
	public boolean isCanceled();
39
	
40
	/**
41
	 * <p>Used to cancel only a group of downloads tasks with the same identifier.</p>
42
	 * 
43
	 * @return the identifier
44
	 */
45
	public Object getID();
36

  
37
    public static final ICancellable DUMB = new ICancellable() {
38
        @Override
39
        public boolean isCanceled() {
40
            return false;
41
        }
42

  
43
        @Override
44
        public Object getID() {
45
            return ICancellable.class.getName();
46
        }
47
    };
48

  
49
    /**
50
     * <p>
51
     * Returns <code>true</code> if a download or a group of downloads tasks has
52
     * been canceled.</p>
53
     *
54
     * @return <code>true</code> if a download or a group of downloads tasks has
55
     * been canceled, otherwise <code>false</code>
56
     */
57
    public boolean isCanceled();
58

  
59
    /**
60
     * <p>
61
     * Used to cancel only a group of downloads tasks with the same
62
     * identifier.</p>
63
     *
64
     * @return the identifier
65
     */
66
    public Object getID();
46 67
}

Also available in: Unified diff