Project

General

Profile

« Previous | Next » 

Revision 3087df1b

Added by Cherian Mathew over 8 years ago

#5297 Refactor ProgressMonitorController, Add Remoting Progress monitor

#5297 Add progress monitor service, Add test services

#5297 Add monit import method

#5297 Update no. of work units

#5297 Add new thread class for remoting monitors

#5297 Add owner field to monitor thread and user checks in service

#5297 Add javadoc

View differences:

cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/monitor/IProgressMonitor.java
1 1

  
2 2
package eu.etaxonomy.cdm.common.monitor;
3 3

  
4
import java.io.Serializable;
5

  
4 6

  
5 7

  
6 8
/**
7
 * This progress monitor interface is ad adaptation of the eclipse 
9
 * This progress monitor interface is ad adaptation of the eclipse
8 10
 * org.eclipse.core.runtime.IProgressMonitor ;
9
 * 
11
 *
10 12
 * The <code>IProgressMonitor</code> interface is implemented
11 13
 * by objects that monitor the progress of an activity; the methods
12 14
 * in this interface are invoked by code that performs the activity.
......
40 42
 * Clients may implement this interface.
41 43
 * </p>
42 44
 */
43
public interface IProgressMonitor {
45
public interface IProgressMonitor extends Serializable {
44 46

  
45 47
	/** Constant indicating an unknown amount of work.
46 48
	 */
......
49 51
	/**
50 52
	 * Notifies that the main task is beginning.  This must only be called once
51 53
	 * on a given progress monitor instance.
52
	 * 
54
	 *
53 55
	 * @param name the name (or description) of the main task
54 56
	 * @param totalWork the total number of work units into which
55
	 *  the main task is been subdivided. If the value is <code>UNKNOWN</code> 
56
	 *  the implementation is free to indicate progress in a way which 
57
	 *  the main task is been subdivided. If the value is <code>UNKNOWN</code>
58
	 *  the implementation is free to indicate progress in a way which
57 59
	 *  doesn't require the total number of work units in advance.
58 60
	 */
59 61
	public void beginTask(String name, int totalWork);
60 62

  
61 63
	/**
62
	 * Notifies that the work is done; that is, either the main task is completed 
63
	 * or the user canceled it. This method may be called more than once 
64
	 * Notifies that the work is done; that is, either the main task is completed
65
	 * or the user canceled it. This method may be called more than once
64 66
	 * (implementations should be prepared to handle this case).
65 67
	 */
66 68
	public void done();
......
79 81

  
80 82
	/**
81 83
	 * Sets the cancel state to the given value.
82
	 * 
84
	 *
83 85
	 * @param value <code>true</code> indicates that cancelation has
84 86
	 *     been requested (but not necessarily acknowledged);
85 87
	 *     <code>false</code> clears this flag
......
88 90
	public void setCanceled(boolean value);
89 91

  
90 92
	/**
91
	 * Sets the task name to the given value. This method is used to 
92
	 * restore the task label after a nested operation was executed. 
93
	 * Sets the task name to the given value. This method is used to
94
	 * restore the task label after a nested operation was executed.
93 95
	 * Normally there is no need for clients to call this method.
94 96
	 *
95 97
	 * @param name the name (or description) of the main task
......
114 116
	 * @param work a non-negative number of work units just completed
115 117
	 */
116 118
	public void worked(int work);
117
	
119

  
118 120
    /**
119 121
     * Internal method to handle scaling correctly. This method
120
     * must not be called by a client. Clients should 
122
     * must not be called by a client. Clients should
121 123
     * always use the method </code>worked(int)</code>.
122
     * 
124
     *
123 125
     * @param work the amount of work done
124 126
     */
125 127
    public void internalWorked(double work);
126
	
127
	
128

  
129

  
128 130
	/**
129 131
	 * Notifies about a warning
130 132
	 * @param message
131 133
	 */
132 134
	public void warning(String message);
133
	
135

  
134 136
	/**
135 137
	 * Notifies about a warning that was caused by an exception.
136 138
	 * @param message
137 139
	 * @param throwable
138 140
	 */
139 141
	public void warning(String message, Throwable throwable);
140
	
142

  
141 143
}
142 144

  
143 145

  

Also available in: Unified diff