01: /* ExecutionsCtrl.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Mon Jun 6 12:20:51 2005, Created by tomyeh
10: }}IS_NOTE
11:
12: Copyright (C) 2005 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.zk.ui.sys;
20:
21: import org.zkoss.zk.ui.Execution;
22: import org.zkoss.zk.ui.Executions;
23:
24: /**
25: * Additional utilities for {@link Execution}.
26: *
27: * @author tomyeh
28: */
29: public class ExecutionsCtrl extends Executions {
30: protected ExecutionsCtrl() {
31: } //prevent from instantiation
32:
33: /** Sets the execution for the current thread.
34: * Called only internally.
35: *
36: * <p>Note: you have to clean up the current execution
37: * with try/finally:
38: * <pre><code>
39: * setCurrent(exec);
40: * try {
41: * ...
42: * finally {
43: * setCurrent(null);
44: * }
45: */
46: public static final void setCurrent(Execution exec) {
47: _exec.set(exec);
48: }
49:
50: /** Returns the current {@link ExecutionCtrl}.
51: */
52: public static final ExecutionCtrl getCurrentCtrl() {
53: return (ExecutionCtrl) getCurrent();
54: }
55: }
|