001: //
002: // This file is part of the prose package.
003: //
004: // The contents of this file are subject to the Mozilla Public License
005: // Version 1.1 (the "License"); you may not use this file except in
006: // compliance with the License. You may obtain a copy of the License at
007: // http://www.mozilla.org/MPL/
008: //
009: // Software distributed under the License is distributed on an "AS IS" basis,
010: // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
011: // for the specific language governing rights and limitations under the
012: // License.
013: //
014: // The Original Code is prose.
015: //
016: // The Initial Developer of the Original Code is Andrei Popovici. Portions
017: // created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
018: // All Rights Reserved.
019: //
020: // Contributor(s):
021: // $Id: ExceptionJoinPointImpl.java,v 1.1.1.1 2003/07/02 15:30:50 apopovic Exp $
022: // =====================================================================
023: //
024: // (history at end)
025: //
026:
027: package ch.ethz.inf.iks.jvmai.jvmdi;
028:
029: // used packages
030: import ch.ethz.jvmai.ExceptionJoinPoint;
031: import ch.ethz.jvmai.JoinPointKinds;
032:
033: /**
034: * Abstract class ExceptionJoinPoint represents a
035: * joinpoint related to an exception
036: *
037: * @version $Revision: 1.1.1.1 $
038: * @author Philippe Schoch
039: * @author Andrei Popovici
040: */
041: public class ExceptionJoinPointImpl extends CodeJoinPointImpl implements
042: ExceptionJoinPoint, JoinPointKinds {
043:
044: protected Throwable exception;
045: protected Class handlerClass;
046:
047: protected ExceptionJoinPointImpl(ControlFlow cf,
048: JoinPointContext ctx) {
049: super (cf, ctx);
050: target = null;
051: }
052:
053: /**
054: * Specifies the exception object that has been thrown.
055: */
056: public Throwable getException() {
057: return exception;
058: }
059:
060: /** True if there is a handler
061: */
062: public boolean hasHandler() {
063: return (handlerClass != null);
064: }
065:
066: public Class handlerClass() {
067: return handlerClass;
068: }
069:
070: public String getKind() {
071: return ExceptionJoinPoint.KIND;
072: }
073:
074: public int getMask() {
075: return MASK_CODE_JP | MASK_EXCEPTION_THROW_ARGS_JP;
076: }
077:
078: }
079:
080: //======================================================================
081: //
082: // $Log: ExceptionJoinPointImpl.java,v $
083: // Revision 1.1.1.1 2003/07/02 15:30:50 apopovic
084: // Imported from ETH Zurich
085: //
086: // Revision 1.5 2003/05/06 15:51:14 popovici
087: // Mozilla-ification
088: //
089: // Revision 1.4 2003/05/05 17:46:24 popovici
090: // Refactorization step (runes->prose) cleanup
091: //
092: // Revision 1.3 2003/04/17 08:47:03 popovici
093: // Important functionality additions
094: // - Cflow specializers
095: // - Restructuring of the MethodCut, SetCut, ExceptionCut, and GetCut (they are much smaller)
096: // - Transactional capabilities
097: // - Total refactoring of Specializer evaluation, which permits fine-grained distinction
098: // between static and dynamic specializers.
099: // - Functionality pulled up in abstract classes
100: // - Uniformization of advice methods patterns and names
101: //
102: // Revision 1.2 2003/03/04 16:09:32 popovici
103: // Documentation improvements
104: //
105: // Revision 1.1 2003/03/04 11:26:32 popovici
106: // Important refactorization step (march):
107: // - removal of 'JoinPointEvents'; JoinPoints now have the same function as events
108: // - reimplementation of the JVMAIDebuggerAspectInterface (better performance, coding conventions, removal of ProseVM
109: // structures
110: //
111: // Revision 1.1 2002/10/17 12:23:41 pschoch
112: // Added throw capabability to JVMAI
113: //
|