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: CallException.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 call 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 CallException extends LightweightError implements
22: ControlFlowRuntimeException {
23: private static final long serialVersionUID = 4288971544223559163L;
24:
25: private ContinuationContext mContext = null;
26: private Object mTarget = null;
27:
28: /**
29: * [PRIVATE AND UNSUPPORTED] Instantiates a new call exception.
30: * <p>This is used by the instrumented bytecode that provides
31: * continuations support, it's not intended for general use.
32: * @param context the active continuation context
33: * @param target the call target
34: * @since 1.6
35: */
36: public CallException(ContinuationContext context, Object target) {
37: super ();
38:
39: context.setPaused(true);
40:
41: mContext = context;
42: mTarget = target;
43: }
44:
45: /**
46: * Retrieves the context of this call continuation.
47: *
48: * @return this call continuation's context
49: * @since 1.6
50: */
51: public ContinuationContext getContext() {
52: return mContext;
53: }
54:
55: /**
56: * Retrieves the target of this call continuation.
57: *
58: * @return this call continuation's target
59: * @since 1.6
60: */
61: public Object getTarget() {
62: return mTarget;
63: }
64: }
|