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: ContinuableLocalVariableUncloneableException.java 3813 2007-06-25 18:22:03Z gbevin $
07: */
08: package com.uwyn.rife.continuations.exceptions;
09:
10: /**
11: * Thrown when a local variable in a {@link com.uwyn.rife.continuations.ContinuationStack}
12: * couldn't be cloned when a continuation is resumed.
13: *
14: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
15: * @version $Revision: 3813 $
16: * @since 1.6
17: */
18: public class ContinuableLocalVariableUncloneableException extends
19: CloneNotSupportedException {
20: private static final long serialVersionUID = -6226277931198774505L;
21:
22: private Class mContinuableClass = null;
23: private String mLocalVarType = null;
24:
25: /**
26: * Instantiates a new exception.
27: *
28: * @param continuableClass the class of the continuable that contains an
29: * unclonable local variable
30: * @param localVarType the type of the local variable
31: * @param cause the cause of the retrieval failure; or
32: * <p>{@code null} if there was no exception cause
33: * @since 1.6
34: */
35: public ContinuableLocalVariableUncloneableException(
36: Class continuableClass, String localVarType, Throwable cause) {
37: super ("The continuable with class name '"
38: + continuableClass.getName()
39: + "' uses a local method variable of type '"
40: + localVarType + "' which is not cloneable.");
41:
42: initCause(cause);
43:
44: mContinuableClass = continuableClass;
45: mLocalVarType = localVarType;
46: }
47:
48: /**
49: * Retrieves the class of the continuable that contains an unclonable
50: * local variable.
51: *
52: * @return the class of the continuable
53: * @since 1.6
54: */
55: public Class getContinuableClass() {
56: return mContinuableClass;
57: }
58:
59: /**
60: * The type of the local variable that can't be cloned.
61: *
62: * @return the type of the local variable
63: * @since 1.6
64: */
65: public String getLocalVarType() {
66: return mLocalVarType;
67: }
68: }
|