<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Matthias Wessendorf&#039;s Weblog</title>
	<atom:link href="http://matthiaswessendorf.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthiaswessendorf.wordpress.com</link>
	<description>A blog on JSF, Ajax, Web 2.0 and other (interesting) things</description>
	<lastBuildDate>Thu, 12 Jan 2012 11:10:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='matthiaswessendorf.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Matthias Wessendorf&#039;s Weblog</title>
		<link>http://matthiaswessendorf.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://matthiaswessendorf.wordpress.com/osd.xml" title="Matthias Wessendorf&#039;s Weblog" />
	<atom:link rel='hub' href='http://matthiaswessendorf.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Disabling the ARC in Xcode 4.2</title>
		<link>http://matthiaswessendorf.wordpress.com/2011/09/12/disabling-the-arc-in-xcode-4-2/</link>
		<comments>http://matthiaswessendorf.wordpress.com/2011/09/12/disabling-the-arc-in-xcode-4-2/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 08:35:37 +0000</pubDate>
		<dc:creator>matthiaswessendorf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matthiaswessendorf.wordpress.com/?p=502</guid>
		<description><![CDATA[With Xcode 4.2 (iOS 5) Apple introduce ARC (Automatic Reference Counting) to help with memory management. Basically you no longer need to call retain or release. However current examples/books (and (open source) libraries) are still doing it. This leads to (annoying) errors like: ARC forbids explicit message send of &#8216;retain&#8217; To get rid of this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=502&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With Xcode 4.2 (iOS 5) Apple introduce ARC (Automatic Reference Counting) to help with memory management. Basically you no longer need to call <em>retain</em> or <em>release</em>. However current examples/books (and (open source) libraries) are still doing it. This leads to (annoying) errors like:</p>
<p><strong>ARC forbids explicit message send of &#8216;retain&#8217;</strong></p>
<p>To get rid of this error you need to disable ARC, but how? I found this <a href="http://www.leesilver.net/1/post/2011/8/disabling-arc-on-certain-files-in-xcode.html">link</a> which show how to disable it for cetain source files, but I wanted this to be a global setting.</p>
<p>My Kaazing colleague <a href="http://twitter.com/#!/rdclark">Richard Clark</a> told me how to turn off ARC at the project level. Here is what you need to do in Xcode:</p>
<ol>
<li>Select your project file.</li>
<li>You should be in the &#8220;Build settings&#8221; tab. Select the &#8220;levels&#8221; option (default is &#8220;Combined&#8221;)</li>
<li>There&#8217;s a search field to the right of &#8220;Combined&#8221;. Enter &#8220;Automatic&#8221;</li>
<li>Second group should be &#8220;Apple LLVM Compiler 3.0 &#8211; Language&#8221;. Second line under that controls ARC.</li>
<li>Click that line, then in the middle column (where it says &#8220;yes&#8221;), click and choose &#8220;no&#8221;.</li>
</ol>
<div>Now the error is gone. Great!</div>
<div>Thanks Richard <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthiaswessendorf.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthiaswessendorf.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthiaswessendorf.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthiaswessendorf.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matthiaswessendorf.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matthiaswessendorf.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matthiaswessendorf.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matthiaswessendorf.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthiaswessendorf.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthiaswessendorf.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthiaswessendorf.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthiaswessendorf.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthiaswessendorf.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthiaswessendorf.wordpress.com/502/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=502&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matthiaswessendorf.wordpress.com/2011/09/12/disabling-the-arc-in-xcode-4-2/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/92d27b816c7652e7bad5ecbfa76705a7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matze</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting started with Objective C</title>
		<link>http://matthiaswessendorf.wordpress.com/2011/09/09/getting-started-with-objective-c/</link>
		<comments>http://matthiaswessendorf.wordpress.com/2011/09/09/getting-started-with-objective-c/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 14:14:13 +0000</pubDate>
		<dc:creator>matthiaswessendorf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matthiaswessendorf.wordpress.com/?p=487</guid>
		<description><![CDATA[In order to do i{Phone&#124;Pod&#124;Pad} or Mac development you need to learn Objective-C, which is basically adding some object-orientation to the C language. The last 2.5 days I spent some time in learning about Objective C. I used Xcode (an IDE for the Mac) and also a pretty straightforward (or minimalistic) enviroment: text editor compiler [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=487&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In order to do i{Phone|Pod|Pad} or Mac development you need to learn Objective-C, which is basically adding some object-orientation to the C language.</p>
<p>The last 2.5 days I spent some time in learning about Objective C. I used Xcode (an IDE for the Mac) and also a pretty straightforward (or minimalistic) enviroment:</p>
<ul>
<li>text editor</li>
<li>compiler</li>
</ul>
<p>All you really need for coding some Objective-C is a text-editor and a compiler. On my Mac I used <em>TextMate</em> and the <em>gcc</em> compiler. Sure, with Xcode iOS/Objective-C development is nicer, but a with a text editor and a compiler you get something in a short amount of time as well. (Note: Xcode is only available for Mac OS)</p>
<p>Using the <em>gcc</em> compiler I noticed a few issues, when actually compiling the bits, since I was never doing any C/C++ development before. The main reason for writing this blog is giving a quick introduction that also includes the required <em>gcc</em> commands&#8230;. &#8211; as there are already a lot of &#8220;Hello World&#8221;-ish blogs.<br />
For professional iOS development I do recommend using Xcode, but let&#8217;s get started&#8230;</p>
<p>The canonical &#8220;Hello World&#8221; is simple and looks like:</p>
<p><pre class="brush: cpp;">
#import &lt;Foundation/Foundation.h&gt;

int main(void) {
	NSLog(@&quot;Hello Objective-C&quot;);

	return 0;
}
</pre></p>
<p>The <em>NSLog()</em> function requires a <em>NSString</em> object. The String starts with an @, this identifies the string as a <em>NSString</em> object&#8230; Save the above as <strong>hello.m</strong> and compile it:</p>
<p><pre class="brush: cpp;">
gcc hello.m -o prog -framework Foundation
</pre></p>
<p>It is important to specify that you are using the Foundation classes (<em>-framework Froundation</em>)&#8230;<br />
Now you can invoke your first program:</p>
<p><pre class="brush: cpp;">
./prog
</pre></p>
<p>Now let&#8217;s take a look at a simple class. For that we need two files: a header file and it&#8217;s implementation (or method) file. Let&#8217;s take a look at the <strong>MyPerson.h</strong> file:</p>
<p><pre class="brush: cpp;">
#import &lt;Foundation/Foundation.h&gt;

@interface MyPerson : NSObject {
}

// getter and setter
@property (nonatomic, copy) NSString* firstName;
@property (nonatomic, copy) NSString* secondName;

// should print the complete name
- (void) printDetails;

@end
</pre></p>
<p>The <em>MyPerson</em> class extends the <em>NSObject</em> class and it defines a few setter/getter, by using Objective-C&#8217;s property syntax. I also has another method to print out the name of an instance of this class. The <strong>MyPerson.m</strong> file looks like:</p>
<p><pre class="brush: cpp;">
// usage of our header file
#import &quot;MyPerson.h&quot;

@implementation MyPerson

// getter/setter
@synthesize firstName = firstName_ ;
@synthesize secondName = secondName_ ;

// the actual method
- (void) printDetails {

    // write out the name, in a formated way:
    NSLog(@&quot;%@, %@&quot;, self.secondName, self.firstName);
}

@end
</pre></p>
<p>In here we basically implement the defined methods, like the getter/setter or the printDetails.</p>
<p>Now we want to use the MyPerson class, which is done in the <strong>main.m</strong> file:</p>
<p><pre class="brush: cpp;">
#import &lt;Foundation/Foundation.h&gt;
#import &quot;MyPerson.h&quot;

int main(void) {
	// memory mgmt class
	NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];

    // autorelease to avoid leaks
    MyPerson* matze = [[[MyPerson alloc] init]autorelease];

    matze.firstName =  @&quot;Matthias&quot;;
    matze.secondName = @&quot;Wessendorf&quot;;

    [matze printDetails];

    // free the memory
	[pool release];
	return 0;
}
</pre></p>
<p>The <strong>main.m</strong> file imports our MyPerson class and its main() function creates an object of the class and sets values to the instance by using the two setter functions. Afterwards the printDetails is called to print the first and second name to the console. It also uses the NSAutoreleasePool class, for some memory management&#8230; The compilation is done with the following command:</p>
<p><pre class="brush: cpp;">
gcc main.m MyPerson.m -o prog2 -framework Foundation
</pre></p>
<p>You can now invoke the prog2!</p>
<p>Thanks to <a href="http://www.yourdailygeekery.com/">Torsten Curdt</a>! He was around when I had some newbie questions. Thanks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthiaswessendorf.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthiaswessendorf.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthiaswessendorf.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthiaswessendorf.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matthiaswessendorf.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matthiaswessendorf.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matthiaswessendorf.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matthiaswessendorf.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthiaswessendorf.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthiaswessendorf.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthiaswessendorf.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthiaswessendorf.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthiaswessendorf.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthiaswessendorf.wordpress.com/487/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=487&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matthiaswessendorf.wordpress.com/2011/09/09/getting-started-with-objective-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/92d27b816c7652e7bad5ecbfa76705a7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matze</media:title>
		</media:content>
	</item>
		<item>
		<title>WebSocket: Bringing TCP to the browser</title>
		<link>http://matthiaswessendorf.wordpress.com/2011/07/18/websocket-bringing-tcp-to-the-browser/</link>
		<comments>http://matthiaswessendorf.wordpress.com/2011/07/18/websocket-bringing-tcp-to-the-browser/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 00:29:31 +0000</pubDate>
		<dc:creator>matthiaswessendorf</dc:creator>
				<category><![CDATA[amqp]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[kaazing]]></category>
		<category><![CDATA[lifestyle]]></category>
		<category><![CDATA[websocket]]></category>

		<guid isPermaLink="false">http://matthiaswessendorf.wordpress.com/?p=482</guid>
		<description><![CDATA[The WebSocket standard is almost finalized. However, WebSocket itself is offering &#8220;just&#8221; a (data) pipe. WebSocket is well suited to bring event- or data-driven applications to the browser. A valid example would a Web UI for a JMS or AMQP application. With help of the Kaazing Gateway this is possible! As said before, you are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=482&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol">WebSocket standard</a> is almost finalized. However, WebSocket itself is offering &#8220;just&#8221; a (data) pipe. WebSocket is well suited to bring event- or data-driven applications to the browser. A valid example would a Web UI for a <a href="http://matthiaswessendorf.wordpress.com/2011/04/19/jms-ove-websocket/">JMS</a> or AMQP application. With help of the <a href="http://kaazing.com/download.html">Kaazing Gateway</a> this is possible! As said before, you are basically able to bring any <a href="http://matthiaswessendorf.wordpress.com/2011/03/21/extending-tcp-udp-to-the-browser/">TCP- or UDP-based application</a> to the web.<br />
<strong></strong></p>
<p><strong>A simple TCP-based echo server</strong></p>
<p><strong></strong>Since the WebSocket client API itself is not enough (to build a &#8220;real&#8221; application), we need some (existing) backend, or server. A very simple example would be to bring a (TCP) echo server to the browser, via WebSocket:</p>
<p><pre class="brush: jscript;">
var net = require('net');

var server = net.createServer(function (socket) {
  socket.write(&quot;Echo server\r\n&quot;);
  socket.pipe(socket);
});

server.listen(1337, &quot;127.0.0.1&quot;);
</pre></p>
<p>The above code is a VERY simple &#8220;EchoServer&#8221; that runs on port &#8220;1337&#8243;. It is in <a href="http://nodejs.org/">Node.js</a>. The code is borrowed from their website.<br />
<strong></strong></p>
<p><strong>Bring it to the Web</strong></p>
<p><strong></strong>To be able to access this TCP server with a WebSocket application you need to add the following configuration to the Kaazing WebSocket Gateway:</p>
<p><pre class="brush: xml;">
&lt;service&gt;
  &lt;accept&gt;ws://localhost:8000/echo&lt;/accept&gt;
  &lt;connect&gt;tcp://localhost:1337/&lt;/connect&gt;
  &lt;type&gt;proxy&lt;/type&gt;
  &lt;cross-site-constraint&gt;
    &lt;allow-origin&gt;*&lt;/allow-origin&gt;
  &lt;/cross-site-constraint&gt;
&lt;/service&gt;
</pre></p>
<p>The entry point for the echo server is the <em><strong>ws://localhost:8000/echo</strong></em>URL. The Gateway connects the WebSocket connection to the backend (check the tcp port). The connection to the echo server is straightforward. The following shows a pretty simple JavaScript program, that opens a WebSocket connection in order to send and receive data from the underlying TCP server:</p>
<p><pre class="brush: jscript;">
var websocketConnection = new WebSocket(&quot;ws://localhost:8000/echo&quot;);
websocketConnection.onopen = function(ev) {
	console.log('Connected to the echo service')
};
websocketConnection.onmessage = function(event) {
  var payload = event.data;
  displayEcho(payload);
};
...
websocketConnection.send(&quot;Hello Echo Server&quot;);
...
</pre></p>
<p>This is obviously a simple example, but it clearly shows the power of WebSocket! Give it a try!</p>
<p>If you are interested in HTML5 and WebSocket, check out the Kaazing Gateway! BTW. <a href="http://kaazing.com/about/careers">Kaazing is hiring</a>&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthiaswessendorf.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthiaswessendorf.wordpress.com/482/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthiaswessendorf.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthiaswessendorf.wordpress.com/482/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matthiaswessendorf.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matthiaswessendorf.wordpress.com/482/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matthiaswessendorf.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matthiaswessendorf.wordpress.com/482/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthiaswessendorf.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthiaswessendorf.wordpress.com/482/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthiaswessendorf.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthiaswessendorf.wordpress.com/482/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthiaswessendorf.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthiaswessendorf.wordpress.com/482/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=482&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matthiaswessendorf.wordpress.com/2011/07/18/websocket-bringing-tcp-to-the-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/92d27b816c7652e7bad5ecbfa76705a7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matze</media:title>
		</media:content>
	</item>
		<item>
		<title>Bringing Stomp/JMS to the browser &#8211; via WebSocket</title>
		<link>http://matthiaswessendorf.wordpress.com/2011/04/19/jms-ove-websocket/</link>
		<comments>http://matthiaswessendorf.wordpress.com/2011/04/19/jms-ove-websocket/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 13:48:17 +0000</pubDate>
		<dc:creator>matthiaswessendorf</dc:creator>
				<category><![CDATA[amqp]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jms]]></category>
		<category><![CDATA[kaazing]]></category>
		<category><![CDATA[stomp]]></category>
		<category><![CDATA[websocket]]></category>

		<guid isPermaLink="false">http://matthiaswessendorf.wordpress.com/?p=467</guid>
		<description><![CDATA[Last week I attended the Con-Fess conference in Vienna to speak about WebSocket (and its JSF integration). The first demo described how to bring UDP-based network traffic to the browser. Another demo from my presentation showed how to bring JMS to the browser, by using WebSocket. You can try this out as well &#8211; The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=467&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week I attended the <a href="http://con-fess.com/">Con-Fess conference</a> in Vienna to speak about WebSocket (and its JSF integration). The first demo described how to bring <a href="http://matthiaswessendorf.wordpress.com/2011/03/21/extending-tcp-udp-to-the-browser/">UDP-based network traffic to the browser</a>. Another demo from my presentation showed how to bring JMS to the browser, by using <strong>WebSocket</strong>.</p>
<p>You can try this out as well &#8211; The steps are quite simple:</p>
<ul>
<li>Download the <a href="http://kaazing.com/download.html">JMS Edition</a> of the Kaazing gateway and extract it</li>
<li>Start the included <a href="http://activemq.apache.org/">Apache ActiveMQ</a> server</li>
<li>Start the gateway itself</li>
<li>Start the demo stock ticker feed</li>
</ul>
<div>The Java program behind the &#8220;stock.start&#8221; script is a simple class, which uses the standard JMS API to send messages (stock prices) to the running Apache ActiveMQ. We now need a browser-based JavaScript client, which talks to the Apache ActiveMQ over WebSocket.</div>
<div>The Kaazing Gateway (JMS edition) comes with a JMS API for various platforms, like JavaScript or Flash/ActionScript. If you have ever programmed something that used JMS, you are able to use it!</div>
<div>Let&#8217;s have a look how to setup a connection to the JMS server:</div>
<div><pre class="brush: jscript;">
...
var stompConnectionFactory =
        new StompConnectionFactory( &quot;ws://localhost:8000/jms&quot;);

// create a connection, by using a JS callback
var connectionFuture =
   stompConnectionFactory.createConnection(user, passwd, function () {

    if (!connectionFuture.exception) {
        connection = connectionFuture.getValue();
        // register a JMS exception handler
        connection.setExceptionListener(handleException);

        // create session
        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        // create a topic
        topic = session.createTopic(&quot;/topic/destination&quot;);

        // creating some consumers!
        var consumer1 = session.createConsumer(topic);

        // attach the callback that receives the stock prices:
        consumer1.setMessageListener(handleMessageCallback);

        // start!
        connection.start(someCallback);
    }
....
});
</pre></p>
</div>
<div><span class="Apple-style-span" style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:13px;line-height:19px;white-space:normal;">The code is straightforward: A (Stomp)ConnectionFactory is created and we use that factory object to create the actual connection. The <strong><em>createConnection()</em></strong> function takes three arguments: user, password and a callback, which is invoked once the connection has been established (or an exception is thrown). If no exception occurred, the code executes a few steps:</span></div>
<div>
<ul>
<li>we receive the actual connection</li>
<li>we setup a JMS exception handler</li>
<li>we create a session, a JMS topic and a consumer</li>
<li>we register a handler for the incoming JMS messages (<em><strong>handleMessageCallback</strong></em>)</li>
<li>we finally start the connection&#8217;s delivery of incoming messages</li>
</ul>
<div>The <em><strong>handleMessageCallback()</strong></em> is used to receive the stock prices and to &#8220;draw&#8221; the DTHML, so that the stock changes are nice to watch in a vanilla HTML table, like below:</div>
<div><a href="http://matthiaswessendorf.files.wordpress.com/2011/04/stockticker.png"><img class="aligncenter size-full wp-image-471" title="stockTicker" src="http://matthiaswessendorf.files.wordpress.com/2011/04/stockticker.png?w=630&#038;h=215" alt="" width="630" height="215" /></a></div>
<div>The code for the message listener is also using our JavaScript JMS API, to receive JMS (Text)messages:</div>
<div><pre class="brush: jscript;">
function handleMessageCallack(message) {

  // did Apache ActiveMQ send us a JMS TextMessage?

  if (message instanceof TextMessage) {
     var body = message.getText();

     // DHTML code to show stock values...

  }
}
</pre></p>
<p>The above JavaScript code is pretty much readable for every JMS coder. The big news is that the JMS communication from the ActiveMQ to the browser (and vice versa) happens over WebSocket. This dramatically reduces overhead and latency for your web application!</p>
<p>The WebSocket gateway is not limited to Stomp/JMS, it has support for other protocols like AMQP, or even XMPP as well!</p>
<p>If you want to try (or see) this stock ticker, you can! It is part of the Kaazing JMS demo bundle. Once you installed the gateway, you can see the stockticker on <em><strong><a href="http://localhost:8000/demo/jms/javascript/?d=stomp-stock">your machine</a></strong></em>&#8230;</p>
<p>Have fun!</p>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthiaswessendorf.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthiaswessendorf.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthiaswessendorf.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthiaswessendorf.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matthiaswessendorf.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matthiaswessendorf.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matthiaswessendorf.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matthiaswessendorf.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthiaswessendorf.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthiaswessendorf.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthiaswessendorf.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthiaswessendorf.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthiaswessendorf.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthiaswessendorf.wordpress.com/467/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=467&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matthiaswessendorf.wordpress.com/2011/04/19/jms-ove-websocket/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/92d27b816c7652e7bad5ecbfa76705a7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matze</media:title>
		</media:content>

		<media:content url="http://matthiaswessendorf.files.wordpress.com/2011/04/stockticker.png" medium="image">
			<media:title type="html">stockTicker</media:title>
		</media:content>
	</item>
		<item>
		<title>Extending TCP/UDP-based protocols to the browser by using WebSocket</title>
		<link>http://matthiaswessendorf.wordpress.com/2011/03/21/extending-tcp-udp-to-the-browser/</link>
		<comments>http://matthiaswessendorf.wordpress.com/2011/03/21/extending-tcp-udp-to-the-browser/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 14:26:35 +0000</pubDate>
		<dc:creator>matthiaswessendorf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matthiaswessendorf.wordpress.com/?p=458</guid>
		<description><![CDATA[WebSocket is a bi-directional AND full-duplex communication STANDARD to build next generations web applications. The WebSocket Protocol and its client APIs are getting more and more to their final state. You could say it is &#8220;TCP for the web&#8221;. However WebSocket is NOT: just a better Ajax or XHR, nor was it designed to be! designed to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=458&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>WebSocket is a bi-directional <em><strong>AND</strong></em> full-duplex communication <strong>STANDARD</strong> to build next generations web applications. The WebSocket <a href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol">Protocol</a> and its client <a href="http://dev.w3.org/html5/websockets/">APIs</a> are getting more and more to their final state. You could say it is &#8220;TCP for the web&#8221;.</p>
<p>However WebSocket is NOT:</p>
<ul>
<li>just a better Ajax or XHR, nor was it designed to be!</li>
<li>designed to be a one-size-fits-all replacement for HTTP!</li>
</ul>
<p>When you build typical client-server applications you are using higher level protocols and APIs, such as XMPP, JMS or JDBC instead of raw TCP socket. You should think of WebSocket the same way! Instead of exchanging raw WebSocket data between the browser and the server (and introducing your own &#8220;protocol&#8221;), but you should use WebSocket to run these high level protocols on top of it! In fact the <a href="http://kaazing.com/download.html">Kaazing WebSocket Gateway</a> allows you to do this!</p>
<p>Here is an example that shows how to extend a (NodeJS-based) UDP program to the browser, by using the Kaazing WebSocket gateway.</p>
<p><strong>Getting ready with NodeJS and the Kaazing gateway</strong></p>
<ol>
<li>Download the <a href="http://kaazing.com/download.html">Kaazing WebSocket Gateway</a> (HTML5 Edition)</li>
<li>Download and install <a href="http://nodejs.org/">NodeJS</a> (only needed for this demo&#8230;)</li>
</ol>
<p>The installation of the Kaazing WebSocket Gateway is quite esay: Unzip the archive and launch the <em>gateway.start</em> command in <em>$KAAZING_HOME/bin</em>. That&#8217;s it.</p>
<p>Now we can write pretty simple and straightforward UDP program, in Node:</p>
<p><pre class="brush: jscript;">
var Buffer = require('buffer').Buffer;
var dgram = require('dgram');
// create the datagram socket
var sock = dgram.createSocket(&quot;udp4&quot;);
// some bogus news...
var news = [
   &quot;Borussia Dortmund wins German championship&quot;,
   &quot;Tornado warning for the Bay Area&quot;,
   &quot;More rain for the weekend&quot;,
   &quot;Android tablets take over the world&quot;,
   &quot;iPad2 sold out&quot;,
   &quot;Nation's rappers down to last two samples&quot;
];
function broadcastNew() {
   var buf = new Buffer(news[Math.floor(Math.random()*news.length)]);
   sock.send(buf, 0, buf.length, 55555, &quot;127.0.0.1&quot;);
   console.log(&quot;Sent &quot; + buf + &quot; to the wire...&quot;);
}
setInterval(broadcastNew, 3000);
</pre></p>
<p>The program is simple: Every three seconds it throws some data to its UDP connection (localhost:55555) and it logs the same message to the server console. You can run the broadcasting &#8220;server&#8221; with <em><strong>node yourFilename.js</strong></em>.</p>
<p>Next you need to add the following section to the <em><strong>gateway-config.xml</strong></em> file:</p>
<p><pre class="brush: xml;">
&lt;service&gt;
  &lt;accept&gt;ws://localhost:8000/nodejs&lt;/accept&gt;
  &lt;type&gt;broadcast&lt;/type&gt;
  &lt;properties&gt;
    &lt;accept&gt;udp://localhost:55555&lt;/accept&gt;
  &lt;/properties&gt;
  &lt;cross-site-constraint&gt;
    &lt;allow-origin&gt;*&lt;/allow-origin&gt;
  &lt;/cross-site-constraint&gt;
&lt;/service&gt;
</pre></p>
<p>This maps any incoming WebSocket request for <strong>ws://localhost:8000/nodejs</strong> to the UDP tool we started on localhost:55555. The used <strong>cross-site-constraint</strong> ensures that you can invoke the Gateway from a different origin (e.g. different port). If you check the other configured Gateway services you see they do contain URIs for the cross-site-constraint parameter&#8230;</p>
<p>The missing piece here is a VERY simple WebSocket script, like:</p>
<p><pre class="brush: xml;">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt; My first WebSocket app!&lt;/title&gt;

&lt;script src=&quot;./WebSocket.js&quot;&gt;&lt;/script&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
function connectMeToNodeByUsingKaazing() {
  var ws = new WebSocket(&quot;ws://localhost:8000/nodejs&quot;);
  ws.onopen = function(ev) {
     console.log(&quot;connection is up&quot;);
};
ws.onmessage = function(ev) {
     console.log(&quot;The news: \&quot;&quot; + ev.data + &quot;\&quot;&quot;);
};
}
&lt;/script&gt;
&lt;body onLoad=&quot;connectMeToNodeByUsingKaazing()&quot;&gt;
&lt;h2&gt;Open your JavaScript console to see the messages!&lt;/h2&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre></p>
<p>Now go to the $KAAZING_HOME directory and cd to <strong>&#8220;web/extras&#8221;</strong>:</p>
<ol>
<li>create a new folder in there (<em>e.g. mkdir </em><strong><em>firstApp</em>)</strong></li>
<li>copy the WebSocket.js file (<em>from $KAAZING_HOME/lib/client/javascript/WebSocket.js</em>) to the new &#8216;<strong>firstApp</strong>&#8216; folder.</li>
<li>make sure the above HTML page is in that directory as well (<em>e.g. simpleUDP.html</em>)</li>
</ol>
<p><strong>That&#8217;s it!</strong></p>
<p>If you now open that HTML page in a browser (e.g. <em>http://localhost:8001/firstApp/simpleUDP.html</em>) (and open the JavaScript console), you will see that the connection to the Kaazing gateway has been opened and that news items are coming across the wire!</p>
<p>The sweet part is that you have now been able to bring a UDP based communication to the browser, by using the Gateway server! Of course the demo is pretty simple and trivial, but it opens up for what&#8217;s possible when running the Kaazing gateway.</p>
<p>In fact the Kaazing WebSocket Gateway does already have support for <a href="http://kaazing.com/download.html">JMS, XMPP, STOMP or even AMQP</a>. You can now easily bring these backends to the web (including browsers like IE6)!!!</p>
<p>Have fun!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthiaswessendorf.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthiaswessendorf.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthiaswessendorf.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthiaswessendorf.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matthiaswessendorf.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matthiaswessendorf.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matthiaswessendorf.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matthiaswessendorf.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthiaswessendorf.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthiaswessendorf.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthiaswessendorf.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthiaswessendorf.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthiaswessendorf.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthiaswessendorf.wordpress.com/458/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=458&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matthiaswessendorf.wordpress.com/2011/03/21/extending-tcp-udp-to-the-browser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/92d27b816c7652e7bad5ecbfa76705a7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matze</media:title>
		</media:content>
	</item>
		<item>
		<title>Java Client for WebSocket</title>
		<link>http://matthiaswessendorf.wordpress.com/2011/03/12/java-client-for-websocket/</link>
		<comments>http://matthiaswessendorf.wordpress.com/2011/03/12/java-client-for-websocket/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 05:41:46 +0000</pubDate>
		<dc:creator>matthiaswessendorf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matthiaswessendorf.wordpress.com/?p=439</guid>
		<description><![CDATA[When folks hear WebSocket, they most-likely imaging using the (native) JavaScript APIs, from modern browsers, to access a WebSocket server. However there is a need for other platforms, like a regular Java client. Several Http Client projects, like Async Http Client or Apache&#8217;s HttpClient , have already plans to add WebSocket support. The Kaazing WebSocket [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=439&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When folks hear <em><strong>WebSocket</strong></em>, they most-likely imaging using the (native) JavaScript APIs, from modern browsers, to access a WebSocket server. However there is a need for other platforms, like a regular Java client. Several Http Client projects, like <a href="https://github.com/sonatype/async-http-client">Async Http Client</a> or <a href="https://issues.apache.org/jira/browse/HTTPCLIENT-973">Apache&#8217;s HttpClient</a> , have already plans to add WebSocket support.</p>
<p>The <a href="http://kaazing.com/">Kaazing</a> <a href="http://kaazing.com/products/kaazing-websocket-gateway.html">WebSocket Gateway</a> is an advanced WebSocket server, which contains several Client SDKs, including a Java-based WebSocket client!</p>
<p>After <a href="http://kaazing.com/download.html">downloading</a> and extracting the Kaazing WebSocket Gateway, you find the Java API inside the <strong>lib/client/java</strong> folder. Add the JAR to a (blank) Java Project in your IDE (e.g. Eclipse).</p>
<p>A pretty quick (and simple) test is using the API against the public Echo-Server, hosted at <a href="http://websocket.org">websocket.org</a>,like:</p>
<p><pre class="brush: java;">

package net.wessendorf.kaazing.gateway;

import java.net.URI;
import com.kaazing.gateway.client.html5.WebSocket;
import com.kaazing.gateway.client.html5.WebSocketAdapter;
import com.kaazing.gateway.client.html5.WebSocketEvent;

public class WebSocketTest {

  public static void main(String[] args) throws Exception {
    final WebSocket ws = new WebSocket();
    ws.addWebSocketListener(
          new WebSocketAdapter() {
     @Override
     public void onMessage(WebSocketEvent messageEvent) {
         System.out.println(&quot;Received Event Data: &quot; + messageEvent.getData());
         // let's close the open connection...
         try {
             ws.close();
         }
         catch (Exception e) {
             e.printStackTrace();
         }
     }
     @Override
     public void onOpen(WebSocketEvent openEvent) {
         System.out.println(&quot;Connection to Server is up!&quot;);
          // we are able to talk to the WebSocket gateway
         try {
             ws.send(&quot;Hey, server!&quot;);
         }
         catch (Exception e) {
             e.printStackTrace();
         }
            }
          }
        );
        ws.connect(new URI(&quot;ws://echo.websocket.org:80&quot;));
    }
}
</pre></p>
<p>The Java code is pretty straightforward: It creates a WebSocket object, overrides a convenience class to react on some <strong>WebSocket events</strong> and finally connects to the actual Echo-Server.</p>
<p>Once the connection is up (inside the <em>onOpen()</em> callback), we are sending a simple text to the server. The server returns exactly the same string back to the sending client. This issues our <em>onMessage()</em> callback. After printing the received data to the console, we close the open connection.</p>
<p>Instead of using the remote server, you could try the demos on your machine, by <a href="http://kaazing.com/download.html">installing the Kaazing WebSocket Gateway on your box</a>!</p>
<p>Have fun!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthiaswessendorf.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthiaswessendorf.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthiaswessendorf.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthiaswessendorf.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matthiaswessendorf.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matthiaswessendorf.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matthiaswessendorf.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matthiaswessendorf.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthiaswessendorf.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthiaswessendorf.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthiaswessendorf.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthiaswessendorf.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthiaswessendorf.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthiaswessendorf.wordpress.com/439/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=439&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matthiaswessendorf.wordpress.com/2011/03/12/java-client-for-websocket/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/92d27b816c7652e7bad5ecbfa76705a7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matze</media:title>
		</media:content>
	</item>
		<item>
		<title>Joining Kaazing</title>
		<link>http://matthiaswessendorf.wordpress.com/2011/02/17/joining-kaazing/</link>
		<comments>http://matthiaswessendorf.wordpress.com/2011/02/17/joining-kaazing/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 14:19:59 +0000</pubDate>
		<dc:creator>matthiaswessendorf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matthiaswessendorf.wordpress.com/?p=433</guid>
		<description><![CDATA[Tomorrow is my last workday it Oracle. In March I am joining Kaazing! I will be working on WebSocket, HTML5 and other related technologies to build the next generation web! I am really excited about it and I am looking forward to start my new adventure there! Thanks! Matthias<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=433&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Tomorrow is my last workday it <a href="http://matthiaswessendorf.wordpress.com/2011/02/08/leaving-oracle/">Oracle</a>.</p>
<p>In March I am joining <a href="http://kaazing.com/">Kaazing</a>! I will be working on WebSocket, HTML5 and other related technologies to build the <strong><em>next generation</em></strong> web!<br />
I am really excited about it and I am looking forward to start my new adventure there!</p>
<p>Thanks!<br />
Matthias</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthiaswessendorf.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthiaswessendorf.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthiaswessendorf.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthiaswessendorf.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matthiaswessendorf.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matthiaswessendorf.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matthiaswessendorf.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matthiaswessendorf.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthiaswessendorf.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthiaswessendorf.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthiaswessendorf.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthiaswessendorf.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthiaswessendorf.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthiaswessendorf.wordpress.com/433/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=433&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matthiaswessendorf.wordpress.com/2011/02/17/joining-kaazing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/92d27b816c7652e7bad5ecbfa76705a7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matze</media:title>
		</media:content>
	</item>
		<item>
		<title>JPA2 and CloudBees</title>
		<link>http://matthiaswessendorf.wordpress.com/2011/02/12/jpa2-and-cloudbees/</link>
		<comments>http://matthiaswessendorf.wordpress.com/2011/02/12/jpa2-and-cloudbees/#comments</comments>
		<pubDate>Sat, 12 Feb 2011 08:33:38 +0000</pubDate>
		<dc:creator>matthiaswessendorf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matthiaswessendorf.wordpress.com/?p=426</guid>
		<description><![CDATA[Besides its &#8220;Tomcat-as-a-Service&#8221;, the CloudBees service is also offering a hosted MySQL (5.0.51) database. This &#8220;database-as-a-service&#8221; can be used in various ways. Once you&#8217;ve created your database, you can get detailed informations about it in the management console. This console includes a few code samples on how-to configure the hosted database, e.g to be used [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=426&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Besides its &#8220;Tomcat-as-a-Service&#8221;, the CloudBees service is also offering a hosted MySQL (5.0.51) database. This &#8220;database-as-a-service&#8221; can be used in various ways. Once you&#8217;ve created your database, you can get detailed informations about it in the management console. This console includes a few code samples on how-to configure the hosted database, e.g to be used in JSP or ColdFusion.</p>
<p>Of course, you can also use JPA inside of the CloudBees offer. <a href="https://github.com/matzew/modern-ee-app20">I&#8217;ve tested it with EclipseLink and OpenJPA</a>.</p>
<p>In order to use JPA with the hosted database, you need to include something like below, in your persistence.xml file:</p>
<p><pre class="brush: xml;">
&lt;persistence-unit
  name=&quot;myUnit&quot;
  transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;

&lt;class&gt;my.PersistentObject&lt;/class&gt;
...

 &lt;properties&gt;
&lt;!-- JPA standard properties --&gt;
&lt;property
   name=&quot;javax.persistence.jdbc.driver&quot;
   value=&quot;com.cloudbees.jdbc.Driver&quot;/&gt;
&lt;property
   name=&quot;javax.persistence.jdbc.url&quot;
   value=&quot;jdbc:cloudbees://YOURSCHEMA&quot;/&gt;
&lt;property
   name=&quot;javax.persistence.jdbc.user&quot;
   value=&quot;USER&quot;/&gt;
&lt;property
   name=&quot;javax.persistence.jdbc.password&quot;
   value=&quot;PASSWORD&quot;/&gt;
....
</pre></p>
<p>That&#8217;s all you need! Now you are able to use the database!</p>
<p><em>Note: For your local development you can also access the DB via a <strong>real</strong> URL and the regular MySQL driver. The management console does show the remote connection details as well.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthiaswessendorf.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthiaswessendorf.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthiaswessendorf.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthiaswessendorf.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matthiaswessendorf.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matthiaswessendorf.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matthiaswessendorf.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matthiaswessendorf.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthiaswessendorf.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthiaswessendorf.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthiaswessendorf.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthiaswessendorf.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthiaswessendorf.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthiaswessendorf.wordpress.com/426/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=426&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matthiaswessendorf.wordpress.com/2011/02/12/jpa2-and-cloudbees/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/92d27b816c7652e7bad5ecbfa76705a7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matze</media:title>
		</media:content>
	</item>
		<item>
		<title>Leaving Oracle</title>
		<link>http://matthiaswessendorf.wordpress.com/2011/02/08/leaving-oracle/</link>
		<comments>http://matthiaswessendorf.wordpress.com/2011/02/08/leaving-oracle/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 18:51:29 +0000</pubDate>
		<dc:creator>matthiaswessendorf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://matthiaswessendorf.wordpress.com/?p=422</guid>
		<description><![CDATA[After almost five years I am leaving Oracle at the end of February. In 2006 I joined the company to work on JavaServer Faces related projects like Apache MyFaces/Trinidad or ADF Faces. I had a great time at Oracle and I do have a lot of friends there! I had the opportunity to work on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=422&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After almost five years I am leaving Oracle at the end of February. In 2006 I joined the company to work on JavaServer Faces related projects like Apache MyFaces/Trinidad or ADF Faces. I had a great time at Oracle and I do have a lot of friends there! I had the opportunity to work on pretty interesting projects with great engineers. I&#8217;ve learned a lot!</p>
<p>As I am leaving Oracle, I won&#8217;t participate actively in JSF related projects anymore. Therefore I am also step back from being the Apache MyFaces PMC Chair.</p>
<p>I will be moving on to work on some really exciting stuff! I am looking forward to my new adventure!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthiaswessendorf.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthiaswessendorf.wordpress.com/422/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthiaswessendorf.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthiaswessendorf.wordpress.com/422/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matthiaswessendorf.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matthiaswessendorf.wordpress.com/422/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matthiaswessendorf.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matthiaswessendorf.wordpress.com/422/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthiaswessendorf.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthiaswessendorf.wordpress.com/422/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthiaswessendorf.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthiaswessendorf.wordpress.com/422/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthiaswessendorf.wordpress.com/422/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthiaswessendorf.wordpress.com/422/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=422&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matthiaswessendorf.wordpress.com/2011/02/08/leaving-oracle/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/92d27b816c7652e7bad5ecbfa76705a7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matze</media:title>
		</media:content>
	</item>
		<item>
		<title>NotSerializableException for UIComponents</title>
		<link>http://matthiaswessendorf.wordpress.com/2011/02/04/notserializableexception-for-uicomponents/</link>
		<comments>http://matthiaswessendorf.wordpress.com/2011/02/04/notserializableexception-for-uicomponents/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 10:28:48 +0000</pubDate>
		<dc:creator>matthiaswessendorf</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[myfaces]]></category>
		<category><![CDATA[trinidad]]></category>

		<guid isPermaLink="false">http://matthiaswessendorf.wordpress.com/?p=414</guid>
		<description><![CDATA[Sometimes I am getting &#8216;bugs&#8217; that claim there is something wrong with the (Trinidad) framework, as its UIComponents are NOT serializable&#8230; An example: java.io.NotSerializableException: org.apache.myfaces.trinidad.component.UIXSwitcher No, this is not a bug at all! First: Your (session/application/pageFlow scoped) backing beans should not have an UI component as its property&#8230; (if you really really need the &#8220;cool&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=414&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes I am getting &#8216;bugs&#8217; that claim there is something wrong with the (Trinidad) framework, as its UIComponents are NOT serializable&#8230; An example:</p>
<p><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>java.io.NotSerializableException:<br />
org.apache.myfaces.trinidad.component.UIXSwitcher </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></p>
<p>No, this is not a bug at all!</p>
<p><strong>First:</strong><br />
Your (session/application/pageFlow scoped) backing beans should not have an UI component as its property&#8230; (if you really really need the &#8220;cool&#8221; binding attribute).</p>
<p><strong>Second:</strong><br />
UIComponents are not serializable &#8211; for a good reason!<br />
In JSF there is StateSaving (see the restore/saveState() hooks)&#8230;.</p>
<p>Apache MyFaces Trinidad does have a tool that helps to store an<a href="http://myfaces.apache.org/trinidad/trinidad-api/apidocs/org/apache/myfaces/trinidad/util/ComponentReference.html"> reference to an UIComponent</a> (instead of the component itself).</p>
<p>Here are a few blogs on that, that may give more information on the API and why the tool is there:</p>
<p><a href="http://matthiaswessendorf.wordpress.com/2010/03/31/uicomponent-references-in-session-scoped-jsf-beans/">http://matthiaswessendorf.wordpress.com/2010/03/31/uicomponent-references-in-session-scoped-jsf-beans/</a></p>
<p><a href="http://leadingyouastray.blogspot.com/2010/02/references-to-uicomponents-in-session.html">http://leadingyouastray.blogspot.com/2010/02/references-to-uicomponents-in-session.html</a></p>
<p>Have fun!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthiaswessendorf.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthiaswessendorf.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthiaswessendorf.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthiaswessendorf.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/matthiaswessendorf.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/matthiaswessendorf.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/matthiaswessendorf.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/matthiaswessendorf.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthiaswessendorf.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthiaswessendorf.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthiaswessendorf.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthiaswessendorf.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthiaswessendorf.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthiaswessendorf.wordpress.com/414/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthiaswessendorf.wordpress.com&amp;blog=1129660&amp;post=414&amp;subd=matthiaswessendorf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://matthiaswessendorf.wordpress.com/2011/02/04/notserializableexception-for-uicomponents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/92d27b816c7652e7bad5ecbfa76705a7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matze</media:title>
		</media:content>
	</item>
	</channel>
</rss>
