-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbonus-challenge.html
52 lines (52 loc) · 2.61 KB
/
bonus-challenge.html
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
<!DOCTYPE html>
<html>
<head>
<title>AIP Week None: Message driven beans and asynchrony</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link href="resources/normalize.css" rel="stylesheet" />
<link href="resources/stylize.css" rel="stylesheet" />
</head>
<body>
<div class="menu">
<ul>
<li><a href="https://online.uts.edu.au/">UTS Online</a></li>
<li class="title">/</li>
<li><a href="index.html">Learning</a></li>
<li class="title">/</li>
<li class="title">Bonus Materials</li>
</ul>
<ul>
<li><a href="bonus.html">Study</a></li>
<li><a href="bonus-practice.html">Practice</a></li>
<li class="title">Challenge</li>
<li><a href="bonus-solutions.html">Solutions</a></li>
</ul>
</div>
<div class="container">
<h1>Message driven beans and asynchrony</h1>
<p><i>Practice for Bonus Materials</i></p>
<div class="section">
<input id="sec1" type="checkbox" autocomplete="off" />
<label for="sec1"><h2>Introduction</h2></label>
<div class="content">
<p>By now, you will have gained a great deal of confidence and skill in this subject.</p>
<p>Each week, you have built a simple application that demonstrates the essential ideas of a technology in the Java EE specifications.</p>
<p>Your challenge for the bonus materials is to come up with your own activity.</p>
<p>Create a simple project that demonstrates either message driven beans and/or asynchronous methods.</p>
<h3>Hints</h3>
<p>You can send messages to a message driven bean, even before you've written the bean.
Can you write and run code that sends a message, then after you've sent the message, write some code that will recieve the message?</p>
<p>For asynchronous, can you create an EJB method that is slow (e.g., <code>Thread.sleep(10000);</code>) but eventually outputs data to the log file.
What happens when you annotate that method with <code>@Asynchronous</code>?</p>
<p>If your asynchronous method returns a future, how long does it take to call and wait for several asynchronous methods to return?</p>
<p>You can measure time in Java as follows:</p>
<pre><code>long start = System.currentTimeMillis();
// ... do some slow processing, then ...
long durationInMilliseconds = System.currentTimeMillis() - start;
</code></pre>
</div>
</div>
</div>
</body>
</html>