KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > inf > iks > jvmai > jvmdi > ExceptionJoinPointImpl


1 //
2
// This file is part of the prose package.
3
//
4
// The contents of this file are subject to the Mozilla Public License
5
// Version 1.1 (the "License"); you may not use this file except in
6
// compliance with the License. You may obtain a copy of the License at
7
// http://www.mozilla.org/MPL/
8
//
9
// Software distributed under the License is distributed on an "AS IS" basis,
10
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
// for the specific language governing rights and limitations under the
12
// License.
13
//
14
// The Original Code is prose.
15
//
16
// The Initial Developer of the Original Code is Andrei Popovici. Portions
17
// created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
18
// All Rights Reserved.
19
//
20
// Contributor(s):
21
// $Id: ExceptionJoinPointImpl.java,v 1.1.1.1 2003/07/02 15:30:50 apopovic Exp $
22
// =====================================================================
23
//
24
// (history at end)
25
//
26

27 package ch.ethz.inf.iks.jvmai.jvmdi;
28
29 // used packages
30
import java.util.*;
31 import java.io.*;
32 import ch.ethz.jvmai.JoinPoint;
33 import ch.ethz.jvmai.ExceptionJoinPoint;
34 import ch.ethz.jvmai.JoinPointKinds;
35
36
37 /**
38  * Abstract class ExceptionJoinPoint represents a
39  * joinpoint related to an exception
40  *
41  * @version $Revision: 1.1.1.1 $
42  * @author Philippe Schoch
43  * @author Andrei Popovici
44  */

45 public
46 class ExceptionJoinPointImpl extends CodeJoinPointImpl implements ExceptionJoinPoint,JoinPointKinds {
47
48   protected Throwable JavaDoc exception;
49   protected Class JavaDoc handlerClass;
50
51   protected ExceptionJoinPointImpl(ControlFlow cf, JoinPointContext ctx)
52     {
53       super(cf,ctx);
54       target = null;
55     }
56
57     /**
58      * Specifies the exception object that has been thrown.
59      */

60     public Throwable JavaDoc getException()
61     {
62       return exception;
63     }
64
65     /** True if there is a handler
66      */

67     public boolean hasHandler()
68     {
69       return (handlerClass != null);
70     }
71
72     public Class JavaDoc handlerClass()
73     {
74     return handlerClass;
75     }
76
77
78     public String JavaDoc getKind()
79     {
80     return ExceptionJoinPoint.KIND;
81     }
82
83   public int getMask()
84     {
85       return MASK_CODE_JP | MASK_EXCEPTION_THROW_ARGS_JP;
86     }
87
88 }
89
90
91 //======================================================================
92
//
93
// $Log: ExceptionJoinPointImpl.java,v $
94
// Revision 1.1.1.1 2003/07/02 15:30:50 apopovic
95
// Imported from ETH Zurich
96
//
97
// Revision 1.5 2003/05/06 15:51:14 popovici
98
// Mozilla-ification
99
//
100
// Revision 1.4 2003/05/05 17:46:24 popovici
101
// Refactorization step (runes->prose) cleanup
102
//
103
// Revision 1.3 2003/04/17 08:47:03 popovici
104
// Important functionality additions
105
// - Cflow specializers
106
// - Restructuring of the MethodCut, SetCut, ExceptionCut, and GetCut (they are much smaller)
107
// - Transactional capabilities
108
// - Total refactoring of Specializer evaluation, which permits fine-grained distinction
109
// between static and dynamic specializers.
110
// - Functionality pulled up in abstract classes
111
// - Uniformization of advice methods patterns and names
112
//
113
// Revision 1.2 2003/03/04 16:09:32 popovici
114
// Documentation improvements
115
//
116
// Revision 1.1 2003/03/04 11:26:32 popovici
117
// Important refactorization step (march):
118
// - removal of 'JoinPointEvents'; JoinPoints now have the same function as events
119
// - reimplementation of the JVMAIDebuggerAspectInterface (better performance, coding conventions, removal of ProseVM
120
// structures
121
//
122
// Revision 1.1 2002/10/17 12:23:41 pschoch
123
// Added throw capabability to JVMAI
124
//
125
Popular Tags