Mobility Related Items on Java.nethttp://www.java.net/taxonomy/term/19/all?type=All
enCongratulations - you're a (horrible) mobile developer! from Apache Cordova in Action by Raymond Camdenhttp://www.java.net/blog/manningpubs/archive/2015/01/18/congratulations-youre-horrible-mobile-developer-apache-cordova-action-raymond-camden
<div class="field field-type-filefield field-field-thumb-100x70">
<div class="field-items">
<div class="field-item odd">
<img class="imagefield imagefield-field_thumb_100x70" width="150" height="188" alt="" src="http://www.java.net/sites/default/files/manning_pubs/camden_cover150.jpg?1421627201" /> </div>
</div>
</div>
<p> Save 40% on <a href=http://manning.com/camden/>Apache Cordova in Action</a> with discount code <b> jn15acia </b>at manning.com</p>
<p>Ok, that may be just a tiny bit over the top, but most likely there is a bit of truth to it as well. You know how to install Cordova, how to generate native binaries from HTML, and how to make use of fancy device features with plugins. That’s all fairly straightforward: Install a SDK, install the command line tool, write some HTML, and whammo, see it on your device. But that doesn’t mean you know how to create a good mobile application. Taste is subjective.</p>
<p>While it is difficult to precisely describe what makes a good mobile application, there are definitely a set of guidelines that help define what a successful mobile application looks like. And notice I'm not saying a successful hybrid mobile application. Your users don't care what you used to build your application. They only care about the end result. Therefore the guidelines for a good hybrid mobile application are going to be same as a good 100% native built mobile application as well. </p>
<p>A good mobile application is readable on a variety of form factors. Whether opened in an iPhone 5 or some enormous Android phablet, text should be readable and buttons easy to click with fat fingers. A good mobile application demonstrates these features: </p>
<ul>
<li>It has a simple, easily understandable user interface. By using common design idioms (a shopping cart icon for example) users have a better idea of what to expect when using your application. </li>
<li>It performs well with little to no noticeable lag. </li>
<li>It works in a variety of network conditions (both off and online). </li>
<h3>A Good Example of Bad UI </h3>
<p>Imagine the most simple application possible - an application that prompts you for your name and then simply tells you hello. Figure 1 is a mock-up of the UI for the application, both the initial view and what is displayed after entering a name. </p>
<p><img src="http://www.java.net/sites/default/files/Fig1.png" title="Fig1"></p>
<p><b><i>Figure 1 Our simple little application. Looks pretty now, right? </i></b></p>
<p>Building this application would be rather trivial. You should create a new Cordova application if you want to test this. The source code is available in the zip downloaded from the Manning web site. You will find it in the c5/simple folder. Listing 1 represents the HTML used for the application. </p>
<p><b>Listing 1 Simple application HTML (simple/www/index.html)</b></p>
<pre class="prettyprint"><code><html> <br /> <head> <br /> <title>Simple App</title> <br /> </head> <br /> <br /> <body> <br /> <br /> <form id="nameForm"> <br /> <label for="name">Enter your name</label> #1 <br /> <input type="text" id="name" name="name"> #2 <br /> <input type="submit" value="Submit"> #3 <br /> </form> <br /> <br /> <div id="result"></div> #4 <br /> <br /> <script src="cordova.js"></script> <br /> <script src="js/app.js"></script> <br /> </body> <br /></html> </code></pre>
<p><b>
<ul>
<li>#1 Label used to prompt for your name. </li>
<li>#2 Input field where the user enters their name. </li>
<li>#3 Button used to submit the form. </li>
<li>#4 Empty div that will be filled with the user's name. </li>
</ul>
<p></b></p>
<p>There isn't anything particularly interesting about this code, but note the lack of any styling via an embedded or included CSS file. That's totally OK - you don't have to style anything, but as you can probably guess, this is going to bite us in the rear in a few moments. Now look at the JavaScript in listing 2. </p>
<p><b>Listing 2 Simple application JavaScript (simple/www/js/app.js) </b></p>
<pre class="prettyprint"><code>document.addEventListener("deviceready", init, false); function init() { <br /> <br /> document.querySelector("#nameForm").addEventListener("submit", <br /> function(e) { <br /> e.preventDefault(); <br /> var name = document.querySelector("#name").value; var msg = "Hello, "+name; <br /> document.querySelector("#result").innerText = msg; <br /> }, false); <br /> <br />} </code></pre>
<p>So far so good. Since our application has one feature (get the name and display it), the code is trivial to the point of being pointless. To be clear, this is not something you want to use Cordova for, but it will be very useful in demonstrating the type of design issues you're going to be running into when building hybrid applications. Let's fire up the application and send it to an Android device to see how beautiful it looks. </p>
<p><img src="http://weblogs.java.net/sites/default/files/fig2a.png" title="fig2a"></p>
<p><b><i>Figure 2 Our simple application is displayed in Android<</i></b></p>
<p>While readable in this book, that text would be rather small on a real mobile device. The field where users need to enter their name is also somewhat small. Your author has rather large hands and if there was anything else by that field it would be difficult to not touch the wrong thing. Even worse, the button to submit the form is tiny. If your user needs to carefully think before they interact with your application than you've probably got a problem. Figure 3 calls out these issues, and more. </p>
<p><img src="http://www.java.net/sites/default/files/fig3_0.png" title="fig3"></p>
<p><b><i>Figure 3 Our application's UI criticized. </i></b></p>
<p>This is a perfect example of a case where our code works, but isn't optimized for the mobile platform. This is definitely not a bug in Cordova, it simply reflects the fact that when building hybrid applications, you need to think differently than you would when building web sites for the desktop. </p>
<table id="attachments" class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><a href="http://www.java.net/sites/default/files/Fig1.png">Fig1.png</a></td><td>9.04 KB</td> </tr>
<tr class="even"><td><a href="http://www.java.net/sites/default/files/fig3_0.png">fig3.png</a></td><td>17.33 KB</td> </tr>
<tr class="odd"><td><a href="http://www.java.net/sites/default/files/fig2a.png">fig2a.png</a></td><td>44.87 KB</td> </tr>
</tbody>
</table>
http://www.java.net/blog/manningpubs/archive/2015/01/18/congratulations-youre-horrible-mobile-developer-apache-cordova-action-raymond-camden#commentsBlogsJava ToolsMobilitySun, 18 Jan 2015 17:04:02 +0000manning_pubs931455 at http://www.java.netSOAP and/or REST and/or WebSocketshttp://www.java.net/blog/haroldcarr/archive/2012/10/02/soap-andor-rest-andor-websockets
<!-- | 3484 --><div id="content">
<h1 class="title">SOAP and/or REST and/or WebSockets</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Intro</a>
<ul>
<li><a href="#sec-1-1">1.1 BOF6984 : SOAP and/or REST and/or WebSockets</a></li>
<li><a href="#sec-1-2">1.2 disclaimer</a></li>
<li><a href="#sec-1-3">1.3 JavaOne / Oracle</a></li>
<li><a href="#sec-1-4">1.4 other WebSockets presentations</a></li>
<li><a href="#sec-1-5">1.5 other WebSockets presentations</a></li>
<li><a href="#sec-1-6">1.6 other SOAP presentations</a></li>
<li><a href="#sec-1-7">1.7 other REST presentations</a></li>
<li><a href="#sec-1-8">1.8 other REST presentations</a></li>
<li><a href="#sec-1-9">1.9 discussion points</a></li>
<li><a href="#sec-1-10">1.10 discussion points</a></li>
<li><a href="#sec-1-11">1.11 discussion points</a></li>
<li><a href="#sec-1-12">1.12 discussion points</a></li>
</ul>
</li>
<li><a href="#sec-2">2 top-level use-cases</a>
<ul>
<li><a href="#sec-2-1">2.1 top-level use-cases</a></li>
<li><a href="#sec-2-2">2.2 top-level use-cases</a></li>
</ul>
</li>
<li><a href="#sec-3">3 WebSockets</a>
<ul>
<li><a href="#sec-3-1">3.1 Motivation: high penetration / server push</a></li>
<li><a href="#sec-3-2">3.2 timeline</a></li>
<li><a href="#sec-3-3">3.3 timeline</a></li>
<li><a href="#sec-3-4">3.4 timeline details</a></li>
<li><a href="#sec-3-5">3.5 timeline details</a></li>
<li><a href="#sec-3-6">3.6 timeline details</a></li>
<li><a href="#sec-3-7">3.7 client SSE example</a></li>
<li><a href="#sec-3-8">3.8 Comparison between WebSockets and Comet</a></li>
<li><a href="#sec-3-9">3.9 WebSockets properties</a></li>
<li><a href="#sec-3-10">3.10 WebSockets properties</a></li>
<li><a href="#sec-3-11">3.11 client WebSockets example</a></li>
<li><a href="#sec-3-12">3.12 WebSockets negatives</a></li>
<li><a href="#sec-3-13">3.13 WebSockets negatives</a></li>
</ul>
</li>
<li><a href="#sec-4">4 SOAP and WebSockets</a>
<ul>
<li><a href="#sec-4-1">4.1 SOAP/WebSocket potential benefits</a></li>
<li><a href="#sec-4-2">4.2 MS-SWSB : SOAP Over WebSocket Protocol Binding Specification</a></li>
<li><a href="#sec-4-3">4.3 SOAP/WebSocket protocol example</a></li>
<li><a href="#sec-4-4">4.4 SOAP easily done on WebSockets</a></li>
</ul>
</li>
<li><a href="#sec-5">5 REST and WebSockets</a>
<ul>
<li><a href="#sec-5-1">5.1 REST/WebSockets potential benefits</a></li>
<li><a href="#sec-5-2">5.2 REST/WebSocket naysayers</a></li>
<li><a href="#sec-5-3">5.3 REST/WebSocket naysayers</a></li>
<li><a href="#sec-5-4">5.4 Web Sockets break REST constraints (compared to polling)</a></li>
<li><a href="#sec-5-5">5.5 Web Sockets break REST constraints (compared to polling)</a></li>
<li><a href="#sec-5-6">5.6 REST/WebSockets representations</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Intro</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-1-1" class="outline-3">
<h3 id="sec-1-1"><span class="section-number-3">1.1</span> BOF6984 : SOAP and/or REST and/or WebSockets</h3>
<div class="outline-text-3" id="text-1-1">
<ul>
<li>Harold Carr
<ul>
<li>architect of SOAP Web Services Technology at Oracle
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-1-2" class="outline-3">
<h3 id="sec-1-2"><span class="section-number-3">1.2</span> disclaimer</h3>
<div class="outline-text-3" id="text-1-2">
<p>
The following is intended to outline our general product direction. It<br />
is intended for information purposes only, and may not be incorporated<br />
into any contract. It is not a commitment to deliver any material,<br />
code, or functionality, and should not be relied upon in making<br />
purchasing decisions. The development, release, and timing of any<br />
features or functionality described for Oracle’s products remains at<br />
the sole discretion of Oracle.
</p>
</div>
</div>
<div id="outline-container-1-3" class="outline-3">
<h3 id="sec-1-3"><span class="section-number-3">1.3</span> JavaOne / Oracle</h3>
<div class="outline-text-3" id="text-1-3">
<p>
Copyright \copyright 2012 Oracle and/or its affiliates.
</p>
</div>
</div>
<div id="outline-container-1-4" class="outline-3">
<h3 id="sec-1-4"><span class="section-number-3">1.4</span> other WebSockets presentations</h3>
<div class="outline-text-3" id="text-1-4">
<ul>
<li>BOF11880 - Server-Sent Events, Async Servlet, WebSocket, and JSON: Born to Work Together
</li>
</ul>
<ul>
<li>CON7365 - Extending Application Protocols and Java APIs over the Web with HTML5 WebSocket
</li>
</ul>
<ul>
<li>HOL4461 - Developing JAX-RS Web Applications Utilizing Server-Sent Events and WebSocket
</li>
</ul>
<ul>
<li>BOF6336 - Data Grids and WebSocket: Delivering Real-Time Push at Scale
</li>
</ul>
<ul>
<li>BOF7007 - Remoting Retrospective: DCE, COM, CORBA, RMI, RMI/IIOP, SOAP, REST, WebSockets
</li>
</ul>
</div>
</div>
<div id="outline-container-1-5" class="outline-3">
<h3 id="sec-1-5"><span class="section-number-3">1.5</span> other WebSockets presentations</h3>
<div class="outline-text-3" id="text-1-5">
<ul>
<li>CON3852 - WebSocket and Java EE: A State of the Union
</li>
</ul>
<ul>
<li>CON7001 - HTML5 WebSocket and Java
</li>
</ul>
<ul>
<li>CON8074 - HTTP, WebSocket, and SPDY: Evolution of Web Protocols
</li>
</ul>
<ul>
<li>TUT6361 - Building WebSocket Applications with GlassFish and Grizzly
</li>
</ul>
<ul>
<li>CON7042 - Building HTML5 Web Applications with Avatar
</li>
</ul>
</div>
</div>
<div id="outline-container-1-6" class="outline-3">
<h3 id="sec-1-6"><span class="section-number-3">1.6</span> other SOAP presentations</h3>
<div class="outline-text-3" id="text-1-6">
<ul>
<li>BOF4309 - What’s Hot in Metro Web Services
</li>
</ul>
<ul>
<li>BOF6984 - SOAP and/or REST and/or WebSockets
</li>
</ul>
<ul>
<li>BOF4315 - JAX-WS.Next: Progress and Feedback
</li>
</ul>
<ul>
<li>BOF6649 - What’s New in the Java Transaction API for Java EE 7 and Beyond
</li>
</ul>
<ul>
<li>BOF7007 - Remoting Retrospective: DCE, COM, CORBA, RMI, RMI/IIOP, SOAP, REST, WebSockets
</li>
</ul>
</div>
</div>
<div id="outline-container-1-7" class="outline-3">
<h3 id="sec-1-7"><span class="section-number-3">1.7</span> other REST presentations</h3>
<div class="outline-text-3" id="text-1-7">
<ul>
<li>CON7573 - How RESTful Is Your REST?
</li>
</ul>
<ul>
<li>CON3383 - Effective HATEOAS with JAX-RS
</li>
</ul>
<ul>
<li>CON4244 - JAX-RS-ME: A New JSR for RESTful Web Clients on Java ME 7
</li>
</ul>
<ul>
<li>CON6946 - Building a Web API Platform with Open Source oAuth 2.0, REST, and NoSQL
</li>
</ul>
<ul>
<li>BOF6984 - SOAP and/or REST and/or WebSockets
</li>
</ul>
<ul>
<li>CON12853 - I Got 99 Problems, but REST Ain’t One
</li>
</ul>
<ul>
<li>TUT4673 - Beautiful REST + JSON APIs with JAX-RS and Jersey
</li>
</ul>
</div>
</div>
<div id="outline-container-1-8" class="outline-3">
<h3 id="sec-1-8"><span class="section-number-3">1.8</span> other REST presentations</h3>
<div class="outline-text-3" id="text-1-8">
<ul>
<li>CON4435 - JAX-RS 2.0: New and Noteworthy in the RESTful Web Services API
</li>
</ul>
<ul>
<li>CON4804 - Designing a Heavily Loaded REST Application with Java, Take 2
</li>
</ul>
<ul>
<li>BOF7007 - Remoting Retrospective: DCE, COM, CORBA, RMI, RMI/IIOP, SOAP, REST, WebSockets
</li>
</ul>
<ul>
<li>CON3566 - JSR 353: Java API for JSON Processing
</li>
</ul>
<ul>
<li>CON7114 - Pimp My RESTful Java Applications
</li>
</ul>
</div>
</div>
<div id="outline-container-1-9" class="outline-3">
<h3 id="sec-1-9"><span class="section-number-3">1.9</span> discussion points</h3>
<div class="outline-text-3" id="text-1-9">
<ul>
<li>When to use which?
</li>
<li>Should SOAP or REST use WebSockets as a transport?
</li>
<li>Should SOAP or REST be used in a complementary way where<br />
request/response is handled with SOAP or REST while<br />
push/pubsub is provided by WebSockets?</p>
</li>
<li>Can REST and WebSockets coexists when REST is stateless (scalability<br />
via caching), whereas WebSockets are stateful (scalability via<br />
load-balancing)?</p>
</li>
<li>Can WebSockets provide the ability to do efficient binary encodings<br />
of SOAP and/or REST?
</li>
</ul>
</div>
</div>
<div id="outline-container-1-10" class="outline-3">
<h3 id="sec-1-10"><span class="section-number-3">1.10</span> discussion points</h3>
<div class="outline-text-3" id="text-1-10">
<ul>
<li>Are WebSocket apps creating siloed applications instead of REST-like<br />
addressable, resources?</p>
</li>
<li>If you do REST over WebSockets, how do you represent<br />
HTTP methods, URIs, URI parameters, headers?</p>
</li>
<li>If you did SOAP over WebSockets, would you use binary XML encoding?
</li>
<li>Perhaps SOAP and REST would not leverage full capabilities of<br />
WebSockets since you don't expect endpoints or resources to<br />
initiate conversations.
</li>
</ul>
</div>
</div>
<div id="outline-container-1-11" class="outline-3">
<h3 id="sec-1-11"><span class="section-number-3">1.11</span> discussion points</h3>
<div class="outline-text-3" id="text-1-11">
<ul>
<li>Does it make sense to talk about SOAP, REST and WebSockets when:
<ul>
<li>SOAP is
<ul>
<li>stateless (unless doing SecureConversation ReliableMessaging or AtomicTransactions)
</li>
<li>request/response or request-only
</li>
<li>async (e.g, ReplyTo=NonAnon)
</li>
</ul>
</li>
<li>REST is
<ul>
<li>stateless
</li>
<li>sync : request/response.
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-1-12" class="outline-3">
<h3 id="sec-1-12"><span class="section-number-3">1.12</span> discussion points</h3>
<div class="outline-text-3" id="text-1-12">
<ul>
<li>WebSockets is like conversation between two people.
<ul>
<li>full duplex: both sides can talk at the same time
</li>
<li>both sides have to listen at same time, while talking
</li>
</ul>
</li>
<li>Are SOAP and/or REST for
<ul>
<li>interoperable services
</li>
</ul>
</li>
<li>whereas WebSockets for
<ul>
<li>private interactions?
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> top-level use-cases</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> top-level use-cases</h3>
<div class="outline-text-3" id="text-2-1">
<p>
SOAP
</p>
<ul>
<li>enterprise
</li>
<li>service description
</li>
<li>static typing
</li>
<li>end-to-end security
</li>
<li>third-party authentication
</li>
<li>interoperability
</li>
</ul>
<p>
REST
</p>
<ul>
<li>public APIs
</li>
<li>small footprint
</li>
<li>loose-coupling
</li>
<li>interoperability
</li>
</ul>
</div>
</div>
<div id="outline-container-2-2" class="outline-3">
<h3 id="sec-2-2"><span class="section-number-3">2.2</span> top-level use-cases</h3>
<div class="outline-text-3" id="text-2-2">
<p>
WebSockets
</p>
<ul>
<li>browsers as universal clients for event oriented apps (full duplex low latency)
<ul>
<li>multiplayer games, chat, live tickers (e.g., sport/stock), social streams
</li>
</ul>
</li>
<li>service push; pub/sub
<ul>
<li>alternative to AJAX, Comet, long polling, HTML5/SSE, …
</li>
</ul>
</li>
<li>async, frame-oriented and state-oriented app protocols layered on top
<ul>
<li>e.g. AMQP, XMPP, JMS, STOMP, VNC (RFB),
</li>
</ul>
</li>
<li>private subprotocols (e.g., small, binary)
<ul>
<li>potential performance improvement
</li>
</ul>
</li>
<li>tight-coupling
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> WebSockets</h2>
<div class="outline-text-2" id="text-3">
</div>
<div id="outline-container-3-1" class="outline-3">
<h3 id="sec-3-1"><span class="section-number-3">3.1</span> Motivation: high penetration / server push</h3>
<div class="outline-text-3" id="text-3-1">
<ul>
<li>faking HTTP request to establish a (SSL/TLS) connection
<ul>
<li>then tunnel through it passing through HTTP proxies and firewalls
</li>
</ul>
</li>
<li>including ENTERPRISE proxies ones that only let port 80 and 443 open
</li>
<li>bi-directional connection enables server push
</li>
<li>WebSockets is not something "more" - it's just TCP
</li>
</ul>
</div>
</div>
<div id="outline-container-3-2" class="outline-3">
<h3 id="sec-3-2"><span class="section-number-3">3.2</span> timeline</h3>
<div class="outline-text-3" id="text-3-2">
<ul>
<li>1994 Web
<ul>
<li>HTTP: client request/service response
</li>
<li>then nothing until next click
</li>
</ul>
</li>
<li>2005 AJAX
<ul>
<li>"feel" more dynamic
</li>
<li>still all comm initiated by client
<ul>
<li>requires user interaction or periodic polling
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-3-3" class="outline-3">
<h3 id="sec-3-3"><span class="section-number-3">3.3</span> timeline</h3>
<div class="outline-text-3" id="text-3-3">
<ul>
<li>2006 Comet, long-polling, HTTP streaming ("reverse AJAX")
<ul>
<li>illusion of server initiated connection
</li>
<li>client opens connection, server keeps it open until event/response
</li>
<li>HTTP overhead still a problem
<ul>
<li>not suited for low latency apps
</li>
<li>e.g., multiplayer first person shooter games, collaboration
</li>
</ul>
</li>
</ul>
</li>
<li>2010/2012 WebSockets
<ul>
<li>persistent client/server connection
</li>
<li>both can send data at any time
</li>
<li>cross origin comm supported (you'd better trust parties)
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-3-4" class="outline-3">
<h3 id="sec-3-4"><span class="section-number-3">3.4</span> timeline details</h3>
<div class="outline-text-3" id="text-3-4">
<ul>
<li>HTTP
<ul>
<li>strict request-response model
</li>
<li>client sends request, waits until response received
</li>
</ul>
</li>
<li>AJAX/XMLHttpRequest
<ul>
<li>pulls data "requests" from server
</li>
<li>XMLHttpRequest just does HTTP request in background (no UI blockage) with callback handling response
</li>
<li>polling: apps periodically do AJAX request to ask if server has an "event"
</li>
<li>event latency depends on polling period
<ul>
<li>can increase polling rate
</li>
<li>but wastes resources and scales poorly (most polls return empty)
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-3-5" class="outline-3">
<h3 id="sec-3-5"><span class="section-number-3">3.5</span> timeline details</h3>
<div class="outline-text-3" id="text-3-5">
<ul>
<li>COMET/LONG-POLLING ("reverse AJAX")
<ul>
<li>client does request; service maintains connection
</li>
<li>fakes notifications by sending "event"/response when ready
</li>
<li>then client send request again, and wait for next event
</li>
<li>always a pending request
</li>
</ul>
</li>
<li>HTTP STREAMING
<ul>
<li>service keeps response message open
</li>
<li>response body never closed after sending event
</li>
<li>new events written to same stream
</li>
<li>response message body represents a unidirectional event stream to the client
</li>
<li>requires proxies to forward "partial" responses
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-3-6" class="outline-3">
<h3 id="sec-3-6"><span class="section-number-3">3.6</span> timeline details</h3>
<div class="outline-text-3" id="text-3-6">
<ul>
<li>HTML5 SERVER-SENT EVENTS (SSE)
<ul>
<li>standardizes COMET
</li>
<li>client API to open HTTP conn for receiving push notification
</li>
<li><code class="prettyprint">EventSource</code> represents client endpoint to receive events
</li>
<li>mime <code class="prettyprint">text/event-stream</code> for event framing format
</li>
<li><code class="prettyprint">EventSource</code> impl can do connection management to share connections
<ul>
<li>period reconnections under the covers
</li>
</ul>
</li>
<li>service should send periodic "keep-alive" comments
<ul>
<li>to avoid proxies killing the connection
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-3-7" class="outline-3">
<h3 id="sec-3-7"><span class="section-number-3">3.7</span> client SSE example</h3>
<div class="outline-text-3" id="text-3-7">
<pre class="prettyprint"><code>var source = new EventSource('Events');<br />source.onmessage = function (event) { ... }</code></pre>
</div>
</div>
<div id="outline-container-3-8" class="outline-3">
<h3 id="sec-3-8"><span class="section-number-3">3.8</span> Comparison between WebSockets and Comet</h3>
<div class="outline-text-3" id="text-3-8">
<ul>
<li>major difference is in the upstream link
</li>
<li>Comet downstream link is efficient/reliable
</li>
<li>but real streaming upstream not possible with HTTP
</li>
<li>most realtime Web app, downstream more important
</li>
<li>but collaborative apps need good upstream link
</li>
</ul>
</div>
</div>
<div id="outline-container-3-9" class="outline-3">
<h3 id="sec-3-9"><span class="section-number-3">3.9</span> WebSockets properties</h3>
<div class="outline-text-3" id="text-3-9">
<ul>
<li>server can send info to client anytime: update latency reduced
</li>
<li>server handles fewer connection requests
<ul>
<li>some requests transformed into updates to WebSockets
</li>
<li>but then connection management
</li>
</ul>
</li>
<li>client heartbeats be required so server can cleanup dead connections
</li>
<li>service heartbeat not required
<ul>
<li>service pushes shows it is alive
</li>
<li>but might need to reset connection if no updates
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-3-10" class="outline-3">
<h3 id="sec-3-10"><span class="section-number-3">3.10</span> WebSockets properties</h3>
<div class="outline-text-3" id="text-3-10">
<ul>
<li>support WebSockets but fall back to HTTP Streaming and HTTP Long Polling dynamically
</li>
<li>no connection reliability
<ul>
<li>no reconnect handling
</li>
<li>no guaranteed message delivery (like Server-Sent Event does)
</li>
<li>reliability has to be in app (same as "keep alive" message in SSE)
</li>
<li>sharing WebSocket between different pages must lock writes/reads
</li>
</ul>
</li>
<li>no same origin policy limitation
</li>
<li>enabling siloed apps
</li>
</ul>
</div>
</div>
<div id="outline-container-3-11" class="outline-3">
<h3 id="sec-3-11"><span class="section-number-3">3.11</span> client WebSockets example</h3>
<div class="outline-text-3" id="text-3-11">
<pre class="prettyprint"><code>var ws = new WebSocket('ws://localhost:8876/Channel',<br /> 'mySubprotocol.example.org');<br />ws.onmessage = function (message) {<br /> var messages = document.getElementById('messages');<br /> messages.innerHTML += "&lt;br&gt;[in] " + message.data;<br />};<br /><br />sendmsg = function() {<br /> var message = document.getElementById('send').value<br /> document.getElementById('message_to_send').value = ''<br /> ws.send(message);<br /> var messages = document.getElementById('messages');<br /> messages.innerHTML += "&lt;br&gt;[out] " + message;<br />}</code></pre>
</div>
</div>
<div id="outline-container-3-12" class="outline-3">
<h3 id="sec-3-12"><span class="section-number-3">3.12</span> WebSockets negatives</h3>
<div class="outline-text-3" id="text-3-12">
<ul>
<li>introduces new failure modes
</li>
<li>needs another protocol layered on top
</li>
<li>WISH: web socket identify protocol in use
<ul>
<li>so if intermediary understands, it can get involved
</li>
</ul>
</li>
<li>little potential for protocol evolution
<ul>
<li>the client JavaScript and server implementation have to match
</li>
<li>no means to negotiate protocol
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-3-13" class="outline-3">
<h3 id="sec-3-13"><span class="section-number-3">3.13</span> WebSockets negatives</h3>
<div class="outline-text-3" id="text-3-13">
<ul>
<li>app protocol between app and server … just like TCP sockets
</li>
<li>no TCP because
<ul>
<li>server firewall won't allow connections to ports other than 80 and 443
</li>
<li>or the client firewall
</li>
</ul>
</li>
<li>So WebSockets is generic proxy/tunnel
</li>
<li>reinventing: all we already have for TCP using WebSockets
</li>
<li>need new generation of firewalls that can inspect WebSockets traffic
</li>
<li>all this effort to avoid configuring firewalls to <b>allow</b> connections to ports other than 80 and 443?
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> SOAP and WebSockets</h2>
<div class="outline-text-2" id="text-4">
</div>
<div id="outline-container-4-1" class="outline-3">
<h3 id="sec-4-1"><span class="section-number-3">4.1</span> SOAP/WebSocket potential benefits</h3>
<div class="outline-text-3" id="text-4-1">
<ul>
<li>can tunnel out of a firewall
<ul>
<li>use instead of WS-MakeConnection
</li>
</ul>
</li>
<li>connection-based
<ul>
<li>use instead of WS-ReliableMessaging
</li>
</ul>
</li>
<li>multi-message communication
</li>
</ul>
</div>
</div>
<div id="outline-container-4-2" class="outline-3">
<h3 id="sec-4-2"><span class="section-number-3">4.2</span> MS-SWSB : SOAP Over WebSocket Protocol Binding Specification</h3>
<div class="outline-text-3" id="text-4-2">
<pre class="prettyprint"><code>&lt;wsdl:definitions ...&gt; ...<br /> &lt;wsdl:binding name="MyBinding" type="MyPortType"&gt; ...<br /> &lt;soap12:binding<br /> transport="http://schemas.microsoft.com/soap/websocket"/&gt;<br /> &lt;wsdl:operation name="MyOp"&gt; ... &lt;/wsdl:operation&gt;<br /> &lt;/wsdl:binding&gt;<br /> &lt;wsdl:service name="MyService"&gt;<br /> &lt;wsdl:port name="MyPort" binding="MyBinding"&gt;<br /> &lt;soap12:address location=" ws://myHost/myService/" /&gt;<br /> &lt;/wsdl:port&gt;<br /> &lt;/wsdl:service&gt;<br />&lt;/wsdl:definitions&gt;</code></pre>
</div>
</div>
<div id="outline-container-4-3" class="outline-3">
<h3 id="sec-4-3"><span class="section-number-3">4.3</span> SOAP/WebSocket protocol example</h3>
<div class="outline-text-3" id="text-4-3">
<pre class="prettyprint"><code>GET <a href="http://myHost/myService" title="http://myHost/myService">http://myHost/myService</a> HTTP/1.1<br />Connection: Upgrade,Keep-Alive<br />Upgrade: websocket<br />Sec-WebSocket-Key: ROOw9dYOJkStW2nx5r1k9w==<br />Sec-WebSocket-Version: 13<br />Sec-WebSocket-Protocol: soap<br />soap-content-type: application/soap+msbinsession1<br />microsoft-binary-transfer-mode: Buffered<br />Accept-Encoding: gzip, deflate</code></pre>
<hr/>
<pre class="prettyprint"><code>HTTP/1.1 101 Switching Protocols<br />Upgrade: websocket<br />Connection: Upgrade<br />Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=<br />Sec-WebSocket-Protocol: soap</code></pre>
</div>
</div>
<div id="outline-container-4-4" class="outline-3">
<h3 id="sec-4-4"><span class="section-number-3">4.4</span> SOAP easily done on WebSockets</h3>
<div class="outline-text-3" id="text-4-4">
<ul>
<li>WSDL enables
<ul>
<li>different transports
</li>
<li>different address representations
</li>
</ul>
</li>
<li>SOAP/XML messages are self-contained
<ul>
<li>for interop : avoid binary reps
</li>
</ul>
</li>
<li>main work
<ul>
<li>WebSocket connection management
</li>
<li>message dispatching (i.e., no servlet)?
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-5" class="outline-2">
<h2 id="sec-5"><span class="section-number-2">5</span> REST and WebSockets</h2>
<div class="outline-text-2" id="text-5">
</div>
<div id="outline-container-5-1" class="outline-3">
<h3 id="sec-5-1"><span class="section-number-3">5.1</span> REST/WebSockets potential benefits</h3>
<div class="outline-text-3" id="text-5-1">
<ul>
<li>multi-message communication
</li>
<li>existing apps use REST/WebSockets lib
<ul>
<li>reduced overhead of single connection without refactoring code
</li>
</ul>
</li>
<li>Transactional-REST
<ul>
<li>beginTransaction; REST/WebSocket calls, … ; endTransaction;
</li>
<li>if connection drops before commit then rollback TX
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-5-2" class="outline-3">
<h3 id="sec-5-2"><span class="section-number-3">5.2</span> REST/WebSocket naysayers</h3>
<div class="outline-text-3" id="text-5-2">
<ul>
<li>you don't expect resources to initiate conversations
<ul>
<li>counter: resource send change notification
</li>
</ul>
</li>
<li>WebSocket "resources" not addressable
<ul>
<li>since private subprotocol
</li>
</ul>
</li>
<li>Glenn Block
<ul>
<li>"Would it be viable to have a REST resources that can communicate changes (events) through web sockets?"
</li>
<li>
</li>
<li>Roy Fielding : "It would be a different style of interaction. Generally speaking,<br />
REST is designed to avoid tying a server's connection-level resources<br />
to a single client using an opaque protocol that is indistinguishable<br />
from a denial of service attack. Go figure." - July 8, 2010
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-5-3" class="outline-3">
<h3 id="sec-5-3"><span class="section-number-3">5.3</span> REST/WebSocket naysayers</h3>
<div class="outline-text-3" id="text-5-3">
<ul>
<li>WebSockets : two-way socket connection : not an app protocol
<ul>
<li>rolled back 20 years of protocol consolidation
</li>
<li>now back to a free-for-all of everybody's pet protocol
<ul>
<li>having every system roll their own protocol is retrograde
</li>
</ul>
</li>
<li>OK if client/server are tightly coupled, non-reusable UI app
</li>
<li>BAD if service is supposed to be reusable by unknown heterogeneous clients
<ul>
<li>have to negotiate media type AND application protocol too
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>
WebSocket apps are not providing addressable, reusable resources to world.
</p>
</div>
</div>
<div id="outline-container-5-4" class="outline-3">
<h3 id="sec-5-4"><span class="section-number-3">5.4</span> Web Sockets break REST constraints (compared to polling)</h3>
<div class="outline-text-3" id="text-5-4">
<ul>
<li>Stateless
<ul>
<li>connection management needed on client and service side
</li>
<li>servers use more memory
</li>
<li>single server going down has more impact
<ul>
<li>but client may be able to reestablish connection
</li>
</ul>
</li>
</ul>
</li>
<li>Cache
<ul>
<li>can't share updates between different clients
<ul>
<li>cache with standard protocols visible to intermediaries,<br />
so can participate in notification distribution networks
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-5-5" class="outline-3">
<h3 id="sec-5-5"><span class="section-number-3">5.5</span> Web Sockets break REST constraints (compared to polling)</h3>
<div class="outline-text-3" id="text-5-5">
<ul>
<li>Uniform Contract
<ul>
<li>no uniform contract
</li>
<li>intermediaries do not know what is going on, so can't help/hinder
</li>
<li>firewalls can't enforce policy decisions
</li>
</ul>
</li>
<li>Layered System
<ul>
<li>proxies/gateways cannot be transparently inserted
</li>
<li>instead direct connection to server itself
</li>
<li>potentially negative security and performance impacts
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-5-6" class="outline-3">
<h3 id="sec-5-6"><span class="section-number-3">5.6</span> REST/WebSockets representations</h3>
<div class="outline-text-3" id="text-5-6">
<pre class="prettyprint"><code>{<br /> "identity" : uuid_generated_by_the_server,<br /> "requests" : [{<br /> "uuid" : 0,<br /> "method" : "POST",<br /> "path" : "/any_url/",<br /> "headers" : [{<br /> "name" : "Content-Type",<br /> "value" : "test/plain"<br /> }],<br /> "queryStrings" : [{<br /> "name" : "foo2",<br /> "value" : "bar2"<br /> }],<br /> "messageBody" : "Swagger Socket Protocol"<br /> }]<br />}</code></pre>
</div>
</div>
</div>
</div>
<table id="attachments" class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><a href="/sites/all/modules/pubdlcnt/pubdlcnt.php?file=http://www.java.net/sites/default/files/JavaOne-BOF6984-Harold-Carr-SOAP-REST-WEBSOCKETS.pdf&nid=890998">JavaOne-BOF6984-Harold-Carr-SOAP-REST-WEBSOCKETS.pdf</a></td><td>203.49 KB</td> </tr>
</tbody>
</table>
http://www.java.net/blog/haroldcarr/archive/2012/10/02/soap-andor-rest-andor-websockets#commentsAjaxBlogsDistributedJava CommunicationsJava Web Services and XMLJavaOneMobilityWeb ApplicationsWeb Services and XMLTue, 02 Oct 2012 15:21:15 +0000haroldcarr890998 at http://www.java.netTesting Actors in Akka http://www.java.net/blog/manningpubs/archive/2012/09/28/testing-actors-akka
<div class="field field-type-filefield field-field-thumb-100x70">
<div class="field-items">
<div class="field-item odd">
<img class="imagefield imagefield-field_thumb_100x70" width="187" height="233" alt="" src="http://www.java.net/sites/default/files/manning_pubs/cover_1.jpg?1348749596" /> </div>
</div>
</div>
<p><!DOCTYPE html><br />
<html><br />
<body></p>
<h3>by Raymond Roestenburg and Rob Bakker, authors of <a href="http://deals.manningpublications.com/javanet3.html"> Akka in Action</a></h3>
<p><em><a href="http://deals.manningpublications.com/javanet3.html" style="text-decoration:none;"> Save 40% on Akka in Action and other selected books. </a></em></p>
<p><em>ScalaTest is a xUnit style testing framework. An actor is an object that can be reached through an address, processes messages from a mailbox and sends messages to other actors using the same type of addresses. An actor encapsulates state; it does not share this state with anyone. An actor has behavior, it does something specific with the messages it receives. This article, based on a portion of chapter 2 from <a href="http://www.manning.com/roestenburg" style="text-decoration:none;">Akka in Action</a>, shows how to test actors and send one-way messages. Click <a href=" http://deals.manningpublications.com/javanet.html" style="text-decoration:none;">here</a> for 40% savings on Akka in Action and other related titles.</em></p>
<p></br></p>
<p>Testing actors is more difficult than testing normal objects for a couple of reasons:</p>
<ul>
<li>Sending messages is asynchronous, so it is difficult to know when to assert expected values in the unit test.</li>
<li>Actors are meant to be run in parallel on several threads. Multi-threaded tests are more difficult than single-threaded tests and require concurrency primitives like locks, latches, and barriers to synchronize results from various actors. Exactly the kind of thing we wanted to get a bit further away from.</li>
<li>Incorrect usage of just one barrier can block a unit test which in turn halts the execution of a full test suite.</li>
<li>An actor hides its internal state and does not allow access to this state. Access should only be possible through the ActorRef. Calling a method on an actor and checking its state is prevented on purpose, which is something you would like to be able to do when unit testing.</li>
<li>If you want to do an integration test of a couple of actors, you would need to eavesdrop in between the actors to assert if the messages have the expected values. It’s not immediately clear how this can be done.</li>
</ul>
<p>Luckily, Akka provides the akka-testkit module. This module contains a number of testing tools that makes testing actors a lot easier. The testkit module makes a couple of different types of tests possible:</p>
<ul>
<li>Single-threaded unit testing—An actor instance is normally not accessible directly. The testkit provides a TestActorRef, which allows access to the underlying actor instance. This makes it possible to just test the actor instance directly by calling the methods that you have defined or even call the receive function in a single threaded environment, just as you are used to when testing normal objects.</li>
<li>Multi-threaded unit testing—The testkit module provides the TestKit and TestProbe classes, which make it possible to receive replies from actors, inspect messages, and set timing bounds for particular messages to arrive.</li>
</ul>
<p>The TestKit has methods to assert expected messages. Actors are run using a normal dispatcher in a multi-threaded environment.</p>
<p>Akka also provides tools for testing multiple JVMs, which comes in handy when you want to test remote actor systems.</p>
<p>The TestActorRef extends the LocalActorRef class and sets the dispatcher to a CallingThreadDispatcher that is built for testing only. The CallingThreadDispatcher invokes the actors on the calling thread instead of on a separate thread.</p>
<p>Depending on your preference, you might use one of the styles more often. The option that is of course closest to actually running your code in production is the multi-threaded style testing with the TestKit class. We will focus more on the multi-threaded approach to testing, since this can show problems with the code that will not be apparent in a single-threaded environment. (You probably will not be surprised that we also prefer a classical unit testing approach over a mocking approach).</p>
<p>Before we start, we will have to do a little preparation so that we don't repeat ourselves unnecessarily. Once an actor system is created, it is started and continues to run until it is stopped. Let’s build a small trait that we can use for all the tests and make sure that the system under test is automatically stopped when the unit test ends.</p>
<p><big>Listing 1 Stopping the system after all tests are done</big>
<pre class="prettyprint"><code>import org.scalatest.{ Suite, BeforeAndAfterAll }<br />import akka.testkit.TestKit<br /><br />trait StopSystemAfterAll extends BeforeAndAfterAll { #1<br /> this: TestKit with Suite => #2<br /> override protected def afterAll() {<br /> super.afterAll()<br /> system.shutdown() #3<br /> }<br />}</code></pre>
<p><small><b><br />
#1 Extends from the BeforeAndAfterAll ScalaTest trait.</br><br />
#2 Can only be used if it is mixed in with a test that uses the TestKit.</br><br />
#3 Shuts down the system after all tests have executed.</br><br />
</b></small></p>
<p>We will mixin this trait when we write our tests, so that the system is automatically shut down after all tests are executed. The TestKit exposes a value, which can be accessed in the test to create actors system and everything else you would like to do with the system.</p>
<p>We are going to use the testkit module to test some common scenarios when working with actors, both in a single-threaded and in a multi-threaded environment. There are only a few different ways for the actors to interact with each other. We will explore one-way messages in this article.</p>
<h2>One-way messages</h2>
<p>Sending one-way messages is preferred over two-way request response style messaging, which is also possible. This is because one-way messaging is more applicable in an event-driven style. It is very easy to block and wait when handling two-way messages, which is what most are used to when doing a request to a server of some kind, which is a habit that would be better to get rid of.</p>
<p>Sending with tell is done one way and in fire-and-forget style. We don't know when the message arrives at the actor or if it even arrives, so, how do we test this? What we would like to do is send a message to an actor, and, after sending the message, check that the actor has done the work it should have done. An actor that responds to messages should do something with the message and take some kind of action, like send a message to another actor, or store some internal state, or interact with another object, or with I/O for instance in some kind of way. If the actor’s behavior is completely invisible from the outside, we can only check if it handled the message without any errors, and we could try to look into the state of the actor with the TestActorRef. There are a couple of variations that we will look at:</p>
<ol>
<li>An actor's behavior is not directly observable from the outside; it might be an intermediate step that the actor takes to create some internal state. We want to test that the actor at least handled the message and did not throw any exception. We want to be sure that the actor has finished. We want to test the internal state change. We will call this type of actor a SilentActor.</li>
<li>An actor sends a message to another actor (or possibly many actors) after it is done processing the received message. We will treat the actor as a black box and inspect the message that is sent out in response to the message it received. We will call this type of actor a SendingActor.</li>
<li>An actor receives a message and interacts with a normal object in some kind of way. After we send a message to the actor, we would like to assert if the object was effected. We will call this type of actor a SideEffectingActor.</li>
</ol>
<p>We will write a test for each type of actor in the above list. Let's start with the SilentActor. Since it's our first test, let's go briefly through the use of ScalaTest:</p>
<p><big>Listing 2 First test for the silent actor type</big>
<pre class="prettyprint"><code>class SilentActor01Test extends TestKit(ActorSystem(“testsystem”)) // #1<br /> with WordSpec // #2<br /> with MustMatchers // #3<br /> with StopSystemAfterAll { // #4<br /><br /> “A Silent Actor” must { //<br /> “change state when it receives a message, single threaded” in { // #5<br /> //Write the test, first fail<br /> fail(“not implemented yet”)<br /> }<br /> “change state when it receives a message, multi-threaded” in {<br /> //Write the test, first fail<br /> fail(“not implemented yet”)<br /> }<br /> }<br />}</code></pre>
<p><small><b><br />
#1 Extends from TestKit and provide an actor system for testing.</br><br />
#2 WordSpec provides an easy to read DSL for testing.</br><br />
#3 MustMatchers provides easy to read assertions.</br><br />
#4 Make sure the system is stopped.</br><br />
#5 MustMatchers provides easy to read assertions.</br><br />
</b></small></p>
<p>The above code is the basic skeleton that we need to start running a test for the silent actor. We're using the WordSpec style of testing since it makes it possible to write the test as a number of textual specifications, which will also be shown when the test is run. In the above code, we have created a specification for the silent actor type with a test that should pass as it says “change internal state when it receives a message.” Right now, it always fails since it is not implemented yet, as expected in Red-Green-Refactor style, where you first make sure the test fails (Red), then implement the code to make it pass (Green), after which you might refactor the code to make it nicer. First, we will test the silent actor in a single-threaded environment. We've included the TestKit already since we are also going to test if everything works well in a multi-threaded environment a bit later, which is not necessary if you only use the TestActorRef. Below, we have defined an Actor that does nothing, and will always fail the tests:</p>
<p><big>Listing 3 First failing implementation of the silent actor type</big>
<pre class="prettyprint"><code>class SilentActor extends Actor {<br /> def receive = {<br /> case msg () <br /> }<br />}</code></pre>
<p><small><b><br />
#1 Swallows any message; does not keep any internal state.</br><br />
</b></small></p>
<p>Now let’s first write the test to send the silent actor a message and check that it changes its internal state. The SilentActor02 actor will have to be written for this test to pass, as well as an object called SilentActor02Protocol. This object contains all the messages that SilentActor02 supports, which is a nice way of grouping messages that are related to each other.</p>
<p><big>Listing 4 Single-threaded test internal state</big>
<pre class="prettyprint"><code>“change internal state when it receives a message, single” in {<br /> import SilentActor02Protocol._ // #1<br /> val silentActor = TestActorRef[SilentActor02] // #2<br /> silentActor ! SilentMessage(“whisper”)<br /> silentActor.underlyingActor.state must (contain(“whisper”)) // #3<br />}</code></pre>
<p><small><b><br />
#1 Import the messages.</br><br />
#2 Gets a TestActorRef for single-threaded test.</br><br />
#3 Getting the underlying actor and assert the state.</br><br />
</b></small></p>
<p>We first create a TestActorRef for the actor, which gives us a single-threaded environment to run the actor in. We then send a SilentMessage message to the actor. The SilentActor02 actor is expected to have an internal state which can be accessed by a state method. The underlyingActor method gives access to the underlying actor instance on which we can call the state method. Finally, we assert with a must matcher that the state contains the data that we sent it. Now let’s write the SilentActor02 actor:</p>
<p><big>Listing 5 SilentActor02 implementation</big>
<pre class="prettyprint"><code>object SilentActor02Protocol { #1<br /> case class SilentMessage(data:String) #2<br />}<br /><br />class SilentActor02 extends Actor {<br /> import SilentActor02Protocol._<br /> var internalState = Vector[String]()<br /><br /> def receive = {<br /> case SilentMessage(data) =><br /> internalState = internalState :+ data #3<br /> }<br /><br /> def state = internalState<br />}</code></pre>
<p><small><b><br />
#1 A protocol that keeps related messages together.</br><br />
#2 The message type that the SilentActor02 can process.</br><br />
#3 The state is kept in a Vector; every message is added to this Vector.</br><br />
</b></small></p>
<p>The actor above keeps state in a Vector, which is an immutable list that has quite good performance for general use. The internalState var is changed when a SilentMessage is received. We extract the data field and create a new Vector that has the data field appended to it. In general, it is good practice to prefer vars in combination with immutable data structures instead of vals in combination with mutable data structures. The state method returns the internalState Vector, which is purely used for testing. Since it is immutable, the test can't accidentally change the list and cause problems when asserting the expected result. It's completely safe to set/update the internalState var, since the Actor is protected from multi-threaded access.</p>
<p>Now let’s look at the multi-threaded version of this test. As you will see, we will have to change the code for the actor a bit as well. Just like in the single-threaded version where we added a state method to make it possible to test the actor, we will have to add some code to make the multi-threaded version testable.</p>
<p><big>Listing 6 Multi-threaded test of internal state</big>
<pre class="prettyprint"><code>“change internal state when it receives a message, multi” in {<br /> import SilentActor03Protocol._ // #1<br /> val silentActor = system.actorOf(Props[SilentActor03],”s3”) // #2<br /> silentActor ! SilentMessage(“whisper1”)<br /> silentActor ! SilentMessage(“whisper2”)<br /> silentActor ! GetState(testActor) // #3<br /> expectMsg(Vector(“whisper1”, “whisper2”)) // #4<br />}</code></pre>
<p><small><b><br />
#1 A protocol that keeps related messages together.</br><br />
#2 The test system is used to create an actor.</br><br />
#3 A message is added to the protocol to get the state.</br><br />
#4 Used to check which message has been sent to the testActor.</br><br />
</b></small></p>
<p>The multi-threaded test uses the “testsystem” ActorSystem, part of the TestKit, to create a SilentActor03 actor. Since we now cannot get to the actor instance, we'll have to think of something else. For this, a GetState message, which takes an ActorRef, is added. The TestKit has a testActor, which you can use to receive messages that you would like to expect. The SilentActor03 actor will have to send its internal state to the ActorRef that is passed inside the GetState expectMsg. That way, we can call the method, which expects one message to be sent to the testActor and asserts the message; in this case, that it is a Vector with all the data fields in it.</p>
<p><b>Timeout settings for the expectMsg* methods</b></p>
<p><em>Timeout settings for the expectMsg* methods<br />
The TestKit has several versions of the expectMsg and other methods for asserting messages. All of these methods expect a message within a certain amount of time; otherwise, they timeout and throw an exception. The timeout has a default value that can be set in the configuration using the “akka.test.single-expect-default” key.<br />
A dilation factor is used to calculate the actual time that should be used for the timeout (it is normally set to 1, which means the timeout is not dilated). The dilation factor is used since not every machine is the same, and you would like the tests to run correctly both on fast workstations as well on possibly slower continuous integration servers.<br />
Based on where the tests are run, the “akka.test.timefactor” dilation factor in the configuration could be changed accordingly. The max timeout can also be set on the method directly, but it is better to just use the configured values, and change the values across tests in the configuration if necessary.</em></p>
<p>Let’s write the code for the silent actor that can also process GetState messages:</p>
<p><big>Listing 7 SilentActor03 implementation</big>
<pre class="prettyprint"><code>object SilentActor03Protocol {<br /> case class SilentMessage(data:String)<br /> case class GetState(receiver:ActorRef) #1<br />}<br /><br />class SilentActor03 extends Actor {<br /> import SilentActor03Protocol._<br /> var internalState = Vector[String]()<br /><br /> def receive = {<br /> case SilentMessage(data) =><br /> internalState = internalState :+ data<br /> case GetState(receiver) => receiver ! internalState #2<br /> }<br />}</code></pre>
<p><small><b><br />
#1 The GetState message is added for testing purposes.</br><br />
#2 The internal state is sent to the ActorRef in the GetState message.</br><br />
</b></small></p>
<p>The internal state is sent back to the ActorRef in the GetState message, which in this case will be the testActor. Since the internal state is an immutable Vector, this is completely safe.</p>
<p>Let’s look at the next type of one-way actor type that you will probably use quite often, the SendingActor. A SendingActor receives a message, processes it and sends off a message to another actor for further processing. In this case, we will use a simplified scenario from the kiosk example of a Game that holds a number of Tickets, where every kiosk takes of a number of tickets and passes the game unto the next kiosk. We will write a test where we expect a Kiosk01 actor to receive a game message, to take one ticket off the game and pass the game with one less ticket to the next kiosk. This is what the test looks like:</p>
<p><big>Listing 8 Kiosk01 test</big>
<pre class="prettyprint"><code>“A Sending Actor” must {<br /> “send a message to an actor when it has finished” in {<br /> import Kiosk01Protocol._<br /> val props = Props(new Kiosk01(testActor)) // #1<br /> val sendingActor = system.actorOf(props, “kiosk1”)<br /> val tickets = Vector(Ticket(1), Ticket(2), Ticket(3))<br /> val game = Game(“Lakers vs Bulls”,tickets) // #2<br /> sendingActor ! game<br /> expectMsgPF() {<br /> case Game(_,tickets) => // #3<br /> tickets.size must be (game.tickets.size - 1) // #4<br /> }<br /> }<br />}</code></pre>
<p><small><b><br />
#1 The next Kiosk is passed to the constructor, in the test we pass in a testActor.</br><br />
#2 A game message is created with three tickets.</br><br />
#3 The testActor should receive a Game.</br><br />
#4 The testActor should receive one ticket less.</br><br />
</b></small></p>
<p>A game is sent to the Kiosk01 Actor, which should process the Game and take off one Ticket and send it off to the next Kiosk. In the test, we pass in the testActor instead of another Kiosk, which is easily done, since the nextKiosk is just an ActorRef. Since we cannot exactly know which ticket was taken off, we can't use a expectMsg(msg) since we can't formulate an exact match for it. In this case, we use expectMsgPF which takes a partial function just like the receive of the actor. Here, we match the message that was sent to the testActor, which should be a Game with one less ticket. Now, let’s write the Kiosk1 actor and the message protocol:</p>
<p><big>Listing 9 Kiosk01 implementation</big>
<pre class="prettyprint"><code>object Kiosk01Protocol {<br /> case class Ticket(seat:Int) //<br /> case class Game(name:String, tickets:Seq[Ticket]) //<br />}<br /><br />class Kiosk01(nextKiosk:ActorRef) extends Actor {<br /> import Kiosk01Protocol._<br /> def receive = {<br /> case game @ Game(_, tickets) =><br /> nextKiosk ! game.copy(tickets = tickets.tail) //<br /> }<br />}</code></pre>
<p><small><b><br />
#1 The simplified Ticket message.</br><br />
#2 The Game contains tickets.</br><br />
#3 An immutable copy is made of the Game message with one less ticket.</br><br />
</b></small></p>
<p>We once again create a protocol that keeps all related messages together. The actor matches the message and extracts the Kiosk1 Game tickets out of it (it's not interested in the first field which is the name of the game), and assigns an alias to the message named game. Next it creates an immutable copy using the copy method that every case class has. The copy will only contain the tail of the list of tickets, which is for an empty list if where no tickets are left, or everything except for the first ticket in the list. Once again, we take advantage of the immutable property of case classes. The game is sent along to the nextKiosk.</p>
<p>Let’s look at some variations of the SendingActor type. Here are some common variations on the theme:</p>
<ul>
<li>The actor creates a mutated copy and sends the copy to the next actor, which is the case that we have seen just now. We will call this a MutatingCopyActor.</li>
<li>The actor forwards the message it receives; it does not change it at all.</li>
<li>We will call this a ForwardingActor.</li>
<li>The actor sends only certain messages through that it receives. We will call this a FilteringActor.</li>
<li>The actor creates a different type of message from the message that it receives. We will call this a TransformingActor.</li>
<li>The actor creates many messages based on one message it receives and sends the new messages one after the other to another actor. We will call this a SequencingActor.</li>
</ul>
<p>The MutatingCopyActor, ForwardingActor, and TransformingActor can all be tested in the same way. We can pass in a testActor as the next actor to receive messages and use the expectMsg or expectMsgPF to inspect the messages.</p>
<p>The FilteringActor is a bit different. How can we assert that some messages where not passed through? The SequencingActor needs a similar approach. How can we assert that we receive the right amount of messages? The next test will show you how. Let’s write a test for the FilteringActor. The FilteringActor we are going to build should filter out duplicate events. It will keep a list of the last messages that it has received and check this list if the incoming message is a duplicate.</p>
<p><big>Listing 10 FilteringActor test</big>
<pre class="prettyprint"><code>“filter out particular messages” in {<br /> import FilteringActorProtocol._<br /> val props = Props(new FilteringActor(testActor,5))<br /> val filter = system.actorOf(props, “filter-1”)<br /> filter ! Event(1) // #1<br /> filter ! Event(2)<br /> filter ! Event(1)<br /> filter ! Event(3)<br /> filter ! Event(1)<br /> filter ! Event(4)<br /> filter ! Event(5)<br /> filter ! Event(5)<br /> filter ! Event(6)<br /> val eventIds = receiveWhile() { // #2<br /> case Event(id) if id <= 5 => id<br /> }<br /> eventIds must be (List(1,2,3,4,5)) // #3<br /> expectMsg(Event(6))<br />}</code></pre>
<p><small><b><br />
#1 Sends a couple of events, including duplicates.</br><br />
#2 Receives messages until the case statement does not match that any more.</br><br />
#3 Asserts the duplicates are not in the result.</br><br />
</b></small></p>
<p>The test uses a receiveWhile method to collect the messages that the testActor receives until the case statement matches. In the test the Event(6) does not match the pattern in the case statement, which defines that all Events with an id smaller or equal than 5 are going to be matched. The receiveWhile method returns the collected items as they are returned in the partial function as a list, which is not allowed to have any duplicates. Now, let's write the FilteringActor that will fit this specification:</p>
<p><big>Listing 11 FilteringActor implementation</big>
<pre class="prettyprint"><code>object FilteringActorProtocol {<br /> case class Event(id:Long)<br />}<br /><br />class FilteringActor(nextActor:ActorRef,<br /> bufferSize:Int) extends Actor { // #1<br /> import FilteringActorProtocol._<br /> var lastMessages = Vector[Event]() // #2<br /> def receive = {<br /> case msg:Event =><br /> if (!lastMessages.contains(msg)) {<br /> lastMessages = lastMessages :+ msg<br /> nextActor ! msg // #3<br /> if(lastMessages.size > bufferSize) {<br /> // discard the oldest<br /> lastMessages = lastMessages.tail // #4<br /> }<br /> }<br /> }<br />}</code></pre>
<p><small><b><br />
#1 A max size for the buffer is passed into the constructor.</br><br />
#2 A vector of last messages is kept.</br><br />
#3 The event is sent to the next actor if it is not found in the buffer.</br><br />
#4 The oldest event in the buffer is discarded when the max buffersize is reached.</br><br />
</b></small></p>
<p>The above keeps a buffer of the last FilteringActor messages that it received in a Vector and adds every received message to it if it does not already exist in the list. Only if the message has not been recently received will it send the message to the nextActor. The oldest message that was received is discarded when a max bufferSize is reached to prevent that the lastMessages list grow too large and possibly run out of space.</p>
<p>The receiveWhile method can also be used for testing a SequencingActor, where you could assert if the sequence of messages that is caused by a particular event is as expected. Two methods for asserting messages that might come in handy when you need to assert a number of messages are ignoreMsg and expectNoMsg. ignoreMsg takes a partial function just like the expectMsgPF method, only instead of asserting the message it ignores any message that matches the pattern. This can come in handy if you are not interested in many messages, but only want to assert that particular messages have been sent to the testActor. The expectNoMsg asserts that no message has been sent to the testActor for a certain amount of time, which we could have also use in between the sending of duplicate messages in the FilteringActor test. The following test shows an example of using expectNoMsg.</p>
<p><big>Listing 12 FilteringActor implementation</big>
<pre class="prettyprint"><code>“filter out particular messages using expectNoMsg” in {<br /> import FilteringActorProtocol._<br /> val props = Props(new FilteringActor(testActor,5))<br /> val filter = system.actorOf(props, “filter-2”)<br /> filter ! Event(1)<br /> filter ! Event(2)<br /> expectMsg(Event(1))<br /> expectMsg(Event(2))<br /> filter ! Event(1)<br /> expectNoMsg<br /> filter ! Event(3)<br /> expectMsg(Event(3))<br /> filter ! Event(1)<br /> expectNoMsg<br /> filter ! Event(4)<br /> filter ! Event(5)<br /> filter ! Event(5)<br /> expectMsg(Event(4))<br /> expectMsg(Event(5))<br /> expectNoMsg()<br />}</code></pre>
<p>Since the expectNoMsg has to wait for a timeout to be sure that no message was received, the above test will run a lot slower. As we've seen, the TestKit provides a testActor that can receive messages, which we can assert with expectMsg and other methods. A TestKit has only one testActor and since the TestKit is a class that you need to extend, how would you test an actor that sends messages to more than one actor? The answer is the TestProbe class. The TestProbe class is very much like the TestKit, only you can use this class without having to extend from it. Simply create a TestProbe with TestProbe() and start using it.</p>
<p>So far, we have tested two types of one-way actors, the SilentActor and the SendingActor types. It's time to get the last one down, the SideEffectingActor. We will use the Greeter Actor from a HelloWorld example shown bellow.</p>
<p><big>Listing 13 Hello World</big>
<pre class="prettyprint"><code>import akka.actor.{ ActorLogging, Actor, Props, ActorSystem }<br /><br />object HelloWorld extends App { // #1<br /> val system = ActorSystem("hello_world") // #2<br /> val greeter = system.actorOf(Props[Greeter],"greeter")<br /> greeter ! Greeting("World") //<br />}<br /><br />case class Greeting(who: String) // #3<br /><br />class Greeter extends Actor with ActorLogging { //<br /> def receive = {<br /> case Greeting(who) => log.info("Hello " + who + "!") // #4<br /> }<br />}</code></pre>
<p><small><b><br />
#1 Just a simple Scala app.</br><br />
#2 Creates a "hello_world" system.</br><br />
#3 Sends a greeting to the world!</br><br />
#4 The Greeting message case class</br><br />
#5 Extends the Actor, and uses an ActorLogging trait to say hello.</br><br />
#6 The Greeting message case class.</br><br />
</b></small></p>
<p>The Greeter is a special case of a SideEffectingActor, the only thing you can see happening is that it writes to the console. Sometimes this is the case; all you can see is that an actor logs some events, and getting to the internals might be very difficult for all kinds of reasons.</p>
<p><big>Listing 14 Testing HelloWorld</big>
<pre class="prettyprint"><code>import Greeter01Test._<br /> class Greeter01Test extends TestKit(testSystem) //<br /> with WordSpec<br /> with MustMatchers<br /> with StopSystemAfterAll {<br /><br /> “The Greeter” must {<br /> “say Hello World! when a Greeting(“World”) is sent to it” in {<br /> val dispatcherId = CallingThreadDispatcher.Id<br /> val props = Props[Greeter].withDispatcher(dispatcherId) // #1<br /> val greeter = system.actorOf(props)<br /> EventFilter.info(message = “Hello World!”,<br /> occurrences = 1).intercept { // #2<br /> greeter ! Greeting(“World”)<br /> }<br /> }<br /> }<br />}<br /><br />object Greeter01Test {<br /> val testSystem = { // #3<br /> val config = ConfigFactory.parseString(<br /> “““akka.event-handlers = [“akka.testkit.TestEventListener”]”““<br /> )<br /> ActorSystem(“testsystem”, config)<br /> }<br />}</code></pre>
<p><small><b><br />
#1 Uses the testSystem from the Greeter01Test object.</br><br />
#2 Single threaded environment Intercept the log messages that were logged.</br><br />
#3 Creates a system with a configuration that attaches a test event listener.</br><br />
</b></small></p>
<p>The Greeter is tested by inspecting the log messages that it writes using the ActorLogging trait. The testkit module provides a TestEventListener that you can configure to handle all events that are logged. In the above code, we create an ActorSystem with a configuration in the Greeter01Test. The ConfigFactory can parse a configuration file from a String; in this case, we only override the event handlers list.</p>
<p>The test is run in a single threaded environment because we want to check that the log event has been recorded by the TestEventListener when the greeter is sent the “World” Greeting. We use an EventFilter object, which can be used to filter log messages. In this case, we filter out the expected message, which should only occur once. The filter is applied when the intercept code block is executed, which is when we send the message.</p>
<p>The above example of testing a SideEffectingActor shows that asserting some interactions can get complex quite quickly. In a lot of situations it is easier to adapt the code a little bit so that it is easier to test. The below example shows an adapted Greeter Actor, which can be configured to send a message to a listener actor whenever a greeting is logged:</p>
<p><big>Listing 15 Simplifying testing of the Greeting Actor with a listener</big>
<pre class="prettyprint"><code>class Greeter02(listener:Option[ActorRef] = None) // #1<br /> extends Actor with ActorLogging {<br /> def receive = {<br /> case Greeting(who) =><br /> val message = "Hello " + who + "!"<br /> log.info(message)<br /> listener.foreach(_ ! message) // #2<br /> }<br />}</code></pre>
<p><small><b><br />
#1 The constructor takes a optional listener, default set to None.</br><br />
#2 Optionally sending to the listener.</br><br />
</b></small></p>
<p>The actor is adapted so Greeter02 that it takes an Option[ActorRef], which is default set to None. After it successfully logs a message, it sends a message to the listener if the Option is not empty. When the actor is used normally without specifying a listener it runs as usual. Below is the updated test for this Greeter02 actor.</p>
<p><big>Listing 16 Simpler Greeting Actor test</big>
<pre class="prettyprint"><code>class Greeter02Test extends TestKit(ActorSystem(“testsystem”))<br />with WordSpec<br />with MustMatchers<br />with StopSystemAfterAll {<br /><br /> “The Greeter” must {<br /> “say Hello World! when a Greeting(“World”) is sent to it” in {<br /> val props = Props(new Greeter02(Some(testActor))) // #1<br /> val greeter = system.actorOf(props)<br /> greeter ! Greeting(“World”)<br /> expectMsg(“Hello World!”) // #2<br /> }<br /> }<br />}</code></pre>
<p><small><b><br />
#1 Sets the listener to the testActor.</br><br />
#2 Asserts the message as usual.</br><br />
</b></small></p>
<p>As you can see, the test has been greatly simplified. We simply pass in a Some(testActor) into the Greeter02 constructor and assert the message that is sent to the testActor as usual.</p>
<h2>Summary</h2>
<p>We learned how to send messages to actors and how to receive and process messages. The tell method is used to send a message to an actor, while the receive partial function is used to handle messages in a pattern-matching style. We took a test driven approach to building a couple common types of actors using ScalaTest and the TestKit module. We found out how SilentActor, SendingActor, and SideEffectingActor types of Actors can be tested, both in a single-threaded as well as in a multi-threaded environment.</p>
<p></br></p>
<p><b>Here are some other Manning titles you might be interested in:</b></p>
<table>
<tr>
<td><img src="http://weblogs.java.net/sites/default/files/image001_0.jpg" alt="Scala in Depth" width="36" height="45" /></td>
<td>
<p><a href="http://www.manning.com/suereth" style="text-decoration:none;">Scala in Depth</a></br>Joshua D. Suereth
</td>
</tr>
<tr>
<td><img src="http://weblogs.java.net/sites/default/files/image002.jpg" alt="Scala in Action" width="36" height="45" /></td>
<td>
<p><a href="http://www.manning.com/raychaudhuri" style="text-decoration:none;">Scala in Action</a></br>Nilanjan Raychaudhuri</p>
</td>
</tr>
<tr>
<td><img src="http://weblogs.java.net/sites/default/files/image003.jpg" alt="Play for Scala" width="36" height="45" /></td>
<td>
<p><a href="http://www.manning.com/hilton" style="text-decoration:none;">Play for Scala</a></br>Peter Hilton, Erik Bakker, and Francisco Canedo</p>
</td>
</tr>
</table>
<p></body><br />
</html></p>
<table id="attachments" class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><a href="http://www.java.net/sites/default/files/cover_0.jpg">cover.jpg</a></td><td>7.83 KB</td> </tr>
<tr class="even"><td><a href="http://www.java.net/sites/default/files/image001_0.jpg">image001.jpg</a></td><td>1.42 KB</td> </tr>
<tr class="odd"><td><a href="http://www.java.net/sites/default/files/image002.jpg">image002.jpg</a></td><td>1.55 KB</td> </tr>
<tr class="even"><td><a href="http://www.java.net/sites/default/files/image003.jpg">image003.jpg</a></td><td>1.55 KB</td> </tr>
<tr class="odd"><td><a href="http://www.java.net/sites/default/files/AkkainActionCH02.txt">AkkainActionCH02.txt</a></td><td>34.35 KB</td> </tr>
</tbody>
</table>
http://www.java.net/blog/manningpubs/archive/2012/09/28/testing-actors-akka#commentsBloggingBlogsDatabasesJava CommunicationsJava DesktopJava EnterpriseJava PatternsJava ToolsJava User GroupsJava Web Services and XMLMobilityFri, 28 Sep 2012 16:11:02 +0000manning_pubs890743 at http://www.java.nettechnology IThttp://www.java.net/article/2012/09/28/technology-it
<!--
<div class="field field-type-text field-field-java-version">
<h2 class="field-label"><span class="spacing">Java Product</h2>
<div class="field-items">
<div class="field-item"></div>
</div>
</div>
-->
<!--
-->
<div class="field field-type-text field-field-short-description">
<h2 class="field-label" class="spacing">Summary</h2>
<div class="field-items">
<div class="field-item"></div>
</div>
</div>
<div class="field field-type-text field-field-short-description">
<!--<h2 class="field-label" class="spacing">Article</h2>-->
<div class="field-items">
<div class="field-item"><p></p></div>
</div>
</div>
<!--
<div class="field field-type-text field-field-article-license-agreement">
<h2 class="field-label">Licensing Agreement</h2>
<div class="field-items">
<div class="field-item"></div>
</div>
</div>
-->
http://www.java.net/article/2012/09/28/technology-it#commentsAccessibilityAjaxBloggingCommunityEducationExtreme ProgrammingGamesJ2MEMobilityPortingProgrammingRSS FeedsSearchSecurityToolsWeb ApplicationsWeb Services and XMLFri, 28 Sep 2012 09:45:05 +0000okky9okilz890785 at http://www.java.netStrata Conference 2012 Santa Clara - my noteshttp://www.java.net/blog/haroldcarr/archive/2012/02/28/strata-conference-2012-santa-clara-my-notes
<!-- | 0 --><p>I'm at Strata Santa Clara again this year. &nbsp;I'll post my raw notes. &nbsp;Hope you find them helpful.</p>
http://www.java.net/blog/haroldcarr/archive/2012/02/28/strata-conference-2012-santa-clara-my-notes#commentsDatabasesEmbeddedMobilityOpen SourceProgrammingResearchSearchWed, 29 Feb 2012 04:07:13 +0000haroldcarr883869 at http://www.java.netAliber Project in Java.net, Award in Indonesia ICT Award. miss APICTA Competitionhttp://www.java.net/blog/fthamura/archive/2011/12/04/aliber-project-javanet-award-indonesia-ict-award-miss-apicta-competition-1
<!-- 2501 | 0 --><img src="/images/people/frans_thamura.jpg" border="0", align="left" /><p>This year is a good year for Meruvian, after 6 years work, now the student can achieve as winner in national competition, but we still have problem send them to APICTA for Asia &nbsp;Pasific ICT competition, because dunno why. Merit Award could be sent to Asia Pasific. but cant... I wish APICTA global organizer read my blog.</p>
<p>Edy is a 15 years, when in competition happen, he was still 2 year in vocational highschool (secondary school).</p>
<p>He create an amazing project using REST, Struts2, Hibernate and also create AJAX like using JQuery, with Android edition also for submit leave. The project called Aliber, the good news, it hosted in Java.net since the first commit (joining a migration project for all Meruvian projects to Java.net). <a href="http://www.java.net/blog/fthamura/archive/2011/07/04/repositioning-javanet-dev-ecosystem-meruvianindonesia">Read my last blog here</a></p>
<p>Aliber is a leave management solution, which come when student always extend the leave without explanation. Which that is not good.</p>
<p>If u see his parent revenue, which i believe less than US$ 10 for working a day..he is amazing son, isnt it. &nbsp;Yes, my job to make he become the one, and can pass the jTechnopreneur program, create his company (start from his Aliber), and become global player one day.</p>
<p>I blog this, may be this experience can inspire all of you in another country, and may be we can working together. or may be Oracle start from JAva.net can work together also, because we can create hundreds people like Edy globally. and Edy can inspire people anywhere..</p>
<p>This education project start from JENI (Java Education NEtwork Indonesia) <a href="http://www.jeni.or.id" title="http://www.jeni.or.id">http://www.jeni.or.id</a>, and we extend to <a href="http://www.jtechnopreneur.com" title="www.jtechnopreneur.com">www.jtechnopreneur.com</a> (add Android, REST).</p>
<p>for more information of this activities can visit <a href="http://www.facebook.com/meruvian" title="http://www.facebook.com/meruvian">http://www.facebook.com/meruvian</a>.</p>
<p>&nbsp;</p>
<p>Dont forget to checkout Edy's work in Aliber.java.net and we love to give the project feedback.</p>
<p>&nbsp;</p>
<p>I hear that Aliber 2.0 will adopt Activiti, to replace leave approvral process (which right now based on manual/database) rather advanced workflow (dynamic workflow).</p>
<p>&nbsp;</p>
<p>Aliber is OpenSource project, with Apache License..&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><img alt="" src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/300997_298756620140735_100000191977830_1441246_890424179_n.jpg" /></p>
<p>&nbsp;</p>
<p>&nbsp;<img alt="" src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/s720x720/309729_1796048281307_1842720076_1181238_1176707660_n.jpg" /></p>
<p><img alt="" src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/302484_10150484903641040_53258881039_11403543_1821833870_n.jpg" /></p>
<p><a href="http://weblogs.java.net/blog/fthamura/archive/2011/07/04/repositioning-javanet-dev-ecosystem-meruvianindonesia"><img alt="" src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/381706_10150601246061040_53258881039_11952434_189440996_n.jpg" /><br type="_moz" /><br />
</a></p>
<p>If you want to know more about Aliber, Edy has created a complete manual, take a look this.</p>
<p>&nbsp;</p>
<div style="width:477px" id="__ss_8442040"><strong style="display:block;margin:12px 0 4px"><a title="Aliber &amp; Aliber Lite" target="_blank" href="http://www.slideshare.net/ydesetiawan/aliber-aliber-lite-8442040">Aliber &amp; Aliber Lite</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8442040" width="477" height="510" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<div style="padding:5px 0 12px">View more <a target="_blank" href="http://www.slideshare.net/">documents</a> from <a target="_blank" href="http://www.slideshare.net/ydesetiawan">ydesetiawan</a></div>
</div>
<p>and Aliber's presentation also.</p>
<div style="width:425px" id="__ss_9487825"><strong style="display:block;margin:12px 0 4px"><a title="Slide - Aliber &amp; Aliber Lite V.1.0" target="_blank" href="http://www.slideshare.net/ydesetiawan/slide-aliber-aliber-lite-v10">Slide - Aliber &amp; Aliber Lite V.1.0</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9487825" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<div style="padding:5px 0 12px">View more <a target="_blank" href="http://www.slideshare.net/">presentations</a> from <a target="_blank" href="http://www.slideshare.net/ydesetiawan">ydesetiawan</a></div>
</div>
<p>Edy also part of development Syariah application, take a look.</p>
<div style="width:425px" id="__ss_8041162"><strong style="display:block;margin:12px 0 4px"><a title="Funding syariah (prototype)" target="_blank" href="http://www.slideshare.net/ydesetiawan/funding-syariah-prototype">Funding syariah (prototype)</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8041162" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<div style="padding:5px 0 12px">View more <a target="_blank" href="http://www.slideshare.net/">presentations</a> from <a target="_blank" href="http://www.slideshare.net/ydesetiawan">ydesetiawan</a></div>
</div>
http://www.java.net/blog/fthamura/archive/2011/12/04/aliber-project-javanet-award-indonesia-ict-award-miss-apicta-competition-1#commentsBlogsCommunityEducationEmbeddedJ2EEJava EnterpriseJava User GroupsMobilityStrutsWeb DesignWeb Services and XMLSun, 04 Dec 2011 17:14:51 +0000fthamura870823 at http://www.java.netRosjava – Java for Robotics?http://www.java.net/blog/semesa2/archive/2011/09/24/rosjava-%E2%80%93-java-robotics
<div class="field field-type-filefield field-field-thumb-100x70">
<div class="field-items">
<div class="field-item odd">
<img class="imagefield imagefield-field_thumb_100x70" width="250" height="333" alt="" src="http://www.java.net/sites/default/files/semesa2/robot250x333.jpg?1316892090" /> </div>
</div>
</div>
<p>&nbsp;In May Google and Willow Garage announced the first pure-Java implementation of ROS - Willow Garage's Robotic Operating System.&nbsp;Called &ldquo;<a href="http://answers.ros.org/question/918/understanding-rosjava-as-recently-announced-by">rosjava</a>&rdquo;,&nbsp;<span>the</span>&nbsp;new library is still at alpha level, but it is clear from their <a href="http://www.ros.org/browse/details.php?name=rosjava">forge</a>&nbsp;that active development continues.</p>
<p><img alt="Willow Garage's PR2 Robot" width="250" height="333" vspace="5" hspace="12" align="right" src="http://weblogs.java.net/sites/default/files/robot250x333_0.jpg" />Android is is well suited for robotic applications with its support of audio, accelerometers, GPS, cameras and wireless.&nbsp;The human factors of smartphones and tablets make them great devices for people monitoring and controlling robots. Audio, text-to-speech, speech recognition and touch displays all promote useability in a familiar context.</p>
<p>In a compelling demo at Google I/O, Ken Conley walked through constructing an application that let him hold up a tablet, turn his head and have the robot follow suit. He could see what the robot saw. In effect he had added a telepresence capability equivalent to a head mounted display. The tablet sent messages to the robot's existing ROS-hosted application seamlessly extending new capabilities over wifi.</p>
<p>ROS itself is intended to be as language independent as possible, supporting C++ and Python in addition to Java. The idea is to specialize functionality in &ldquo;nodes&rdquo; such that each node does one thing really well. Nodes are then able to message other components using a ROS-based application to create the needed coordination. Nodes can easily be distributed such that robots share and exploit common resources in the cloud.</p>
<p><img alt="Willow Garage's Turtlebot" width="71" height="100" vspace="1" hspace="12" align="left" src="http://weblogs.java.net/sites/default/files/turtlebot-02.jpeg" />There are a number of robots available with ROS. Willow Garage has designed&nbsp;<a href="http://www.willowgarage.com/turtlebot">Turtlebot</a>&nbsp;as an inexpensive, open-source mobile platform which integrates machine vision using Microsoft's Kinect. If you already have iRobot's Create and a laptop, a kit can cost as little as $500-$600. Turtlebots have an avid&nbsp;<a href="http://makeprojects.com/Topic/TurtleBot">hacker following</a>&nbsp;and&nbsp;are available from&nbsp;<a href="http://store.clearpathrobotics.com/collections/vendors?q=Clearpath+Robotics">Clearpath Robotics</a>&nbsp;and&nbsp;<a href="http://store.iheartengineering.com/">I Heart Robotics</a>.&nbsp;</p>
<p>An inexpensive open source kit featuring a robotic arm is available from&nbsp;<a href="http://www.bilibot.com/Developer_Edition">Bilibot</a>. Bilibot should resume deliveries later this month after having run out of stock. More expensive will be iRobot's&nbsp;<a href="http://news.cnet.com/8301-30685_3-20061651-264.html#ixzz1YhmFu1vs">AVA</a>, a Xoom powered Android robot which is expected to be introduced in the fall for creating telepresence applications. Finally&nbsp;<a href="http://singularityhub.com/2011/05/11/luna-personal-robot-brings-you-telepresence-and-more-for-3k-can-it-be-a-game-changer/">Luna</a>&nbsp;is a personal robot which is already out to developers.</p>
<p>&nbsp;</p>
<table id="attachments" class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><a href="http://www.java.net/sites/default/files/robot250x333_0.jpg">robot250x333.jpg</a></td><td>10.89 KB</td> </tr>
<tr class="even"><td><a href="http://www.java.net/sites/default/files/turtlebot-02.jpeg">turtlebot-02.jpeg</a></td><td>9.7 KB</td> </tr>
</tbody>
</table>
http://www.java.net/blog/semesa2/archive/2011/09/24/rosjava-%E2%80%93-java-robotics#commentsBlogsJ2MEJ2SEMobilityPortingRoboticsWeb ApplicationsSat, 24 Sep 2011 19:13:56 +0000semesa2846759 at http://www.java.netSencha Touch Jump Starthttp://www.java.net/blog/lifemichael/archive/2011/09/19/sencha-touch-jump-start
<!-- | 0 --><p>The <a target="_blank" href="http://www.xperato.com/hit/hitphp.html">PHP Cross Platform Web Applications</a> course I teach in <a target="_blank" href="http://www.hit.ac.il">HIT</a> coveres some of the newest web technologies. The next meeting covers <a target="_blank" href="http://www.sencha.com/products/touch">Sencha Touch</a>. It is a Java Script library that allows us to develop web applications optimized for touch screen devices, such as mobile telephones and tablets. In order to assist my students with the understanding of this topic I chose to create two video clips that explain how to download <a target="_blank" href="http://www.sencha.com/products/touch">Sencha Touch</a>, how to execute the code samples it includes and how to develop a simple Hello World application.</p>
<p><object width="640" height="480">
<param name="movie" value="http://www.youtube-nocookie.com/v/--uNR2oRn00?version=3&amp;hl=en_US" />
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" width="640" height="480" src="http://www.youtube-nocookie.com/v/--uNR2oRn00?version=3&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><object width="640" height="480">
<param name="movie" value="http://www.youtube-nocookie.com/v/9jPrS4Uo948?version=3&amp;hl=en_US" />
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" width="640" height="480" src="http://www.youtube-nocookie.com/v/9jPrS4Uo948?version=3&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The source code is available for free download in my community version for the Sencha Touch course I developed. You can find it at <a href="http://www.abelski.org">www.abelski.org</a>.</p>
http://www.java.net/blog/lifemichael/archive/2011/09/19/sencha-touch-jump-start#commentsAjaxBlogsMobilityMon, 19 Sep 2011 05:50:52 +0000lifemichael844473 at http://www.java.netNetbeans+Blackberry+Lwuithttp://www.java.net/blog/mikevegap/archive/2010/11/12/netbeansblackberrylwuit
<!-- | 24 --><!--break--><!--break--><p>Hi, this post will try to guide you to develope an BlackBerry+LWUIT easy sample using Netbeans 6.9.</p>
<p>I was looking for a simple step by step guide to do it, but i found that many resources were removed, making the learning a little hard. But here i present a very simple and functional tutorial about this, enjoy it...<br />
&nbsp;</p>
<div>
<div color="transparent" style="overflow: hidden; text-decoration: none; border: medium none;"><font style="font-weight: bold;">1.</font> Download the JDE versions, I recommend 4.7.x (for Storm support)<font>.<br />
</font></div>
</div>
<p><font style="font-weight: bold;">2.</font> Download Netbeans 6.9.
</p>
<p><strong>3. </strong>Download and install the Netbeans BlackBerry Plugin from: <a href="http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=11194">http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=11194</a></p>
<p>
<font style="font-weight: bold;">4.</font> Download <a href="http://bb-ant-tools.sourceforge.net/">BB AnT Tools</a>, make sure you are using Ant 1.7 or higher.</p>
<p>This will provide support for tasks like:</p>
<ul>
<li>rapc</li>
<li>sigtool</li>
<li>alx</li>
<li>jadtool</li>
</ul>
<p><font style="font-weight: bold;">5.</font>Unzip and copy the file &quot;<font style="font-weight: bold;">bb-ant-tools.jar</font>&quot; to the ${Netbeans-home}/java/ant/lib directory.</p>
<p><font style="font-weight: bold;">6.</font>Fetch the LWUIT sources from SVN and open the BlackBerryPort project.</p>
<p><font style="font-weight: bold;">Clean &amp; Build</font></p>
<p>the project (notice that you MUST clean &amp; build, a plain build will often fail since the RIM port needs to replace some classes from LWUIT).<font><br />
<font style="font-weight: bold;"><br />
7.</font> Remove: com.sun.lwuit.animations.Transition3D.java file from the LWUIT MIDP source code and clean &amp; build.<br />
<font style="font-weight: bold;">7.1.</font> This is important, because, Blackberry doesn't support M3G classes.</p>
<p><font style="font-weight: bold;">7.2.</font> Or if don't want to remove that file, </font>try to look for preverify task, then you can do a bit of testing and ensure that it doesnt preverify the library. Netbeans ant plugin is a pretty simple setup and you can change it which ever way you want to.</p>
<p><font><br />
<font style="font-weight: bold;">8.</font> Clean &amp; Build the BlackberryPort (BlackberryPort is within the LWUIT source code, both <font style="font-weight: bold;">LWUIT</font> and <font style="font-weight: bold;">BlackberryPort</font> are netbeans projects).<br />
<strong>9</strong>. Download <a href="https://docs.google.com/leaf?id=0B88DkJg9p-3rOTk2OGNlODctMjU0NC00ZDVhLWE0MjMtZGJjNmQwNmYzMTc3&amp;hl=en">helloLwuit</a> demo project (this is copy with a little variation of the file provided by </font>Steve Zhang's blog).</p>
<p>&nbsp;</p>
<p>Try it...</p>
<p>To know more about the ANT build files, review the references.</p>
<p>&nbsp;</p>
<p>References</p>
<p><a href="http://javamvp.blogspot.com">http://javamvp.blogspot.com</a><br />
<a href="http://lwuit.blogspot.com/2009/11/building-project-on-blackberry.html">http://lwuit.blogspot.com/2009/11/building-project-on-blackberry.html</a><br />
<a href="http://code-dojo.blogspot.com/2010/05/ant-build-script-for-lwuit-blackberry.html">http://code-dojo.blogspot.com/2010/05/ant-build-script-for-lwuit-blackberry.html</a><br />
<a href="http://stackoverflow.com/questions/2578403/error-preverifying-class-netbeans-6-8-using-lwuit-api">http://stackoverflow.com/questions/2578403/error-preverifying-class-netbeans-6-8-using-lwuit-api</a></p>
http://www.java.net/blog/mikevegap/archive/2010/11/12/netbeansblackberrylwuit#commentsBlogsEmbeddedIDEJ2MEMobilityNetBeansNetBeansFri, 12 Nov 2010 18:57:48 +0000mikevegap732247 at http://www.java.netStarting with the Android Platformhttp://www.java.net/blog/elevy/archive/2010/10/23/starting-android-platform
<!-- 837 | 0 --><img src="/images/people/elie_levy.jpg" border="0", align="left" /><p>I have been working a lot with the Swing APIs for a while now; created my own custom components, built filthy rich applications, and wrote a few blogs on the different things I found interesting. </p>
<p>As soon as the first Android phone was available, I went out to get my hands on it (the G1). </p>
<p>Since then, I always wanted to start at least looking into the APIs and writing my first Android app. For different reasons, I haven't been able until a couple of weeks back. </p>
<p>And I finally did it! </p>
<p>I created a really cool Mortgage Calculator for the Android Market. I called it: <a href="http://www.zilonis.org/mortgage.php">Mortgage Shark Calculator</a>. It allows you to compare 56 loans in one screen. </p>
<p>Android is easy to learn, especially for anyone who has been playing with the Java 2D API's. </p>
<p><img alt="" src="http://www.zilonis.org/screen1.jpg" /> </p>
<p>I created a custom View, in which I am drawing the different payment amounts for all the mortgages. I wrote a simple event handler that listens for the touch events on the screen, and when the touch event lasts more than 400 milliseconds I draw a pop up on the screen. </p>
<p><img alt="" src="http://www.zilonis.org/screen2.jpg" /> </p>
<p>It was extremely easy to make all this custom behavior with the APIs. </p>
<p>I am using the alpha bits of the colors to make the background of the pop up semi-transparent giving it a more professional look. </p>
<p>You can also change the parameters of the comparison matrix by pressing the menu button on your phone, and then editing all the attributes of the loan. </p>
<p><img src="http://www.zilonis.org/screen4.jpg" alt="" /> </p>
<p>Give it a try and let me know if you would be interested in knowing the details of how I coded any specific piece of it.</p>
http://www.java.net/blog/elevy/archive/2010/10/23/starting-android-platform#commentsBloggingBlogsEmbeddedGUIJ2MEJ2SEJava DesktopMobilitySwingSat, 23 Oct 2010 16:55:34 +0000elevy642468 at http://www.java.netJUG-Indiahttp://www.java.net/project/jug-india
<fieldset class="fieldgroup group-projurl"><legend>Project URL</legend><div class="field field-type-text field-field-project-url">
<div class="field-items">
<div class="field-item odd">
<script language="JavaScript" type="text/javascript">
<!--
var name = "owner";
var domain = "jug-india.dev.java.net";
var display = "Send Email to the Project Owner";
var subject = "";
var ending = "";
var style = "";
document.write('<a class="' + style + '" href="mailto:' + name + '&#64;' + domain + '?subject=' + subject + '">');
if (display) {
document.write(display);
} else {
document.write(name + '&#64;' + domain);
}
document.write('</a>' + ending);
// -->
</script>
<br />
<a href="http://jug-india.dev.java.net">Go see Project Homepage</a>
</div>
</div>
</div>
<!-- /content-field -->
</fieldset>
<div class="field text">
<h3 class="label">Summary</h3>
<div class="item odd">United Indian Java User Group. Home for all JUGs around India. </div>
</div>
<!-- /content-field -->
<!-- /content-field -->
<div class="field nodereference">
<h3 class="label inline">Community:&nbsp;</h3>
<div class="item inline odd"><a href="/java-user-groups">Java User Groups</a></div>
</div>
<!-- /content-field -->
Incubating<p></p><p>This is a Project India on JUG. </p>
<p>This project aims to unite all the JUG across india. Discuss and present to all Indians.This is a map to JUGs around india.</p>
<div class="field number-integer">
<div class="item odd">No Valuable Assets Inside Yet</div>
</div>
<!-- /content-field -->
<div class="field number-decimal">
<h3 class="label inline">License:&nbsp;</h3>
<div class="item inline odd">Apache License, Version 2.0</div>
</div>
<!-- /content-field -->
http://www.java.net/project/jug-india#commentsAccessibilityAjaxBloggingBusinessCommunityDatabasesDeploymentDistributedEclipseEducationEJBExtreme ProgrammingGamesGridGUIIDEInstant MessagingJ2EEJ2MEJ2SEJakartaJava User GroupsJavaOneJiniJSPJSRJXTALDAPLinuxMobilityNetBeansOpen SourceOpenSolarisOSGiP2PPatternsPerformancePortingProgrammingResearchRMIRSS FeedsSearchSecurityServletsStrutsSwingTestingToolsVirtual MachineWeb ApplicationsWeb DesignWeb Development ToolsWeb Services and XMLTue, 19 Oct 2010 10:49:38 +0000rrhegde639348 at http://www.java.netAbelski Free Courseshttp://www.java.net/blog/lifemichael/archive/2010/10/04/abelski-free-courses
<div class="field field-type-filefield field-field-thumb-100x70">
<div class="field-items">
<div class="field-item odd">
<img class="imagefield imagefield-field_thumb_100x70" width="100" height="70" alt="" src="http://www.java.net/sites/default/files/lifemichael/abelski_100_70.png?1286178875" /> </div>
</div>
</div>
<p>My name is <a href="http://www.lifemichael.com">Haim Michael</a>, I am the General Manager for <a href="http://www.zindell.com">Zindell Technologies</a> and I am an eternal student and a lecturer. I chose to develop the <a href="http://www.abelski.com">abelski</a> web site for the benefit of all people world wide. I have started to develop it in November 2007 and I continuously update its courses and add new ones. All courses on this web site are available for free personal and academic usage.&nbsp;</p>
<p><a target="_blank" href="http://www.abelski.com"><img border="0" alt="" width="640" src="http://www.lifemichael.com/images/2010/abelski_1000.png" /></a></p>
<p><a target="_blank" href="http://www.abelski.com"><img border="0" alt="" width="640" src="http://www.lifemichael.com/images/2010/abelski_1000_2.png" /></a></p>
<p>The abelski web site includes slides, video clips, assignments and solutions. I will be more than happy to get your feedback.&nbsp;</p>
http://www.java.net/blog/lifemichael/archive/2010/10/04/abelski-free-courses#commentsAccessibilityAjaxBloggingBlogsBusinessCommunityDatabasesDeploymentDistributedEclipseEducationEJBEmbeddedExtreme ProgrammingGamesGlassFishGlobal Education and LearningGUIIDEInstant MessagingJ2EEJ2MEJ2SEJakartaJava CommunicationsJava DesktopJava EnterpriseJava PatternsJava ToolsJava User GroupsJava Web Services and XMLJCPJDDACJSPJSRJXTAJXTALDAPLinuxMobilityNetBeansNetBeansOpen JDKOpen SourceOSGiP2PPatternsPerformancePortingPortletProgrammingResearchRMIRSS FeedsSearchSecurityServletsStrutsSwingTestingToolsVirtual MachineWeb ApplicationsWeb DesignWeb Development ToolsWeb Services and XMLMon, 04 Oct 2010 08:03:47 +0000lifemichael492704 at http://www.java.netMyPhoneGunhttp://www.java.net/project/myphonegun
<fieldset class="fieldgroup group-projurl"><legend>Project URL</legend><div class="field field-type-text field-field-project-url">
<div class="field-items">
<div class="field-item odd">
<script language="JavaScript" type="text/javascript">
<!--
var name = "owner";
var domain = "myphonegun.dev.java.net";
var display = "Send Email to the Project Owner";
var subject = "";
var ending = "";
var style = "";
document.write('<a class="' + style + '" href="mailto:' + name + '&#64;' + domain + '?subject=' + subject + '">');
if (display) {
document.write(display);
} else {
document.write(name + '&#64;' + domain);
}
document.write('</a>' + ending);
// -->
</script>
<br />
<a href="http://myphonegun.dev.java.net">Go see Project Homepage</a>
</div>
</div>
</div>
<!-- /content-field -->
</fieldset>
<div class="field text">
<h3 class="label">Summary</h3>
<div class="item odd">Java ME app showed at JavaOne 2010</div>
</div>
<!-- /content-field -->
<!-- /content-field -->
<div class="field nodereference">
<h3 class="label inline">Community:&nbsp;</h3>
<div class="item inline odd"><a href="/iot-0">IoT</a></div>
</div>
<!-- /content-field -->
IncubatingUse your mobile phone as a Gun with MyPhoneGun MIDlet, this app was showed at JavaOne2010 <!-- /content-field -->
<div class="field number-decimal">
<h3 class="label inline">License:&nbsp;</h3>
<div class="item inline odd">GNU General Public License (GPL v. 2.0)</div>
</div>
<!-- /content-field -->
http://www.java.net/project/myphonegun#commentsEmbeddedGamesJ2MEJavaOneMobilityWed, 15 Sep 2010 00:17:54 +0000marlon_luz481423 at http://www.java.netApple finally permits Java on the iPhone - When will Oracle deliver?http://www.java.net/blog/mkarg/archive/2010/09/10/apple-finally-permits-java-iphone-when-will-oracle-deliver
<div class="field field-type-filefield field-field-thumb-100x70">
<div class="field-items">
<div class="field-item odd">
<img class="imagefield imagefield-field_thumb_100x70" width="283" height="425" alt="" src="http://www.java.net/sites/default/files/mkarg/Meister-klein_10.jpg?1284106636" /> </div>
</div>
</div>
<p>When the iPhone came to market, Sun Microsystems <a href="http://blogs.sun.com/ontherecord/entry/sun_announces_intent_to_create">announced</a> that there soon will be Java for the iPhone. They got stopped by Apple's licence terms, which ban both, interpreted languages and code written in other language than C, C++, Objective&nbsp;C and JavaScript. Lately I read in the <a href="http://www.appleinsider.com/articles/10/06/11/apple_relaxes_ios_sdk_to_allow_lua_but_block_flash.html">news</a> that Apple change the licence terms, and found a promising <a href="http://www.apple.com/pr/library/2010/09/09statement.html">statement</a> on Apple's web site, so now interpreted code actually is allowed. So when will Oracle deliver Java SE for the&nbsp;iPhone? And is that Apple's surrender to the increase of Android's market share?</p>
<hr />
<p>A complete overview of all my postings can be found in my web site <a href="http://www.headcrashing.eu">Head Crashing Informatics</a>&nbsp;(<a href="http://www.headcrashing.eu">http://www.headcrashing.eu</a>).</p>
http://www.java.net/blog/mkarg/archive/2010/09/10/apple-finally-permits-java-iphone-when-will-oracle-deliver#commentsBlogsEmbeddedJ2SEJava DesktopMobilityPortingProgrammingResearchVirtual MachineFri, 10 Sep 2010 08:17:17 +0000mkarg479098 at http://www.java.netKalimucho: a platform for dynamic deployment/reconfiguration of applications on heterogeneous deviceshttp://www.java.net/project/kalimucho-platform-dynamic-deploymentreconfiguration-applications-heterogeneous-devices
<fieldset class="fieldgroup group-projurl"><legend>Project URL</legend><div class="field field-type-text field-field-project-url">
<div class="field-items">
<div class="field-item odd">
<script language="JavaScript" type="text/javascript">
<!--
var name = "owner";
var domain = "kalimucho.dev.java.net";
var display = "Send Email to the Project Owner";
var subject = "";
var ending = "";
var style = "";
document.write('<a class="' + style + '" href="mailto:' + name + '&#64;' + domain + '?subject=' + subject + '">');
if (display) {
document.write(display);
} else {
document.write(name + '&#64;' + domain);
}
document.write('</a>' + ending);
// -->
</script>
<br />
<a href="http://kalimucho.dev.java.net">Go see Project Homepage</a>
</div>
</div>
</div>
<!-- /content-field -->
</fieldset>
<div class="field text">
<h3 class="label">Summary</h3>
<div class="item odd">A platform for dynamic deployment/reconfiguration of application</div>
</div>
<!-- /content-field -->
<!-- /content-field -->
<div class="field nodereference">
<h3 class="label inline">Community:&nbsp;</h3>
<div class="item inline odd"><a href="/iot-0">IoT</a></div>
</div>
<!-- /content-field -->
Incubating<div class="field number-integer">
<div class="item odd">No Valuable Assets Inside Yet</div>
</div>
<!-- /content-field -->
<div class="field number-decimal">
<h3 class="label inline">License:&nbsp;</h3>
<div class="item inline odd">Lesser General Public License (LGPL)</div>
</div>
<!-- /content-field -->
http://www.java.net/project/kalimucho-platform-dynamic-deploymentreconfiguration-applications-heterogeneous-devices#commentsDeploymentDistributedEmbeddedMobilityOpen SourcePatternsProgrammingResearchVirtual MachineMon, 31 May 2010 13:46:37 +0000dalmau422255 at http://www.java.net