01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: PauseException.java 3813 2007-06-25 18:22:03Z gbevin $
07: */
08: package com.uwyn.rife.continuations.exceptions;
09:
10: import com.uwyn.rife.continuations.ContinuationContext;
11: import com.uwyn.rife.tools.exceptions.ControlFlowRuntimeException;
12: import com.uwyn.rife.tools.exceptions.LightweightError;
13:
14: /**
15: * This exception will be thrown when a pause continuation is triggered.
16: *
17: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
18: * @version $Revision: 3813 $
19: * @since 1.6
20: */
21: public class PauseException extends LightweightError implements
22: ControlFlowRuntimeException {
23: private static final long serialVersionUID = 181863837154043654L;
24:
25: private ContinuationContext mContext = null;
26:
27: /**
28: * [PRIVATE AND UNSUPPORTED] Instantiates a new pause exception.
29: * <p>This is used by the instrumented bytecode that provides
30: * continuations support, it's not intended for general use.
31: * @param context the active continuation context
32: * @since 1.6
33: */
34: public PauseException(ContinuationContext context) {
35: context.setPaused(true);
36:
37: mContext = context;
38: }
39:
40: /**
41: * Retrieves the context of this pause continuation.
42: *
43: * @return this pause continuation's context
44: * @since 1.6
45: */
46: public ContinuationContext getContext() {
47: return mContext;
48: }
49: }
|