Source Code Cross Referenced for ORingPointCutter.java in  » Byte-Code » PROSE » ch » ethz » prose » filter » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Byte Code » PROSE » ch.ethz.prose.filter 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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: ORingPointCutter.java,v 1.2 2003/07/17 13:11:08 apopovic Exp $
022:        // =====================================================================
023:        //
024:        // (history at end)
025:        //
026:
027:        package ch.ethz.prose.filter;
028:
029:        // used packages
030:        import java.util.List;
031:        import java.util.Vector;
032:        import ch.ethz.jvmai.CodeJoinPoint;
033:        import ch.ethz.prose.engine.JoinPointRequest;
034:
035:        /**
036:         * Class ORingPointCutter composes two sub-PointCuters into a composite
037:         * PointCutter using OR semantic.
038:         *
039:         * @version	$Revision: 1.2 $
040:         * @author	Andrei Popovici
041:         */
042:
043:        class ORingPointCutter extends PointCutter {
044:
045:            private static final long serialVersionUID = 3258134635178637367L;
046:            PointCutter spec1;
047:            PointCutter spec2;
048:
049:            /** Create a composite PointCutter with <code>spec1</code> and <code>spec2</code>
050:             * as members, composed using 'OR' semantics.
051:             */
052:            protected ORingPointCutter(PointCutter spec1, PointCutter spec2) {
053:                if (spec1 == null || spec2 == null)
054:                    throw new IllegalArgumentException(
055:                            "Null Pointer argument in ANDPointCutter.<init>");
056:
057:                this .acceptMask = spec1.acceptMask | spec2.acceptMask;
058:                mayFilterStaticallyMask = spec1.mayFilterStaticallyMask
059:                        | spec2.mayFilterStaticallyMask;
060:                canFilterStaticallyMask = spec1.canFilterStaticallyMask
061:                        & spec2.canFilterStaticallyMask;
062:
063:                this .spec1 = spec1;
064:                this .spec2 = spec2;
065:            }
066:
067:            /** Return the two members of this OR PointCutter. */
068:            public List memberPointFilters() {
069:                Vector result = new Vector();
070:                result.add(spec1);
071:                result.add(spec2);
072:                return result;
073:            }
074:
075:            /** Retrn true if either of the specializers passed in the crosscut
076:             *  does static filtering and one of them consider <code>r1</code> as special.
077:             *
078:             *  @return true if either of the sub-specializers agree that r1 is a static
079:             *  special request.
080:             */
081:            protected boolean doIsSpecialRequest(JoinPointRequest r1) {
082:
083:                // we get here IF AND ONLY IF (spec1.mayFilter | spec2.mayFilter) is fits the r1.mask
084:                // in case it 0, then the abstract crosscut specializer has already
085:                // said 'yes'.
086:                // the following conditions reads as follows:
087:                // (if spec1 may filter r1 AND it actually filters it) OR (spec3 may filter ..)
088:                return (spec1.isSpecialRequest(r1))
089:                        || (spec2.isSpecialRequest(r1));
090:            }
091:
092:            /** Retrn true if either of the memer PointCutters passed in the crosscut
093:             *  does dynamic filtering and one of them consider <code>e1</code> as special.
094:             *  undefined.
095:             *
096:             *  @return true if either of the sub-specializers agree that r1 is a dynamic
097:             *  special event.
098:             */
099:            protected boolean doIsSpecialEvent(CodeJoinPoint e1) {
100:                // we get here IF AND ONLY IF this is an accepted event AND
101:                // either of spec1, spec2 cannot filter e1 (spec1.canFilter & spec2.canFilter) & r1.mask == 0
102:                // in this case, the following condition reads
103:                // as follows: if spec1 can filte  said 'yes'.
104:                // the following conditions reads as follows:
105:                // if spec1 has filtered this event filtered e1 then return true,
106:                /// else filter-it with is special event else
107:                // if spec2 has filtered this event statically return true else
108:                // ask is special event
109:                return (spec1.isSpecialEvent(e1)) || (spec2.isSpecialEvent(e1));
110:
111:            }
112:
113:            public String toString() {
114:                return "(" + spec1.toString() + ") OR (" + spec2.toString()
115:                        + ")";
116:            }
117:
118:        }
119:
120:        //======================================================================
121:        //
122:        // $Log: ORingPointCutter.java,v $
123:        // Revision 1.2  2003/07/17 13:11:08  apopovic
124:        // refactorization: from PointFilter.memberSpecializers to PointFilter.memberPointFilters;
125:        // improved documentation (removed references to specializers)
126:        //
127:        // Revision 1.1.1.1  2003/07/02 15:30:52  apopovic
128:        // Imported from ETH Zurich
129:        //
130:        // Revision 1.2  2003/05/06 15:51:41  popovici
131:        // Mozilla-ification
132:        //
133:        // Revision 1.1  2003/05/05 13:57:48  popovici
134:        // renaming from runes to prose
135:        //
136:        // Revision 1.1  2003/04/27 13:08:45  popovici
137:        // Specializers renamed to PointCutter
138:        //
139:        // Revision 1.5  2003/04/17 12:49:35  popovici
140:        // Refactoring of the crosscut package
141:        //  ExceptionCut renamed to ThrowCut
142:        //  McutSignature is now SignaturePattern
143:        //
144:        // Revision 1.4  2003/04/17 08:47:50  popovici
145:        // Important functionality additions
146:        //  - Cflow specializers
147:        //  - Restructuring of the MethodCut, SetCut, ThrowCut, and GetCut (they are much smaller)
148:        //  - Transactional capabilities
149:        //  - Total refactoring of Specializer evaluation, which permits fine-grained distinction
150:        //    between static and dynamic specializers.
151:        //  - Functionality pulled up in abstract classes
152:        //  - Uniformization of advice methods patterns and names
153:        //
154:        // Revision 1.3  2003/03/04 18:24:14  popovici
155:        // Refactoring of the specializer. De-obfuscation
156:        // by exposing the inner classes of the factory methods
157:        // The specializer implementations now end in 'filter',
158:        // whereas the old factory methods 'xxxS' remain
159:        // pure bootstrap objects.
160:        //
161:        // Revision 1.2  2003/03/04 11:27:23  popovici
162:        // Important refactorization step (march):
163:        // - removal of 'JoinPointEvents'; JoinPoints now have the same function as events
164:        // - reimplementation of the JVMAIDebuggerAspectInterface (better performance, coding conventions, removal of ProseVM
165:        //   structures
166:        //
167:        // Revision 1.1  2002/05/07 10:46:59  popovici
168:        // Reorganization of the Specializer package. All specializer related classes
169:        // moved to ch.ethz.inf.crossucut.spec; Classes ORingPointCutter, ANDspecializer and NOTspecializer is
170:        // introduced, the static analysis of filtering simplified, because now specializers
171:        // contain a field 'filterType' which is propagated to the root of composite specializers. junit packages updated accordingly
172:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.