Source Code Cross Referenced for StaticInitializationAspect.java in  » Aspect-oriented » aspectwerkz-2.0 » test » staticinitialization » 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 » Aspect oriented » aspectwerkz 2.0 » test.staticinitialization 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**************************************************************************************
002:         * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved.                 *
003:         * http://aspectwerkz.codehaus.org                                                    *
004:         * ---------------------------------------------------------------------------------- *
005:         * The software in this package is published under the terms of the LGPL license      *
006:         * a copy of which has been included with this distribution in the license.txt file.  *
007:         **************************************************************************************/package test.staticinitialization;
008:
009:        import org.codehaus.aspectwerkz.definition.Pointcut;
010:        import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
011:        import org.codehaus.aspectwerkz.joinpoint.StaticJoinPoint;
012:
013:        /**
014:         * Aspect on staticinitialization pointcut.
015:         * 
016:         * @author <a href="mailto:the_mindstorm@evolva.ro">Alex Popescu</a>
017:         * 
018:         * @Aspect("perClass")
019:         */
020:        public class StaticInitializationAspect {
021:            /**
022:             * @Expression staticinitialization(test.staticinitialization.ClinitTarget) 
023:             */
024:            Pointcut staticInitialization;
025:
026:            /**
027:             * @Expression staticinitialization(@StaticInitializationService)
028:             */
029:            Pointcut staticServiceInitialization;
030:
031:            /**
032:             * @Expression staticinitialization(@StaticInitializationService test.staticinitialization.*)
033:             */
034:            Pointcut staticPatternInitialization;
035:
036:            /**
037:             * @Before staticInitialization
038:             */
039:            public void beforeStaticInitializer() {
040:                StaticInitializationTest.s_messages
041:                        .add(StaticInitializationTest.BEFORE_EXPECTED_MESSAGES[0]);
042:            }
043:
044:            /**
045:             * @Before staticServiceInitialization
046:             */
047:            public void beforeStaticServiceInitialization() {
048:                StaticInitializationTest.s_messages
049:                        .add(StaticInitializationTest.BEFORE_EXPECTED_MESSAGES[0]);
050:            }
051:
052:            /**
053:             * @Before staticPatternInitialization
054:             */
055:            public void beforeStaticPatternInitialization() {
056:                StaticInitializationTest.s_messages
057:                        .add(StaticInitializationTest.BEFORE_EXPECTED_MESSAGES[0]);
058:            }
059:
060:            /**
061:             * @Before staticInitialization
062:             */
063:            public void beforeStaticInitialization(StaticJoinPoint sjp) {
064:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
065:            }
066:
067:            /**
068:             * @Before staticServiceInitialization
069:             */
070:            public void beforeStaticServiceInitialization(StaticJoinPoint sjp) {
071:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
072:            }
073:
074:            /**
075:             * @Before staticPatternInitialization
076:             */
077:            public void beforeStaticPatternInitialization(StaticJoinPoint sjp) {
078:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
079:            }
080:
081:            /**
082:             * @Before staticInitialization
083:             */
084:            public void beforeStaticInitialization(JoinPoint jp) {
085:                StaticInitializationTest.s_joinPoints.add(jp);
086:            }
087:
088:            /**
089:             * @Before staticServiceInitialization
090:             */
091:            public void beforeStaticServiceInitialization(JoinPoint jp) {
092:                StaticInitializationTest.s_joinPoints.add(jp);
093:            }
094:
095:            /**
096:             * @Before staticPatternInitialization
097:             */
098:            public void beforeStaticPatternInitialization(JoinPoint jp) {
099:                StaticInitializationTest.s_joinPoints.add(jp);
100:            }
101:
102:            /**
103:             * @Around staticInitialization
104:             */
105:            public Object aroundStaticInitialization(StaticJoinPoint sjp)
106:                    throws Throwable {
107:                StaticInitializationTest.s_messages
108:                        .add(StaticInitializationTest.BEFORE_EXPECTED_MESSAGES[1]);
109:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
110:
111:                return sjp.proceed();
112:            }
113:
114:            /**
115:             * @Around staticServiceInitialization
116:             */
117:            public Object aroundStaticServiceInitialization(StaticJoinPoint sjp)
118:                    throws Throwable {
119:                StaticInitializationTest.s_messages
120:                        .add(StaticInitializationTest.BEFORE_EXPECTED_MESSAGES[1]);
121:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
122:
123:                return sjp.proceed();
124:            }
125:
126:            /**
127:             * @Around staticPatternInitialization
128:             */
129:            public Object aroundStaticPatternInitialization(StaticJoinPoint sjp)
130:                    throws Throwable {
131:                StaticInitializationTest.s_messages
132:                        .add(StaticInitializationTest.BEFORE_EXPECTED_MESSAGES[1]);
133:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
134:
135:                return sjp.proceed();
136:            }
137:
138:            /**
139:             * @Around staticInitialization
140:             */
141:            public Object aroundStaticInitialization(JoinPoint jp)
142:                    throws Throwable {
143:                StaticInitializationTest.s_messages
144:                        .add(StaticInitializationTest.BEFORE_EXPECTED_MESSAGES[2]);
145:                StaticInitializationTest.s_joinPoints.add(jp);
146:
147:                return jp.proceed();
148:            }
149:
150:            /**
151:             * @Around staticServiceInitialization
152:             */
153:            public Object aroundStaticServiceInitialization(JoinPoint jp)
154:                    throws Throwable {
155:                StaticInitializationTest.s_messages
156:                        .add(StaticInitializationTest.BEFORE_EXPECTED_MESSAGES[2]);
157:                StaticInitializationTest.s_joinPoints.add(jp);
158:
159:                return jp.proceed();
160:            }
161:
162:            /**
163:             * @Around staticPatternInitialization
164:             */
165:            public Object aroundStaticPatternInitialization(JoinPoint jp)
166:                    throws Throwable {
167:                StaticInitializationTest.s_messages
168:                        .add(StaticInitializationTest.BEFORE_EXPECTED_MESSAGES[2]);
169:                StaticInitializationTest.s_joinPoints.add(jp);
170:
171:                return jp.proceed();
172:            }
173:
174:            /**
175:             * @AfterReturning staticInitialization
176:             */
177:            public void afterReturningStaticInitializer() {
178:                StaticInitializationTest.s_messages
179:                        .add(StaticInitializationTest.AFTER_EXPECTED_MESSAGES[0]);
180:            }
181:
182:            /**
183:             * @AfterReturning staticServiceInitialization
184:             */
185:            public void afterReturningServiceInitializer() {
186:                StaticInitializationTest.s_messages
187:                        .add(StaticInitializationTest.AFTER_EXPECTED_MESSAGES[0]);
188:            }
189:
190:            /**
191:             * @AfterReturning staticPatternInitialization
192:             */
193:            public void afterReturningPatternInitializer() {
194:                StaticInitializationTest.s_messages
195:                        .add(StaticInitializationTest.AFTER_EXPECTED_MESSAGES[0]);
196:            }
197:
198:            /**
199:             * @AfterReturning staticInitialization
200:             */
201:            public void afterReturningStaticInitializer(StaticJoinPoint sjp) {
202:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
203:            }
204:
205:            /**
206:             * @AfterReturning staticServiceInitialization
207:             */
208:            public void afterReturningServiceInitializer(StaticJoinPoint sjp) {
209:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
210:            }
211:
212:            /**
213:             * @AfterReturning staticPatternInitialization
214:             */
215:            public void afterReturningPatternInitializer(StaticJoinPoint sjp) {
216:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
217:            }
218:
219:            /**
220:             * @AfterReturning staticInitialization
221:             */
222:            public void afterReturningStaticInitializer(JoinPoint jp) {
223:                StaticInitializationTest.s_joinPoints.add(jp);
224:            }
225:
226:            /**
227:             * @AfterReturning staticServiceInitialization
228:             */
229:            public void afterReturningServiceInitializer(JoinPoint jp) {
230:                StaticInitializationTest.s_joinPoints.add(jp);
231:            }
232:
233:            /**
234:             * @AfterReturning staticPatternInitialization
235:             */
236:            public void afterReturningPatternInitializer(JoinPoint jp) {
237:                StaticInitializationTest.s_joinPoints.add(jp);
238:            }
239:
240:            /**
241:             * @After staticInitialization
242:             */
243:            public void afterStaticInitializer() {
244:                StaticInitializationTest.s_messages
245:                        .add(StaticInitializationTest.AFTER_EXPECTED_MESSAGES[1]);
246:            }
247:
248:            /**
249:             * @After staticServiceInitialization
250:             */
251:            public void afterServiceInitializer() {
252:                StaticInitializationTest.s_messages
253:                        .add(StaticInitializationTest.AFTER_EXPECTED_MESSAGES[1]);
254:            }
255:
256:            /**
257:             * @After staticPatternInitialization
258:             */
259:            public void afterPatternInitializer() {
260:                StaticInitializationTest.s_messages
261:                        .add(StaticInitializationTest.AFTER_EXPECTED_MESSAGES[1]);
262:            }
263:
264:            /**
265:             * @After staticInitialization
266:             */
267:            public void afterStaticInitializer(StaticJoinPoint sjp) {
268:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
269:            }
270:
271:            /**
272:             * @After staticServiceInitialization
273:             */
274:            public void afterServiceInitializer(StaticJoinPoint sjp) {
275:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
276:            }
277:
278:            /**
279:             * @After staticPatternInitialization
280:             */
281:            public void afterPatternInitializer(StaticJoinPoint sjp) {
282:                StaticInitializationTest.s_staticJoinPoints.add(sjp);
283:            }
284:
285:            /**
286:             * @After staticInitialization
287:             */
288:            public void afterStaticInitializer(JoinPoint jp) {
289:                StaticInitializationTest.s_joinPoints.add(jp);
290:            }
291:
292:            /**
293:             * @After staticServiceInitialization
294:             */
295:            public void afterServiceInitializer(JoinPoint jp) {
296:                StaticInitializationTest.s_joinPoints.add(jp);
297:            }
298:
299:            /**
300:             * @After staticPatternInitialization
301:             */
302:            public void afterPatternInitializer(JoinPoint jp) {
303:                StaticInitializationTest.s_joinPoints.add(jp);
304:            }
305:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.