<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>laccetti.com</title>
	<atom:link href="http://www.laccetti.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.laccetti.com</link>
	<description>CodeOgre™, Cyclist, Book Devourer</description>
	<lastBuildDate>Thu, 29 Mar 2012 16:48:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Who needs JMS?!</title>
		<link>http://www.laccetti.com/index.php/2012/03/who-needs-jms/</link>
		<comments>http://www.laccetti.com/index.php/2012/03/who-needs-jms/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 16:37:01 +0000</pubDate>
		<dc:creator>mlaccetti</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[websocket]]></category>

		<guid isPermaLink="false">http://www.laccetti.com/?p=75</guid>
		<description><![CDATA[Or, How WebSockets on the server can make the world an awesome place Currently listening to: Roger Shah Live – Mix Mission One of my ongoing open-source projects is something called ‘vlove’ – short for ‘virtual love’ &#8211; the idea being that one can have a bunch of machines that host VMs and would like [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2012%2F03%2Fwho-needs-jms%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2012%2F03%2Fwho-needs-jms%2F&amp;source=mlaccetti&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Or, How WebSockets on the server can make the world an awesome place</strong></p>
<p>Currently listening to: Roger Shah Live – Mix Mission</p>
<p>One of my ongoing open-source projects is something called ‘<a href="https://github.com/limone/vlove">vlove</a>’ – short for ‘virtual love’ &#8211; the idea being that one can have a bunch of machines that host VMs and would like to control them from the same web-based user interface.&#160; Nothing groundbreaking or crazy here – plenty of people have done this before: <a href="http://pve.proxmox.com/wiki/Main_Page">Proxmox VE</a> (my personal choice), Eucalyptus, CloudStack, OpenNebula, OpenStack…&#160; And those tend to be the free ones – there are the expensive enterprise solutions from companies like VMware, Citrix, and Microsoft.</p>
<p>Sadly, I find that most of these solutions have a problem – they’re pre-rolled, and force you to install a bunch of servers or services that they support, in a very specific way.&#160; My servers are already up and running, and I don’t need most of the Infrastructure as a Service (IaaS) functionality they provide – I just want a website that I can browse to to see what is or isn’t running, and so some basic administrative stuff like provisioning a new virtual machine.&#160; If I was running RedHat or CentOS, I could use an existing solution, but since I’m using Ubuntu, I’m basically out of luck.</p>
<p>And thus vlove was born – a web-centric management interface that hooks into any libvirt-based virtualization tool.&#160; I got it up and running and had the basics running when I had a bit of a problem.&#160; You see, I have multiple servers located in a bunch of datacentres around the world, and I didn’t want each one to have it’s own interface.&#160; So, I broke my code up into a centralized webapp along with a bunch of agents that could be deployed to a variety of servers.&#160; (I’m not addressing security or reliability – at some point I might build in automatic failover support, but I gotta start at the bottom!)</p>
<p>After I split my code up, I had to make a decision: how do I get all of my agents to talk to the server?&#160; Now, if I was doing an internal-only setup (or VPN deployed), I’d cheat, and probably use JMS.&#160; However, I didn’t want to rely on another piece of software (embedded JMS or not – still something to worry about) – as I’m deploying a webapp, I thought that I could leverage that.&#160; With that in mind, I started considering using REST services with the agent polling the server periodically to say that it was alive, or to check to see if anything needed to be done.&#160; However, I killed that idea pretty quickly – if the user wants to provision something, I don’t want them waiting in any way.</p>
<p>In a flash of inspiration, I decided that I’d try to use <a href="https://github.com/Atmosphere/atmosphere">Atmosphere</a> and WebSockets – I can piggyback over HTTP, so nothing crazy there, but I’d get bi-directional communication with each agent!&#160; I did some research, and found that there is a library called “<a href="https://github.com/sonatype/async-http-client/">Async HTTP Client</a>” that has native WebSocket support.&#160; Win!&#160; With both the server side and client side up and running, it was time to do some integration work.</p>
<h2>Server Side</h2>
<p>First, we need to get Atmosphere integrated on the server side.&#160; For those of you using Maven, it’s quick and dirty to import the dependency – the rest of you can figure something out:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #008000">&lt;!-- Atmosphere --&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">dependency</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">groupId</span><span style="color: #0000ff">&gt;</span>org.atmosphere<span style="color: #0000ff">&lt;/</span><span style="color: #800000">groupId</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">artifactId</span><span style="color: #0000ff">&gt;</span>atmosphere-runtime<span style="color: #0000ff">&lt;/</span><span style="color: #800000">artifactId</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">version</span><span style="color: #0000ff">&gt;</span>0.9.0.RC2<span style="color: #0000ff">&lt;/</span><span style="color: #800000">version</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">dependency</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>You’ll see that I’m using a release candidate instead of the 0.8.6 release – I can’t guarantee that it’ll work, but at the same time the functionality that is in use has been in place for a while now.</p>
<p>So, now that you have the dependency in place, you need to create the implementation; it’s pretty painless as all we have to do is extend <code>WebSocketHandler</code> and we’re off to the races.&#160; For reference, here’s the incredibly basic vlove implementation:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">package</span> vlove.web.websocket;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #0000ff">import</span> org.atmosphere.cpr.AtmosphereResource;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> <span style="color: #0000ff">import</span> org.atmosphere.cpr.Broadcaster;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #0000ff">import</span> org.atmosphere.cpr.BroadcasterFactory;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span> <span style="color: #0000ff">import</span> org.atmosphere.websocket.WebSocket;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span> <span style="color: #0000ff">import</span> org.atmosphere.websocket.WebSocketEventListenerAdapter;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span> <span style="color: #0000ff">import</span> org.atmosphere.websocket.WebSocketHandler;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span> <span style="color: #0000ff">import</span> org.slf4j.Logger;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span> <span style="color: #0000ff">import</span> org.slf4j.LoggerFactory;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> VloveWebSocketProtocol <span style="color: #0000ff">extends</span> WebSocketHandler {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>   <span style="color: #0000ff">static</span> <span style="color: #0000ff">final</span> Logger log = LoggerFactory.getLogger(VloveWebSocketProtocol.<span style="color: #0000ff">class</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>   AtmosphereResource r;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>   @Override</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>   <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> onTextMessage(WebSocket webSocket, String message) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>     log.debug(<span style="color: #006080">&quot;Received message: {}&quot;</span>, message);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>     </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>     AtmosphereResource r = webSocket.resource();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>     Broadcaster b = lookupBroadcaster(r.getRequest().getPathInfo());</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>     <span style="color: #0000ff">if</span> (message != null &amp;&amp; message.indexOf(<span style="color: #006080">&quot;message&quot;</span>) != -1) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>       b.broadcast(message.substring(<span style="color: #006080">&quot;message=&quot;</span>.length()));</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>   }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>   @Override</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span>   <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> onOpen(WebSocket webSocket) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum30">  30:</span>     <span style="color: #008000">// Accept the handshake by suspending the response.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum31">  31:</span>     r = webSocket.resource();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum32">  32:</span>     <span style="color: #008000">// Create a Broadcaster based on the path</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum33">  33:</span>     Broadcaster b = lookupBroadcaster(r.getRequest().getPathInfo());</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum34">  34:</span>     r.setBroadcaster(b);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum35">  35:</span>     r.addEventListener(<span style="color: #0000ff">new</span> WebSocketEventListenerAdapter());</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum36">  36:</span>     r.suspend(-1);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum37">  37:</span>   }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum38">  38:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum39">  39:</span>   <span style="color: #008000">/**</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum40">  40:</span> <span style="color: #008000">   * Retrieve the {@link Broadcaster} based on the request's path info.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum41">  41:</span> <span style="color: #008000">   *</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum42">  42:</span> <span style="color: #008000">   * @param pathInfo</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum43">  43:</span> <span style="color: #008000">   * @return the {@link Broadcaster} based on the request's path info.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum44">  44:</span> <span style="color: #008000">   */</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum45">  45:</span>   <span style="color: #0000ff">private</span> Broadcaster lookupBroadcaster(String pathInfo) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum46">  46:</span>     String[] decodedPath = pathInfo.split(<span style="color: #006080">&quot;/&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum47">  47:</span>     Broadcaster b = BroadcasterFactory.getDefault().lookup(decodedPath[decodedPath.length - 1], true);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum48">  48:</span>     <span style="color: #0000ff">return</span> b;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum49">  49:</span>   }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum50">  50:</span>   </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum51">  51:</span>   <span style="color: #008000">/**</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum52">  52:</span> <span style="color: #008000">   * Used to send a message to whatever is connected on the other side.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum53">  53:</span> <span style="color: #008000">   * </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum54">  54:</span> <span style="color: #008000">   * @param message The message to send.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum55">  55:</span> <span style="color: #008000">   */</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum56">  56:</span>   <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> broadcastMessage(String message) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum57">  57:</span>     r.getBroadcaster().broadcast(message);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum58">  58:</span>   }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum59">  59:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>The next step would be to tie the above class to an in-memory topic to have the app push messages straight through to the agent.&#160; That part hasn’t been implemented because I <strong>*just*</strong> got this code to work, and was very excited about sharing it!</p>
<p>The final step is to flip Atmosphere on, which requires a change to your web.xml as you have to add a servlet.&#160; Again, here’s a snippet:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">servlet</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">description</span><span style="color: #0000ff">&gt;</span>AtmosphereServlet<span style="color: #0000ff">&lt;/</span><span style="color: #800000">description</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">&gt;</span>AtmosphereServlet<span style="color: #0000ff">&lt;/</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">servlet-class</span><span style="color: #0000ff">&gt;</span>org.atmosphere.cpr.AtmosphereServlet<span style="color: #0000ff">&lt;/</span><span style="color: #800000">servlet-class</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">init-param</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">param-name</span><span style="color: #0000ff">&gt;</span>org.atmosphere.useWebSocket<span style="color: #0000ff">&lt;/</span><span style="color: #800000">param-name</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">param-value</span><span style="color: #0000ff">&gt;</span>true<span style="color: #0000ff">&lt;/</span><span style="color: #800000">param-value</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">init-param</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">init-param</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">param-name</span><span style="color: #0000ff">&gt;</span>org.atmosphere.websocket.WebSocketProtocol<span style="color: #0000ff">&lt;/</span><span style="color: #800000">param-name</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">param-value</span><span style="color: #0000ff">&gt;</span>vlove.web.websocket.VloveWebSocketProtocol<span style="color: #0000ff">&lt;/</span><span style="color: #800000">param-value</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">init-param</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">load-on-startup</span><span style="color: #0000ff">&gt;</span>0 <span style="color: #0000ff">&lt;/</span><span style="color: #800000">load-on-startup</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">async-supported</span><span style="color: #0000ff">&gt;</span>true<span style="color: #0000ff">&lt;/</span><span style="color: #800000">async-supported</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">servlet</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">servlet-mapping</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">&gt;</span>AtmosphereServlet<span style="color: #0000ff">&lt;/</span><span style="color: #800000">servlet-name</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">url-pattern</span><span style="color: #0000ff">&gt;</span>/s/*<span style="color: #0000ff">&lt;/</span><span style="color: #800000">url-pattern</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">servlet-mapping</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>At this point you should be able to deploy your webapp to a WebSocket compliant servlet container – I specifically tested this against Jetty 8.1.1.</p>
<h2>Client Side</h2>
<p>Again, I’m using Maven, so here’s the Async HTTP Client dependency:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #008000">&lt;!-- Async Client --&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">dependency</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">groupId</span><span style="color: #0000ff">&gt;</span>com.ning<span style="color: #0000ff">&lt;/</span><span style="color: #800000">groupId</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">artifactId</span><span style="color: #0000ff">&gt;</span>async-http-client<span style="color: #0000ff">&lt;/</span><span style="color: #800000">artifactId</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">version</span><span style="color: #0000ff">&gt;</span>1.8.0-SNAPSHOT<span style="color: #0000ff">&lt;/</span><span style="color: #800000">version</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">dependency</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>Similar to Atmosphere, I’m using the latest code (1.8.0-SNAPSHOT), but the 1.7.1 release should be just as useful.&#160; The reason I am using the unreleased/snapshot versions was due to me not knowing if my utter failures in getting things to work was related to versioning, or failure to understand what was going on.&#160; It was the latter, but I never got around to reverting to stable releases.</p>
<p>The final step is to create some test code that uses the AHC to actually invoke the server:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">package</span> vlove.websocket;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #0000ff">import</span> org.junit.Test;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> <span style="color: #0000ff">import</span> org.slf4j.Logger;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #0000ff">import</span> org.slf4j.LoggerFactory;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span> <span style="color: #0000ff">import</span> com.ning.http.client.AsyncHttpClient;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span> <span style="color: #0000ff">import</span> com.ning.http.client.websocket.WebSocket;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span> <span style="color: #0000ff">import</span> com.ning.http.client.websocket.WebSocketTextListener;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span> <span style="color: #0000ff">import</span> com.ning.http.client.websocket.WebSocketUpgradeHandler;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> TestWebSocket {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>   <span style="color: #0000ff">protected</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">final</span> Logger log = LoggerFactory.getLogger(TestWebSocket.<span style="color: #0000ff">class</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>   </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>   @Test</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>   <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> testWebSocketConnection() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>     AsyncHttpClient c = <span style="color: #0000ff">new</span> AsyncHttpClient();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>     <span style="color: #0000ff">try</span> {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>       WebSocket ws = c.prepareGet(<span style="color: #006080">&quot;ws://localhost:80/vlove/s/1&quot;</span>).execute(<span style="color: #0000ff">new</span> WebSocketUpgradeHandler.Builder().addWebSocketListener(<span style="color: #0000ff">new</span> WebSocketTextListener() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>         @Override</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>         <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> onOpen(WebSocket websocket) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>           log.debug(<span style="color: #006080">&quot;Socket opened.&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>         @Override</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>         <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> onClose(WebSocket websocket) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>           log.debug(<span style="color: #006080">&quot;Socket closed.&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum30">  30:</span>         @Override</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum31">  31:</span>         <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> onError(Throwable t) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum32">  32:</span>           log.error(<span style="color: #006080">&quot;Error.&quot;</span>, t);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum33">  33:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum34">  34:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum35">  35:</span>         @Override</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum36">  36:</span>         <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> onMessage(String message) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum37">  37:</span>           log.debug(<span style="color: #006080">&quot;Message: {}&quot;</span>, message);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum38">  38:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum39">  39:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum40">  40:</span>         @Override</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum41">  41:</span>         <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> onFragment(String fragment, <span style="color: #0000ff">boolean</span> last) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum42">  42:</span>           <span style="color: #008000">// TODO Auto-generated method stub</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum43">  43:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum44">  44:</span>       }).build()).get();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum45">  45:</span>       </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum46">  46:</span>       <span style="color: #0000ff">while</span> (!ws.isOpen()) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum47">  47:</span>         Thread.sleep(50);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum48">  48:</span>       }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum49">  49:</span>       </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum50">  50:</span>       log.debug(<span style="color: #006080">&quot;Sending message.&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum51">  51:</span>       ws.sendTextMessage(<span style="color: #006080">&quot;Narf.&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum52">  52:</span>     } <span style="color: #0000ff">catch</span> (Exception ex) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum53">  53:</span>       log.error(<span style="color: #006080">&quot;Could not do websocket stuff.&quot;</span>, ex);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum54">  54:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum55">  55:</span>     <span style="color: #0000ff">try</span> {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum56">  56:</span>       System.in.read();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum57">  57:</span>     } <span style="color: #0000ff">catch</span> (Exception ex) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum58">  58:</span>       <span style="color: #008000">// ignore</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum59">  59:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum60">  60:</span>   }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum61">  61:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>If you run the JUnit test, you should see things connect to the server, send a message and otherwise hang out.&#160; To end the test, hit any key.</p>
<p>Questions?&#160; Comments?&#160; You can hit me up on Twitter (@mlaccetti), comment here, or email me (<a href="mailto:michael@laccetti.com">michael@laccetti.com</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laccetti.com/index.php/2012/03/who-needs-jms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sunday Reflections</title>
		<link>http://www.laccetti.com/index.php/2012/03/sunday-reflections/</link>
		<comments>http://www.laccetti.com/index.php/2012/03/sunday-reflections/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 23:27:33 +0000</pubDate>
		<dc:creator>mlaccetti</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.laccetti.com/?p=73</guid>
		<description><![CDATA[Or, How I Learned to Love the Language Currently listening to: Gui Boratto &#8211; The Mix Collection (Disc 1) &#8211; Lusine &#8211; Double Vision When it comes to software and languages, I classify myself as having an attention problem – every morning I fire up hacker news or techmeme and take a peek at the [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2012%2F03%2Fsunday-reflections%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2012%2F03%2Fsunday-reflections%2F&amp;source=mlaccetti&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Or, How I Learned to Love the Language</strong></p>
<p>Currently listening to: Gui Boratto &#8211; The Mix Collection (Disc 1) &#8211; Lusine &#8211; Double Vision</p>
<p>When it comes to software and languages, I classify myself as having an attention problem – every morning I fire up hacker news or techmeme and take a peek at the “cool things” happening in the tech world.&#160; Most days there is a post about a new language, new framework, or algorithm for solving a problem in a new and novel way.&#160; Each time I read one of these, I feel compelled to try it out, to see how awesome it is, thinking to myself “this will be the one that gets me to switch from Java!”</p>
<p>And yet, I’m <a href="https://github.com/limone">still writing apps in Java</a>.&#160; In the last few years, I’ve tried most things out there.&#160; Some, like Python, I rather liked, but didn’t really see any advantage to changing – one could argue that Python is better than Java, but it isn’t orders of magnitude.&#160; I tried Ruby, saw the cruft that goes into an HTML page in Rails and ran screaming.&#160; I tried Scala and Lift, and liked it, but came to the conclusion that there would be no financial services company using Scala any time soon – they have enough problems with basic Java.&#160; C and C++ don’t target the markets I tend to work in, and while I do like C#, I’m just not a Microsoft guy; aside from using their OS on my workstation.&#160; PHP and Perl get lumped in the “I don’t hate myself that much” department.&#160; I gave Erlang a whirl and loved it, then looked to see who uses it, and felt like I was lost in a forest at night.</p>
<p>The most recent foray was into node.js and server-side JavaScript.&#160; Now, as a web developer in the 90s and 00s, you learned to hate JS with a passion.&#160; Buggy implementations, browser specific features, having to sniff for functionality…&#160; It was a terrible time.&#160; Luckily, smart people came up with libraries that abstracted that away – jQuery, Dojo, Moo, YUI – they all made it okay to be a JS developer.&#160; In fact, it was a guilty pleasure to write little scripts that did cool things in a browser.&#160; Using node seemed like a no-brainer – taking the simplicity and elegance from the browser to the server.</p>
<p>The first time I tried node, I gave up the same day.&#160; Apparently the developers were using anything but Windows, which didn’t do much for me.&#160; If I have to switch OS to use your platform, you’re not for me.&#160; (Which is why I don’t do very much with xcode/Objective C.)&#160; Microsoft came along and decided that node would be a great addition to Azure, so they got the cross-platform ball rolling.&#160; I tried node again, and found that while the command line was functional, there wasn’t much in the way of tooling – IDE support was pretty limited.&#160; So, more waiting.</p>
<p>Then, I ran into the Cloud9 IDE – a web-based IDE for working on node.js apps.&#160; Wonderful stuff, except that you had to pay to get a private workspace.&#160; I was lucky and found the Komodo 7 IDE on the day that the release candidate launched.&#160; It had first class node support, and I could tolerate it as an IDE.&#160; (But just tolerate – it didn’t rub me in any happy place.)&#160; More searching, and I found WebStorm from JetBrains.&#160; First class node support AND an IDE that didn’t look like a reject from 90s *nix days!</p>
<p>Finally, I had most of the cross platform functionality of node (minus some NPMs that require gcc and the like) and an IDE that made it easy.&#160; My first thought was that I’d port <a href="http://findmusicfor.me/">findmusicfor.me</a> over to node, as that was a relatively uncomplicated task.&#160; In fact, to make it beyond easy, I decided that the backend service could stay in Java – I’d expose them via REST, and have node simply invoke the services.&#160; I looked at my webapp and the various tutorials for node, and settled on using Express to build the app.&#160; After a few false starts and screw-ups relating to routing and the like, I did more digging.&#160; Turns out that I should also look into backbone and underscore, and maybe use client-side templating instead of server-side.&#160; After I put my app framework together, I had to stop myself.&#160; As I looked at the code, I saw that everything was exactly the same as what I had been doing in Java, but written in JavaScript.</p>
<p>Instead of Wicket, I was using Express.&#160; Instead of JPA, I was using a node ORM.&#160; I kept using jQuery, and the only difference with backbone was that the code was shared instead of having Wicket perform the mapping automatically.&#160; In fact, I was confused, because things were actually looking less elegant in JS than they were in Java.&#160; After all, Java has been used to build web applications for over a decade, and lots of time and effort has been put into providing clean and functional frameworks.&#160; In fact, if you try, you can create <a href="https://github.com/limone/wicket-spring-boilerplate">a nice Java-based webapp that has no XML configuration</a>.&#160; You can build small horizontally scalable applications using either language.&#160; The only difference?</p>
<p>I’m not entirely sure.</p>
<p>So, until I figure that out, I see no particular reason to switch away from Java.&#160; As long as I keep exploring, I keep learning more, and I don’t assume that Java is “done” – I’ll still be here.&#160; I agree that the language has quirks and having Oracle as the steward terrifies me, but I don’t think we can stick a fork in it.&#160; So, I’ll keep building my apps and testing out new languages and frameworks, until one day I find something compelling enough to switch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laccetti.com/index.php/2012/03/sunday-reflections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Steam Failure Messages</title>
		<link>http://www.laccetti.com/index.php/2012/02/steam-failure-messages/</link>
		<comments>http://www.laccetti.com/index.php/2012/02/steam-failure-messages/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 03:47:03 +0000</pubDate>
		<dc:creator>mlaccetti</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[origin]]></category>
		<category><![CDATA[steam]]></category>
		<category><![CDATA[valve]]></category>

		<guid isPermaLink="false">http://www.laccetti.com/?p=71</guid>
		<description><![CDATA[I’ve been a big proponent of Steam for a very long time – apparently I opened my account in November 2004.&#160; That means that I’ve had an account for over seven years – in internet time, that’s an eternity!&#160; For the most part, I’ve loved it, and had no problems with it.&#160; While others had [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2012%2F02%2Fsteam-failure-messages%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2012%2F02%2Fsteam-failure-messages%2F&amp;source=mlaccetti&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I’ve been a big proponent of <a href="http://steampowered.com">Steam</a> for a very long time – apparently I opened my account in November 2004.&#160; That means that I’ve had an account for over seven years – in internet time, that’s an eternity!&#160; For the most part, I’ve loved it, and had no problems with it.&#160; While others had issues with server timeouts, disconnections, or other gremlins, I kept humming along.&#160; Valve (the folks who own/run Steam) have been good with Steam, growing it at a good pace and adding solid features, all while ensuring that they have sufficient bandwidth available to allow me to download a 15GB game without any issues.</p>
<p>In the last six months, though, I’ve been having some very strange problems with Steam, specifically when trying to give them my money.&#160; I’m a gamer, and given that I make a decent wage, I like to buy games to support the developers – the more money they get, the more likely I’ll get another solid game to play.&#160; To that end, I have well over 300 games I’ve purchased on Steam.&#160; A few months ago, I wanted to snag the new Batman game, as there was a good deal on it.&#160; I logged in to Steam, visited the store page for Batman, added it to my cart, and tried to checkout.&#160; That’s when I ran into a wonderful error message: “There seems to have been an error initializing or updating your transaction. Please wait a minute and try again or contact support for assistance.”</p>
<p>I waited, and tried again.&#160; No love.&#160; I made sure I didn’t have a negative account balance (improbable, since I buy stuff directly, instead of using credits, but hey, gotta be thorough.)&#160; I unlinked the associated credit card, and tried PayPal.&#160; Switched from PayPal to another credit card.&#160; Nothing – I kept getting that wonderful error message – the vaguest and most useless error ever.&#160; I fired up the <a href="http://store.steampowered.com/">steampowered.com</a> website to see if it was related to the game.&#160; Nope, same obnoxious error message.&#160; I bounced over to the support site and promptly faded out – so many things to sift through.&#160; At that point, I just wanted a well displayed 800 number to call and get things fixed, but no, everything has to be automated.</p>
<p>At that point, Valve lost me – I got frustrated and didn’t buy the game.&#160; That’s $60 that somebody lost, all because of a silly error message, and a byzantine support system.&#160; It burned me enough that I didn’t even bother firing up Steam again for a few months, though my current addiction to Battlefield 3 and/or Star Wars – The Old Republic might also have something to do with that.</p>
<p>Today, though, I decided that I’d play <a href="http://choplifterhd.com/">Choplifter HD</a>, and fired up Steam.&#160; I noticed that there was some DLC for it, so put them all in my cart, and clicked on the checkout button.&#160; BAM!&#160; That wonderful error message showed up, and with it, the red fog descended over my vision.&#160; Somewhere, somebody is crying in the corner because they heard my tirade.&#160; I tried the same steps as before – using the Steam client, using the web app, linking and unlinking payment messages, everything.&#160; I searched the magical online realms for some hint, but for all the people who have had the error, nobody has actually come up with any useful way to fix it.&#160; (To all of those people telling me to delete all the content from my Steam directory, how the hell does that fix a web app!?)</p>
<p>In a fit of pique, I went to the checkout page again, and started screwing with the location settings.&#160; You see, while I live in Toronto, I’m currently in Boston, and have been travelling frequently for the last six months.&#160; After I changed the country to the US (from Canada) and threw in MA as the state, it worked.</p>
<p>Let me repeat: changing the country fixed it.</p>
<p>So, it seems that Steam is actually doing some GeoIP stuff on the backend to make sure that the IP matches the country that you have selected.&#160; That’s cool – I can see that they want to keep the fraudulent activities down.&#160; But why in Jupiter’s name can’t they have a specific error message?&#160; Is being purposefully vague and frustrating an actual business decision?&#160; A development failure?&#160; Either way, it has been a pain in my ass, and I would like to light the person who caused that to happen on fire.</p>
<p>On a happier note, I can theoretically buy games from Steam again.&#160; I kind of don’t want to, though.&#160; Maybe I’ll give <a href="http://store.origin.com/">Origin</a> some money instead?&#160; (Nah, their selection of games is kind of limited.)&#160; And with Direct2Drive going away, my options have decreased yet more.&#160; Sigh.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laccetti.com/index.php/2012/02/steam-failure-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Email Addresses</title>
		<link>http://www.laccetti.com/index.php/2012/01/email-addresses/</link>
		<comments>http://www.laccetti.com/index.php/2012/01/email-addresses/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 05:14:00 +0000</pubDate>
		<dc:creator>mlaccetti</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.laccetti.com/?p=68</guid>
		<description><![CDATA[One of the weird things that I’ve come to realize is that people tend to have long email addresses.&#160; Originally, back in the day, you might have been first@company.com – which was relatively easy to remember and tell people.&#160; Of course, the whole internet thing started to catch on, so companies started assigning all of [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2012%2F01%2Femail-addresses%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2012%2F01%2Femail-addresses%2F&amp;source=mlaccetti&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>One of the weird things that I’ve come to realize is that people tend to have long email addresses.&#160; Originally, back in the day, you might have been <a href="mailto:first@company.com">first@company.com</a> – which was relatively easy to remember and tell people.&#160; Of course, the whole internet thing started to catch on, so companies started assigning all of their employees email addresses.&#160; This lead to the comical situation of 38 Michaels all having an e-mail address, which lead to – you guessed it – <a href="mailto:michael38@company.com">michael38@company.com</a>.&#160; This started to look unprofessional, so some corporate wonk decided that it should now be <a href="mailto:&lsquo;first.last@company.com&rsquo;">‘first.last@company.com’</a>.&#160; Name collisions were less likely, but whenever you had to tell somebody your email address, you had to make sure you had some time on your hands.</p>
<p>Support Person (SP): “Okay sir, may I please have your email address?”   <br />Random Guy (RG): “Sure.&#160; It’s <a href="mailto:marcus.aurelius@romanshouseofawesome.com">marcus.aurelius@romanshouseofawesome.com</a>.”    <br />SP: “Sorry sir, I missed that – it’s m..a..r..?”    <br />RG: “Sure – it’s m..a..r..c..u..s..dot..”    <br />SP: “M..a..r..a..”    <br />RG:&quot; “No, M..a..r..c – no ‘a’ after the c”    <br />SP: “Oh, okay.&#160; M..a..r..c..”    <br />RG: “u..s..dot..a..u..”</p>
<p>It continues in this vein for a few minutes, with many back-pedals and random usage of words to describe letters.&#160; “M..a for apple..r..c..u..s for susan…”&#160; Eventually, the email address has hopefully been written down properly, and people can get on to actually trying to get help with whatever was the actual issue.&#160; Of course, this isn’t always the case – I’m always amused when I get a paper record of a transaction or a welcome letter and my email address has been mangled beyond understanding.&#160; It has to be those double Cs and double Ts – doesn’t help that the Italian pronunciation doesn’t really make sense to any non-Italian.</p>
<p>To combat this problem, I decided to procure a short domain and make myself a nice short email.&#160; The io domains are pretty cool (woo geekery), so I procured one – lf.io.&#160; Then, to make my life super easy, I decided that my email address would be <a href="mailto:m@lf.io">m@lf.io</a> – six whole characters.&#160; Even if I had to revert to some crazy NATO-like reading, it’d be easy – “<a href="mailto:mike@lima-foxtrot">mike at lima foxtrot</a> dot india oscar”.</p>
<p>It turns out that there was a problem with this whole premise.&#160; You see, after at least a decade of having to do the whole long email dance, people can’t process a short email address.&#160; It screws with their perception of reality, fragile thing that it is.&#160; Recently, I had to fill out some form, and I was asked for my email address.&#160; This was all done in person, so I got to see things up close and personal.&#160; She filled out my name, address, birth date and the rest, then came to the email address part.&#160; She looked up at me, pen ready.&#160; “M,” I say.&#160; She writes it down, clearly expecting much more.&#160; “@,” I continue.&#160; She paused and looked up at me, a question on her face, asking me if I had forgotten anything.&#160; I just nodded and kept going – “lf dot io.”&#160; She wrote it down and looked at it, then looked back up at me, looking confused and concerned, as if I had given her a fake email address.&#160; “It’s okay – that’s my real email address,” I told her.&#160; A few more seconds of confusion pass, until she decides it is okay.&#160; With that, she burst out into a huge smile and excitedly tells me that I have the shorted email address ever, and how cool is that!</p>
<p>I wonder if I should have used one of my brutally long ones, instead.&#160; I guess I have an experiment for the next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laccetti.com/index.php/2012/01/email-addresses/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HCI in 2020</title>
		<link>http://www.laccetti.com/index.php/2011/12/hci-in-2020/</link>
		<comments>http://www.laccetti.com/index.php/2011/12/hci-in-2020/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 04:52:21 +0000</pubDate>
		<dc:creator>mlaccetti</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2020]]></category>
		<category><![CDATA[hci]]></category>
		<category><![CDATA[studying]]></category>

		<guid isPermaLink="false">http://www.laccetti.com/?p=57</guid>
		<description><![CDATA[I just stumbled across this link (HCI 2020) while doing some research &#8211; curious to see if they&#8217;d update it to address things like Surface, Kinect, Tablets, LTE/WiMax and the like along with the ongoing intensified war between x86 and ARM. If they did update it, what would the difference(s) be?]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F12%2Fhci-in-2020%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F12%2Fhci-in-2020%2F&amp;source=mlaccetti&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I just stumbled across this link (<a href="http://research.microsoft.com/en-us/um/cambridge/projects/hci2020/downloads/beinghuman_a4.pdf" title="HCI 2020">HCI 2020</a>) while doing some research &#8211; curious to see if they&#8217;d update it to address things like Surface, Kinect, Tablets, LTE/WiMax and the like along with the ongoing intensified war between x86 and ARM.  If they did update it, what would the difference(s) be?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laccetti.com/index.php/2011/12/hci-in-2020/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon Kindle for Android Usability Issue</title>
		<link>http://www.laccetti.com/index.php/2011/11/amazon-kindle-for-android-usability-issue/</link>
		<comments>http://www.laccetti.com/index.php/2011/11/amazon-kindle-for-android-usability-issue/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 14:44:51 +0000</pubDate>
		<dc:creator>mlaccetti</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[kindle]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.laccetti.com/index.php/2011/11/amazon-kindle-for-android-usability-issue/</guid>
		<description><![CDATA[This is such a small feature, and yet would be so invaluable – the ability to sort the Archive page by purchase date.&#160; Currently, when I buy a book from the Amazon website, I have to remember the artist or title, then search the archive for it.&#160; It’d be much nicer if I could hit [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F11%2Famazon-kindle-for-android-usability-issue%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F11%2Famazon-kindle-for-android-usability-issue%2F&amp;source=mlaccetti&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This is such a small feature, and yet would be so invaluable – the ability to sort the Archive page by purchase date.&#160; Currently, when I buy a book from the Amazon website, I have to remember the artist or title, then search the archive for it.&#160; It’d be much nicer if I could hit up the archive page and simply sort by purchase date, and then select the item that I just bought.&#160; I’m kind of baffled how this has been overlooked.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laccetti.com/index.php/2011/11/amazon-kindle-for-android-usability-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Car Reviews &#8211; Chevrolet Malibu</title>
		<link>http://www.laccetti.com/index.php/2011/10/simple-car-reviews-chevrolet-malibu/</link>
		<comments>http://www.laccetti.com/index.php/2011/10/simple-car-reviews-chevrolet-malibu/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 20:43:19 +0000</pubDate>
		<dc:creator>mlaccetti</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[vehicles]]></category>
		<category><![CDATA[chevrolet]]></category>
		<category><![CDATA[collision]]></category>
		<category><![CDATA[malibu]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[vehicle]]></category>

		<guid isPermaLink="false">http://www.laccetti.com/?p=55</guid>
		<description><![CDATA[As part of my ongoing saga with having a cab decide to try to merge into my car, I&#8217;ve had to hand over my car to the body shop for roughly two weeks. In that time, my insurance has graciously (due to me paying, of course) provided me with a rental car. The rep offered [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F10%2Fsimple-car-reviews-chevrolet-malibu%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F10%2Fsimple-car-reviews-chevrolet-malibu%2F&amp;source=mlaccetti&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>As part of my ongoing saga with having a cab decide to try to merge into my car, I&#8217;ve had to hand over my car to the body shop for roughly two weeks.  In that time, my insurance has graciously (due to me paying, of course) provided me with a rental car.  The rep offered me a Mitsubishi Lancer, which I was very excited by &#8211; I&#8217;ve always wanted to drive one, and this was my chance!  But lo, my hopes were dashed, when a few moments later the rep told me that the Lancer was actually out.  I was then presented with a few different options &#8211; a Nissan Sentra, the Ford Focus, and a Chevrolet Malibu.</p>
<p>Originally, I was leaning towards the Focus &#8211; it&#8217;s a decent little car, and in the right model, very peppy.  This being a rental company, I figured it&#8217;d be the bare minimum &#8211; four wheels and, if I was lucky, a motor.  (If I wasn&#8217;t, picture Fred Flinstone&#8217;s feet.)  Based on that, I decided I&#8217;d try the Malibu &#8211; a large-ish, generic American car.  I knew it&#8217;d have a big engine that did nothing but suck gas, and wouldn&#8217;t so much corner as wallow around a bend.  However, I also knew that it&#8217;d have the interior space of a drawing room, and that I&#8217;d probably feel lost in the car.</p>
<p>Well, the first two predictions came true.  The last, not so much!  Turns out that the room in the car is taken up by the engine and trunk &#8211; the middle portion is probably 1/4 of the car!  (No, not quite that bad, but still a pronounced smallness to it.)  The front seat only moves back so far, and until the rep found the button to make the seat go down, I was pretty much part of the steering wheel.  If I tried to take a corner, I&#8217;d be bruising my thighs with my ham hands.  While the steering wheel does telescope and move up, it doesn&#8217;t come out very far, and sure doesn&#8217;t go up very much.  The designers also thought that they should take the steering wheel from a bus &#8211; that thing is MASSIVE.</p>
<p>To top it all off, I&#8217;ve gotten so used to having a gas pedal that requires pressure that the vapid feedback I get from the accelerator drives me bonkers, and gave me a cramp from having to keep things &#8220;just so.&#8221;</p>
<p>TL;DR (you&#8217;d better have gotten this far) &#8211; it wallows, it wheezes, and it has the interior room for a family of mutant dwarf pigs.  Steer clear!</p>
<p><strong>Addendum</strong><br />
Things I&#8217;ve noticed in the last day while driving this behemoth:<br />
1) Every time you hit a pothole, a crack in the pavement, or some other protrusion marring the perfectly flat surface of the road that the Malibu expects, the steering wheel bucks like an enraged steer trying to break loose.  This causes some serious consternation.<br />
2) On the flip side, the steering wheel has a good 10-15 degrees of play before it notices that you&#8217;re attempting to turn.  Seriously &#8211; I feel like a bus driver.<br />
3) A bus is a good comparison, especially when it comes to turning radii.  I&#8217;d need an empty six lane highway to get this thing to do a 360.  Parking in Toronto requires a nine point turn.<br />
4) The person (or committee) that decided that the turn signal had to have the loudest, most horrible clacking noise should be summarily executed.  I spend a lot of my time waiting to turn trying to decide what weight sledgehammer I want to introduce to the dashboard.</p>
<p>Hopefully I have found the full extent of the nightmare that is this car.  Any more surprises would be very unwelcome.  Can&#8217;t wait to have my car back!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laccetti.com/index.php/2011/10/simple-car-reviews-chevrolet-malibu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cloud Choices</title>
		<link>http://www.laccetti.com/index.php/2011/06/cloud-choices/</link>
		<comments>http://www.laccetti.com/index.php/2011/06/cloud-choices/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 20:34:26 +0000</pubDate>
		<dc:creator>mlaccetti</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.laccetti.com/index.php/2011/06/cloud-choices/</guid>
		<description><![CDATA[My UPS nightmare is over, and the servers have arrived.&#160; My living room table now has some 1U servers in it, and my closet has the 2U servers.&#160; With the hardware taken care of, now it comes down to the fun part – software.&#160; Do I use OpenStack, OpenNebula, or Eucalyptus?&#160; Help!]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F06%2Fcloud-choices%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F06%2Fcloud-choices%2F&amp;source=mlaccetti&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>My UPS nightmare is over, and the servers have arrived.&#160; My living room table now has some 1U servers in it, and my closet has the 2U servers.&#160; With the hardware taken care of, now it comes down to the fun part – software.&#160; Do I use OpenStack, OpenNebula, or Eucalyptus?&#160; Help!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laccetti.com/index.php/2011/06/cloud-choices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adventures in Waiting</title>
		<link>http://www.laccetti.com/index.php/2011/06/adventures-in-waiting/</link>
		<comments>http://www.laccetti.com/index.php/2011/06/adventures-in-waiting/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 23:37:58 +0000</pubDate>
		<dc:creator>mlaccetti</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[delivery]]></category>
		<category><![CDATA[insanity]]></category>

		<guid isPermaLink="false">http://www.laccetti.com/index.php/2011/06/adventures-in-waiting/</guid>
		<description><![CDATA[I want to setup a little cloud at a local colo – while I won’t have the same amount of bandwidth as I do using dedicated servers down in the US, I’ll have better hardware, and I won’t have to pay outrageous sums of money for crappy hardware.&#160; To this end, I went to eBay [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F06%2Fadventures-in-waiting%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F06%2Fadventures-in-waiting%2F&amp;source=mlaccetti&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I want to setup a little cloud at a local colo – while I won’t have the same amount of bandwidth as I do using dedicated servers down in the US, I’ll have better hardware, and I won’t have to pay outrageous sums of money for crappy hardware.&#160; To this end, I went to eBay and snagged a few 1U servers; coupled with the existing hardware I have, I can have a pretty decent little setup.&#160; Everything went smoothly – I paid for the servers and the seller set the shipment up using UPS.&#160; I got my tracking number, and then the fun began.</p>
<p>You see, I am enthusiastic about tracking my package – overzealous, even.&#160; I memorize that stupid UPS tracking URL and visit every two seconds, hoping that something will have changed.&#160; When it does change, I get happier, as it means my package will be getting closer to me.&#160; On Friday evening, I was super excited, because the package had arrived at the local depot, which meant that the package would be on a truck on Monday (today) morning.</p>
<p>First thing this morning, back to the website, and there it is – “Out for Delivery” as of 7:07am!&#160; Of course, I then realize the downside – I’m basically going to be sitting around in a panic all day long, hearing phantom doorbells, rushing to the terrace to look over the railing to see if the delivery person was there.&#160; Bathroom break?&#160; Push!&#160; Food?&#160; Inhale it!&#160; No food in the house?&#160; What’s the closest (healthy) place?&#160; The end result is that I have the longest, slowest day ever – where is my package!?</p>
<p>Finally, at around 6:15, I couldn’t take it anymore and started walking around the block in an attempt to burn off some nervous energy.&#160; As I’m doing this, I see the UPS van pull up!&#160; I’m all excited, and get ready to wander over, when I see the driver grab a (small) package and head over to drop it off.&#160; I tell myself to relax, and go hang out in front of my place, so I will stop scaring the neighbourhood kids.&#160; I hear the van start up, and start cruising around the crescent – I tell myself that he’s trying to find my unit.</p>
<p>Note to everybody: the block of townhouses I live in is beyond poorly marked – the signs are at the sides, not the front, and they are put so high up that you cannot see them from a vehicle.&#160; When I first came to see the unit, I wandered around lost for roughly 20 minutes before I finally found it.&#160; If anybody had moved in, I would have asked them, but the development was a ghost town.</p>
<p>Back to the UPS van – he’s driving around the crescent, passes my block.&#160; Keeps going.&#160; Accelerates.&#160; Gets back to the “main” road, and stops.&#160; I hear him get out – I’ve got ears that would rival those of an owl, when it comes to deliveries!&#160; A few minutes pass, and I don’t see him walking around, looking for the unit.&#160; Then, horror of horrors, the engine fires, and the van zooms off.&#160; I don’t have a package, and I’ve wasted nearly twelve hours in a panicky state.</p>
<p>I venture online and check to see if the tracking information has updated.&#160; Why, yes, it has!&#160; “First Attempt Made” – “The driver was unable to collect funds on the 1st delivery attempt.”&#160; I go from panicking that I’d miss the driver to wanting to immolate him with my mind!&#160; I was right here!&#160; I was sitting right out from of my damn house when you were here!&#160; You went to the unit on Foundry, didn’t you!&#160; If I walked over to that unit, I’m pretty sure there is a notice on their door, or that he had spoken to them asking for the $200 in “duties and fees” that my $900 package had slapped on it and the person at the door choked.&#160; (Can’t wait to argue about the fees, too!)</p>
<p>With my anger tap wide open and spewing venom, I call UPS’ 800 number.&#160; I breathe and tell myself to be calm, that the agent who calls isn’t the person who screwed up, and doesn’t need to put up with an irate person.&#160; Calmly, I explain that there seems to have been some mix up, and could they send the driver back?&#160; “I’m pretty sure that they went to the right unit, but on the wrong road!”&#160; The agent proves to be less than useful, and says that she can send a message to the centre and that they’ll arrange for delivery tomorrow.</p>
<p>Seriously?&#160; I get to do this whole thing again tomorrow?&#160; I’m not sure my heart can take it.&#160; Or if the driver will have both arms.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laccetti.com/index.php/2011/06/adventures-in-waiting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get the Move On!</title>
		<link>http://www.laccetti.com/index.php/2011/04/get-the-move-on/</link>
		<comments>http://www.laccetti.com/index.php/2011/04/get-the-move-on/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 20:00:59 +0000</pubDate>
		<dc:creator>mlaccetti</dc:creator>
				<category><![CDATA[home]]></category>
		<category><![CDATA[moving]]></category>
		<category><![CDATA[packing]]></category>

		<guid isPermaLink="false">http://www.laccetti.com/index.php/2011/04/get-the-move-on/</guid>
		<description><![CDATA[Okay, so I&#8217;m not moving just yet, but I did want to replace the table that collects the contents of my pockets. Here we have the before and after shots &#8211; kitty not included. Update! Here’s the replacement mostly put together:]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F04%2Fget-the-move-on%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.laccetti.com%2Findex.php%2F2011%2F04%2Fget-the-move-on%2F&amp;source=mlaccetti&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img style="margin: 0px 10px 0px 0px; float: left" alt="pic" src="http://laccetti.com/wp-content/uploads/2011/04/wpid-IMG_20110402_150038.jpg" width="180" height="240" /><img style="margin: 0px 10px 0px 0px; float: left" alt="pic" src="http://laccetti.com/wp-content/uploads/2011/04/wpid-IMG_20110402_155437.jpg" width="180" height="240" /> <img style="float: left" alt="pic" src="http://laccetti.com/wp-content/uploads/2011/04/wpid-IMG_20110402_155447.jpg" width="180" height="240" /> </p>
<p style="margin-top: 10px; clear: both">Okay, so I&#8217;m not moving just yet, but I did want to replace the table that collects the contents of my pockets. Here we have the before and after shots &#8211; kitty not included.</p>
<p><strong>Update!</strong></p>
<p>Here’s the replacement mostly put together:   <br /><a href="http://laccetti.com/wp-content/uploads/2011/04/5583891212_0ff8799f42_o.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="5583891212_0ff8799f42_o" border="0" alt="5583891212_0ff8799f42_o" src="http://laccetti.com/wp-content/uploads/2011/04/5583891212_0ff8799f42_o_thumb.jpg" width="260" height="180" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.laccetti.com/index.php/2011/04/get-the-move-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

