01: /* Operation.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Sep 29, 2007 9:20:35 AM 2007, Created by Dennis.Chen
10: }}IS_NOTE
11:
12: Copyright (C) 2007 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zkex.zul.impl;
20:
21: import org.zkoss.zk.ui.Desktop;
22:
23: /**
24: * This interface is for model sharer developer only, you rarely need to use this interface.<br/>
25: * A model sharer will add Operation to {@link OperationQueue}, then {@link OperationThread} which monitor this queue
26: * will consume operations and {@link #execute(Desktop)} it.<br/>
27: * The method {@link #failToExecute(Desktop)} will be invoked when
28: * <ol>
29: * <li>Any Exception occurs when execute</li>
30: * <li>Thread is terminate by {@link OperationThread#terminate()}</li>
31: * <li>Desktop is no longer available</li>
32: * </ol>
33: *
34: *
35: * @author Dennis.Chen
36: * @since 3.0.0
37: */
38: public interface Operation {
39:
40: /**
41: * Execute the operation.<br/>
42: * The {@link OperationThread} will activate desktop first,
43: * then call this method, and then call deactivate.<br/>
44: * @param desktop the desktop which {@link OperationThread} associate to.
45: */
46: public void execute(Desktop desktop);
47:
48: /**
49: * Notify when
50: * 1.any Exception occurs when execute
51: * 2.thread is terminate by {@link OperationThread#terminate()}
52: * 3.desktop is not longer available
53: * @param desktop the Desktop which {@link OperationThread} associate to.
54: */
55: public void failToExecute(Desktop desktop);
56: }
|