KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > util > ASyncProcess


1 /******************************************************************************
2  * The contents of this file are subject to the Compiere License Version 1.1
3  * ("License"); You may not use this file except in compliance with the License
4  * You may obtain a copy of the License at http://www.compiere.org/license.html
5  * Software distributed under the License is distributed on an "AS IS" basis,
6  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
7  * the specific language governing rights and limitations under the License.
8  * The Original Code is Compiere ERP & CRM Business Solution
9  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
10  * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.util;
15
16 import org.compiere.process.*;
17
18 /**
19  * Async Process Interface.
20  * <p>
21  * The Process implements the methods.
22  * The Worker is started like
23  * <code> MyWorker.start()</code>
24  * <p>
25  * The worker's run method basically executes
26  * <pre>
27  * process.lockUI(pi);
28  * process.executeAsync(pi);
29  * process.unlockUI(pi);
30  * </pre>
31  * The isUILocked() method is used internally (not called by worker).
32  *
33  * @author Jorg Janke
34  * @version $Id: ASyncProcess.java,v 1.3 2003/02/15 06:31:15 jjanke Exp $
35  */

36 public interface ASyncProcess
37 {
38     /**
39      * Lock User Interface.
40      * Called from the Worker before processing
41      * @param pi process info
42      */

43     public void lockUI (ProcessInfo pi);
44
45     /**
46      * Unlock User Interface.
47      * Called from the Worker when processing is done
48      * @param pi result of execute ASync call
49      */

50     public void unlockUI (ProcessInfo pi);
51
52     /**
53      * Is the UI locked (Internal method)
54      * @return true, if UI is locked
55      */

56     boolean isUILocked();
57
58     /**
59      * Method to be executed async.
60      * Called from the Worker
61      * @param pi ProcessInfo
62      */

63     public void executeASync (ProcessInfo pi);
64
65 } // ASyncProcess
66
Popular Tags