1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
|
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>AspectJ Installation Note</title>
<STYLE TYPE="text/css">
<!--
/* FOR THE SDA PAGE */
/*
BODY {margin-top: 15px; margin-left: 15px; margin-right: 15px;}
*/
A:link {
color:#4756AC;
}
A:visited {
color:#60657B;
}
A:hover {
color:red
}
INPUT {font:12px "Courier New", sans-serif;}
H2 {
font:18px/18px Verdana, Arial, Helvetica, sans-serif;
color:black;
font-weight:bold;
margin-left: 10px;
line-height:110%;
}
H3 {
font:18px/18px Verdana, Arial, Helvetica, sans-serif;
color:black;
font-weight:bold;
margin-left: 10px;
line-height:110%;
}
H4 {
font:15px/16px Verdana, Arial, Helvetica, sans-serif;
color:black;
font-weight:bold;
margin-left: 10px;
line-height:140%;
}
P {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
margin-right: 10px;
margin-left: 10px;
line-height:130%;
}
.paragraph {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
margin-right: 10px;
margin-left: 10px;
line-height:130%;
}
.smallParagraph {
font:11px/11px Verdana, Arial, Helvetica, sans-serif;
margin-right: 10px;
margin-left: 10px;
line-height:130%;
}
LI {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
text-align:justify;
margin-right: 10px;
margin-left: 15px;
line-height:120%;
}
/*
UL {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
text-align:justify;
margin-right: 10px;
margin-left: 15px;
line-height:120%;
}*/
DL {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
text-align:justify;
margin-right: 10px;
margin-left: 15px;
line-height:120%;
}
B { font:13px/13px Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
line-height:140%;
}
.footer {
font:10px/10px Verdana, Arial, Helvetica, sans-serif;
color:#888888;
text-align:left
}
.figureTitle {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
text-align:justify;
text-align:center
}
.copyrightNotice {
font:10px/10px Verdana, Arial, Helvetica, sans-serif;
color:#999999;
line-height:110%;
}
.smallHeading {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
line-height:110%;
}
.tinyHeading {
font:11px/11px Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
line-height:120%;
}
.newsText {
font:11px/11px Verdana, Arial, Helvetica, sans-serif;
line-height:130%;
}
.smallParagraph {
font:11px/11px Verdana, Arial, Helvetica, sans-serif;
line-height:130%;
}
.fancyHeading {
font:20px/20px Chantilly, Arial, Helvetica, sans-serif;
margin-right: 10px;
color:#6f7a92;
margin-left: 10px;
line-height:130%;
}
-->
</STYLE>
</head>
<BODY BGCOLOR="white">
<h3 align="center">AspectJ Demo</h3>
<h4>1. Installing the Demo</h4>
<ul>
<li>Extract the contents of "aspectj-demo.zip" to
"C:\aspectj-demo", resulting in the following directory structure:
<ul>
<li>C:\aspectj-demo
<ul>
<li>apps</li>
<li>bin</li>
<li>examples</li>
<li>slides</li>
</ul>
</li>
</ul>
</li>
<li>Verify that JBuilder 4 is using the correct project by opening it, closing
all of the current projects
<ul>
<li>Under the "File" menu select "Close Projects...",
select all of the open projects and close them</li>
<li>Under the "File" menu select "Open Project...",
and open "C:\aspectj-demo\examples\jbuilder\Spacewar.jpr"</li>
<li>You should now be able to compile "Spacewar". If
ajdeForJBuilder reports any problems refer to
"C:\aspectj-demo\apps\aspectj0.8\doc\primer\tools\ajdeForJBuilder.html"</li>
</ul>
</li>
<li>Set up your "Windows Taskbar" to be permanently visible by
right-clicking the bar, selecting "Properties", and un-checking
"Auto hide"</li>
<li>From your "Windows Explorer" drag the
"C:\aspectj-demo\bin\Demo" folder to the "Windows
Taskbar". This will have the effect of placing the demo buttons
on the taskbar. To remove the buttons drag off the "Demo"
toolbar and close the resulting floating toolbar window.</li>
<li>It is useful to have the "Task Manager" running in the
"System Tray" during the demo in order to see when the debugger is
loading since it is slow. To launch it right-click the "Windows
Taskbar" and select "Task Manager", then minimize the window.
</li>
</ul>
<h4>2. Initial Setup</h4>
<ul>
<li>Emacs Setup
<ul>
<li>Click "Emacs", and move the cursor to the beginning of the
"spacewar.Ship.fire" method</li>
</ul>
</li>
<li>JBuilder Setup
<ul>
<li>Click "JBuilder", open the "AspectJ Structure
View", and bring the editor to the "spacewar.Ship.fire"
method</li>
<li>under the "Spacewar.jpr" node in the "Project
Explorer" (left pane of main window) expand the "spacewar"
package to see its classes</li>
<li>ensure that the last compile was done without "Debug.java"
in the build configuration</li>
</ul>
</li>
<li>Forte Setup
<ul>
<li>Click "Forte", click the "AspectJ Structure View"
button, and navigate the editor to the "spacewar.EnsureShipIsAlive"
class </li>
</ul>
</li>
<li>AJDoc Setup
<ul>
<li>click "AJDoc", browse to the "spacewar/Ship.java"
class</li>
</ul>
</li>
</ul>
<h4>3. Running the Demo</h4>
<ul>
<li>Emacs
<ul>
<li>At the declaration of the "spacewar.Ship.fire" method hit
"<cntrl>x, <cntrl>j"</li>
<li>Follow the resulting popup menu to the "EnsureShipIsAlive"
advice</li>
<li>Navigate back to "spacewar.Ship.fire" using the same method</li>
</ul>
</li>
<li>JBuilder
<ul>
<li>Navigation
<ul>
<li>In the "Structure View" select the "fire"
method and expand it's children to reveal "EnsureShipIsAlive:
around..."</li>
<li>Double-click "EnsureShipIsAlive: around..." to navigate
to that advice declaration</li>
<li>Navigate back using the same method, or using the
"Back", then "Forward" method in conjuntion with
the structure tree (this navigation can also be done by
right-clicking the inline advice icons in the editor's gutter)</li>
</ul>
</li>
<li>Compilation
<ul>
<li>In "EnsureShipIsAlive" remove "ship" from the
"proceed(ship)" call and recompile.</li>
<li>When the error message pops up fix it by replacing
"ship"</li>
</ul>
</li>
<li>Build Configuration
<ul>
<li>Double-click "Default.lst" and select the "lst
Designer" tab at the bottom of the editor pane</li>
<li>Expand the "spacewar" node</li>
<li>Click "Debug.java" in order to add it to the
configuration</li>
<li>Navigate to the "Ship.java" class so that the effects of
the new compilation are visible in the "Structure View"
when the compilation completes</li>
<li>Compile "Default.lst"</li>
<li>Run the project (top the execution of the project by clicking the
red stop button in the run messages pane)</li>
</ul>
</li>
<li>Debugging
<ul>
<li>Start the debugger</li>
<li>When the "Please select launch parameters..." dialog
pops up click "OK"</li>
<li>Select the "Classes" tab (4th tab from the top)</li>
<li>When the game starts, expand "spacewar", expand "Ship.java"</li>
<li>Browse to the "fire" method and expand it</li>
<li>Right-click on the "fire" method and select "stop
in spaceawar.Ship.fire"</li>
<li>Wait for the breakpoint to be hit</li>
<li>Use the "Step Into" button (5th button on the bottom
from the left) to single step the file until you step through the
advice and into the body of the fire method</li>
<li>Click the red stop button (1st button) in order to stop the
debugging</li>
</ul>
</li>
</ul>
</li>
<li>Forte
<ul>
<li>Currently no Forte demo (fyi: navigate the structure the same way as
in JBuilder, and right-click the LST files to compile them, right click
"Game.java" to execute it)</li>
</ul>
</li>
<li>AJDoc
<ul>
<li>Scroll down to the "fire" method, and follow it's
"Advised by: " link to get to the "EnsureShipIsAlive"
aspect</li>
</ul>
</li>
</ul>
<p> </p>
</body>
</html>
|