KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > prose > filter > ExecutionsInSystemClass


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: ExecutionsInSystemClass.java,v 1.1.1.1 2003/07/02 15:30:52 apopovic Exp $
22
// =====================================================================
23
//
24
// (history at end)
25
//
26

27 package ch.ethz.prose.filter;
28
29 // used packages
30
import java.util.*;
31 import java.io.*;
32 import ch.ethz.jvmai.JoinPointKinds;
33 import ch.ethz.jvmai.JoinPoint;
34 import ch.ethz.jvmai.CodeJoinPoint;
35 import ch.ethz.prose.engine.JoinPointRequest;
36 import ch.ethz.prose.engine.MethodEntryRequest;
37 import ch.ethz.prose.engine.MethodExitRequest;
38
39 /**
40  * Class ExecutionsInSystemClass XXX
41  *
42  * @version $Revision: 1.1.1.1 $
43  * @author Andrei Popovici
44  */

45 public
46 class ExecutionsInSystemClass extends PointCutter implements JoinPointKinds
47 {
48
49   /**
50    * XXX
51    * @param XXX XXX
52    */

53   public ExecutionsInSystemClass()
54     {
55       acceptMask = MASK_ALL_JP;
56       mayFilterStaticallyMask = MASK_METHOD_ENTRY_JP|MASK_METHOD_EXIT_JP;
57       canFilterStaticallyMask = MASK_METHOD_ENTRY_JP|MASK_METHOD_EXIT_JP;
58     }
59
60   protected boolean doIsSpecialRequest(JoinPointRequest req)
61     {
62       if (req instanceof MethodEntryRequest)
63     return ( (MethodEntryRequest)req).getTargetClass().getClassLoader() == null;
64
65       if (req instanceof MethodEntryRequest)
66     return ( (MethodEntryRequest)req).getTargetClass().getClassLoader() == null;
67
68       throw new Error JavaDoc("The PointCutter should not allow" +
69               " events other than MASK_METHOD_ENTRY|MASK_METHOD_EXIT");
70
71     }
72
73   protected boolean doIsSpecialEvent(CodeJoinPoint jp)
74     {
75       return (jp.getMethod().getDeclaringClass().getClassLoader() == null);
76     }
77 }
78
79
80 //======================================================================
81
//
82
// $Log: ExecutionsInSystemClass.java,v $
83
// Revision 1.1.1.1 2003/07/02 15:30:52 apopovic
84
// Imported from ETH Zurich
85
//
86
// Revision 1.2 2003/05/06 15:51:38 popovici
87
// Mozilla-ification
88
//
89
// Revision 1.1 2003/05/05 13:57:50 popovici
90
// renaming from runes to prose
91
//
92
// Revision 1.3 2003/04/27 13:08:50 popovici
93
// Specializers renamed to PointCutter
94
//
95
// Revision 1.2 2003/04/17 12:49:36 popovici
96
// Refactoring of the crosscut package
97
// ExceptionCut renamed to ThrowCut
98
// McutSignature is now SignaturePattern
99
//
100
// Revision 1.1 2003/04/17 08:47:43 popovici
101
// Important functionality additions
102
// - Cflow specializers
103
// - Restructuring of the MethodCut, SetCut, ThrowCut, and GetCut (they are much smaller)
104
// - Transactional capabilities
105
// - Total refactoring of Specializer evaluation, which permits fine-grained distinction
106
// between static and dynamic specializers.
107
// - Functionality pulled up in abstract classes
108
// - Uniformization of advice methods patterns and names
109
//
110
Popular Tags