<?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>Xebia Blog &#187; Mark Bakker</title>
	<atom:link href="http://blog.xebia.com/author/mbakker/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xebia.com</link>
	<description>Software development done right!</description>
	<lastBuildDate>Wed, 01 Feb 2012 00:30:00 +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>What happened to the Open Source performance monitoring and analysis tools</title>
		<link>http://blog.xebia.com/2011/06/22/what-happened-to-the-open-source-performance-monitoring-and-analysis-tools/</link>
		<comments>http://blog.xebia.com/2011/06/22/what-happened-to-the-open-source-performance-monitoring-and-analysis-tools/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 19:33:59 +0000</pubDate>
		<dc:creator>Mark Bakker</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Middleware]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Uncategorized]]></category>

	<!-- AutoMeta Start -->
	<category>glassbox</category>
	<category>infrared</category>
	<category>tavant</category>
	<category>appdynamics</category>
	<category>jxinsight</category>
	<category>binil</category>
	<category>6rc1</category>
	<category>glassbox</category>
	<category>infrared</category>
	<category>tavant</category>
	<category>appdynamics</category>
	<category>jxinsight</category>
	<category>binil</category>
	<category>6rc1</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=6988</guid>
		<description><![CDATA[In my current position as Performance Engineer and in my past position as a Middleware Architect I did quite some work with closed source performance monitoring and analysis tools (i.g. CA Wily and later AppDynamics). These tools are both expensive but also do quite a good job most of the times. In the same field [...]]]></description>
			<content:encoded><![CDATA[<p>In my current position as Performance Engineer and in my past position as a Middleware Architect I did quite some work with closed source performance monitoring and analysis tools (i.g. CA Wily and later AppDynamics).<br />
These tools are both expensive but also do quite a good job most of the times. In the same field there are more tools, but all in the same price range for as far as I know.<br />
To name some: Foglight, Dynatrace, Newrelic, JXInsight, Tivoli Performance Viewer, Compuware Gomez.</p>
<p>Around 2006 several initiatives to create open source performance monitoring tools for java production environments started to appear.</p>
<p>This was mainly because AOP (Aspect Oriented Programming), the technology used in most of these products, was getting attention in the market and there were quite some developments in that area at the time.</p>
<p>I am interested to see how the open source community around these kind of products is evolving. The outcome is quite surprising…</p>
<p><span id="more-6988"></span></p>
<p>The main reason I am interested in tools in this area is to be able to pinpoint problems in an Acceptance or Production environments very quickly, because this saves (big) enterprises a lot of money.</p>
<p>The main reason I am interested in <em>open source</em> tools is to see if we are able to create a complete open source java hosting stack which is enterprise production ready.</p>
<p>Without adding a lot of extra license and/or support costs we don’t have to consolidate IT anymore. We will be able to do application hosting for each specific business unit separately and focus on the continuous improvement for that business unit alone. Without big boundaries between the business unit and IT. This kind of boundaries are most times created because of cost efficiency. Think about consolidation and architecture guidelines. Not having to think about licencing costs will help us in helping enterprises to become agile.</p>
<p>During a knowledge exchange session (XKE) at Xebia we first created a requirements list to select tools in the same area to be able to compare them.</p>
<p>The requirements so far:</p>
<ol>
<li>The tool should measure production and acceptance environments with low (&lt;= 5%) resource usage overhead.</li>
<li>The tool should be able to pinpoint (potential) problems in the running applications as quickly as possible.</li>
<li>The problems that should be detected: high resource consumption of particular code blocks, memory leaks and the location of the leak, blocking code blocks which block other threads, slow calls to back ends (i.e. web services, databases).</li>
<li>The environments the tools should run in are the following application servers: IBM Websphere, Oracle Weblogic, JBoss, Tomcat, Glassfish.</li>
<li>The problems should be made visible in such a way that the root cause can be found as quickly as possible. The most valuable will be to see complete business transaction flows over all JVM’s, with real-time flow states and measurement readings.</li>
<li>The tool should be easy to install, i.g. just use a simple agent that connects it to a server. The goal should be to leave the code base unchanged.</li>
</ol>
<p>Before the session I did some homework and I searched the internet for these kind of monitoring tools. During our knowledge exchange session we had a brainstorm session and came to the following list of Open Source tools:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="49" valign="top"><em>Type</em></td>
<td width="165" valign="top"><em>Name</em></td>
<td width="112" valign="top"><em>Active development</em></td>
<td width="105" valign="top"><em>Possible usability?</em></td>
<td width="98" valign="top"><em>Costs</em></td>
<td width="88" valign="top"><em>Commercial support possible?</em></td>
</tr>
<tr>
<td width="49" valign="top">OS</td>
<td width="165" valign="top">Glassbox</td>
<td width="112" valign="top">No (last in nov. 2008)</td>
<td width="105" valign="top">Yes</td>
<td width="98" valign="top">-</td>
<td width="88" valign="top">Maybe</td>
</tr>
<tr>
<td width="49" valign="top">OS</td>
<td width="165" valign="top">Infrared</td>
<td width="112" valign="top">No (last in jan. 2010, between 2006 – 2010 none)</td>
<td width="105" valign="top">Yes</td>
<td width="98" valign="top">-</td>
<td width="88" valign="top">Maybe</td>
</tr>
<tr>
<td width="49" valign="top">OS</td>
<td width="165" valign="top">Profiler4j</td>
<td width="112" valign="top">No (last in 2006)</td>
<td width="105" valign="top">No, more are profiler</td>
<td width="98" valign="top">-</td>
<td width="88" valign="top">No</td>
</tr>
<tr>
<td width="49" valign="top">OS</td>
<td width="165" valign="top">JAMon/ JARep</td>
<td width="112" valign="top">No (last in 2010)</td>
<td width="105" valign="top">No, no runtime aspects, code has to change</td>
<td width="98" valign="top">-</td>
<td width="88" valign="top">No</td>
</tr>
<tr>
<td width="49" valign="top">OS</td>
<td width="165" valign="top">VisualVM + BTrace</td>
<td width="112" valign="top">Yes</td>
<td width="105" valign="top">No, does only run in JDK6 and higher, no complete visual integration.</td>
<td width="98" valign="top"></td>
<td width="88" valign="top">Yes</td>
</tr>
<tr>
<td width="49" valign="top">Closed SourceFree in dev. env.</td>
<td width="165" valign="top">OpenCore</td>
<td width="112" valign="top">Yes</td>
<td width="105" valign="top">Yes, but is not open source, only low cost in development environment.</td>
<td width="98" valign="top">None for development environment, commercial for production environment, see JXInsight.</td>
<td width="88" valign="top">No</td>
</tr>
</tbody>
</table>
<p>This list is as complete as we were able to come up with, if you know more and eventual better open source tools please let us know!</p>
<p>After evaluating all products on the lists (just a paper evaluation) we only see Glassbox and Infrared as a real Open Source solution in this area. But both (at least Glassbox) are not actively developed anymore. Of course because both products are open source it will be possible to restart development on one of the products.</p>
<p>It is interesting why both projects are not active anymore. I spent some time to find out why. This is what I found out:</p>
<p>What happened to Glassbox; the first developer mentioned is the VP of Engineering at Glassbox David Pickering. He has left the Glassbox company in 2009. And is now VP of Engineering at iWin, a company with a different focus. The second one mentioned is Ron Bodkin, he left Glassbox in 2007 and was the founder of the Glassbox company, he became VP of Engineering at Quantcast, so also his focus has moved. This looks like the main reason there is no active development on Glassbox anymore.</p>
<p>What happened to Infrared; the first developer mentioned on the project member list at SourceForge is Binil Thomas, he worked for Tavant Technologies at the time Infrared was created. Other members on the same list also worked for Tavant in that time. Most are now working for different companies. It looks that Tavant Technologies was no longer interested in this space. The last 2.6RC1 release from Infrared was created in 2010, at a time Binil was working for Ronin Capital. Since 2011 he is working for AppDynamics, this is a commercial vendor in this area and looks like the main reason the 2.6RC1 release never came to a full release, but this is something I am guessing of course.</p>
<p><strong>What’s next</strong></p>
<p>We will test both Infrared and Glassbox to see if one of them is still a good choice. We will start with Infrared because this one has been the most active project in the past and it has been maintained the longest, until 2010. After this we will see if one of these products can be a competitor for the commercial products in this area.</p>
<p>Many thanks to my colleagues Adriaan Thomes and Sander Hautvast for helping me with the brainstorm session.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2011/06/22/what-happened-to-the-open-source-performance-monitoring-and-analysis-tools/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2011%2F06%2F22%2Fwhat-happened-to-the-open-source-performance-monitoring-and-analysis-tools%2F&amp;title=What%20happened%20to%20the%20Open%20Source%20performance%20monitoring%20and%20analysis%20tools" id="wpa2a_2"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2011/06/22/what-happened-to-the-open-source-performance-monitoring-and-analysis-tools/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Forum Sentry XML Gateway</title>
		<link>http://blog.xebia.com/2011/03/15/forum-sentry-xml-gateway/</link>
		<comments>http://blog.xebia.com/2011/03/15/forum-sentry-xml-gateway/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 15:00:02 +0000</pubDate>
		<dc:creator>Mark Bakker</dc:creator>
				<category><![CDATA[Middleware]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[esb]]></category>

	<!-- AutoMeta Start -->
	<category>gateway</category>
	<category>datapower</category>
	<category>sentry</category>
	<category>xs40</category>
	<category>conversions</category>
	<category>crosscheck</category>
	<category>virus</category>
	<category>flavors</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=6408</guid>
		<description><![CDATA[Last week I got a presentation for a security device I had never heard about. Most times this means it is something which is not commodity, or has no real use-case. But this time I was really impressed. The device is a possible replacement for IBM Datapower XML Security Gateway. But the way they designed [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I got a presentation for a security device I had never heard about.<br />
Most times this means it is something which is not commodity, or has no real use-case.</p>
<p>But this time I was really impressed. The device is a possible replacement for IBM Datapower XML Security Gateway. But the way they designed the device is totally different.</p>
<p>What CrossCheck networks did was creating a device with just security as main use case. First of all it was an XML gateway, nowadays is does support HTML, XML, SOAP, FTP, JMS and others.<br />
It also translates different flavors of JMS to each other, it can even convert from IBM MQ to JBoss MQ directly.</p>
<p><span id="more-6408"></span></p>
<p>The Forum Sentry XML Gatewat comes in two flavors, as an appliance and as an VMWare image.<br />
This is useful for the Development and Test environments.</p>
<p>The main use-case for the device is as a security device. It will stand in the DMZ and acts as a level 7 security gateway. This is the same use-case as the IBM Datapower, only the marketing is a little bit different, CrossCheck Networks markets the device mainly as a security appliance. IBM did market the Datapower mainly as a ESB in the past. Nowadays they also market it mainly as a security appliance.</p>
<p>The main differences I spotted between those two where:</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Forum Sentry XML Gateway</strong></td>
<td> </td>
<td><strong>IBM Datapower XML Security Gateway XS40</strong></td>
</tr>
<tr>
<td>Supports protocol conversions (also IBM MQ → JBoss MQ)</td>
<td> </td>
<td>Support protocol conversions (but does only support IBM related JMS technologies)</td>
</tr>
<tr>
<td>Support virus scanning (also in SOAP with attachments)</td>
<td> </td>
<td>-</td>
</tr>
<tr>
<td>Supports large streaming files</td>
<td> </td>
<td>Only does this in the Datapower XB60 B2B gateway</td>
</tr>
<tr>
<td>Supports authentication by using cascading user stores (i.g. If you can not find this username/ password in LDAP go to your Active Directory and try to match there). This can be configured for each url(-part)/ service(-part).</td>
<td> </td>
<td>Support authentication</td>
</tr>
<tr>
<td>Real nice configuration, no need to type any XSLT.</td>
<td> </td>
<td>Most conversions are made in XSLT.</td>
</tr>
<tr>
<td>SSO for web, ftp and services.</td>
<td> </td>
<td>SSO for SOAP.</td>
</tr>
</tbody>
</table>
<p><strong>My conclusion after this short demo</strong><br />
The Forum sentry has some advantages when you compare it to the IBM Datapower XML Security Gateway XS40. The main difference is that you can do more whith only one appliance. You can replace an IBM Webseal, a virus scanner and an IBM Datapower XS40 with only one device.<br />
My advice is to take this device in considerations where you have to choose for an XML firewall/ hardware ESB.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2011/03/15/forum-sentry-xml-gateway/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2011%2F03%2F15%2Fforum-sentry-xml-gateway%2F&amp;title=Forum%20Sentry%20XML%20Gateway" id="wpa2a_4"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2011/03/15/forum-sentry-xml-gateway/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Review Java EE6 and JavaFX 1.3 – Part II, the front-end</title>
		<link>http://blog.xebia.com/2010/06/01/review-java-ee6-and-javafx-1-3-%e2%80%93-part-ii-the-front-end/</link>
		<comments>http://blog.xebia.com/2010/06/01/review-java-ee6-and-javafx-1-3-%e2%80%93-part-ii-the-front-end/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 06:39:55 +0000</pubDate>
		<dc:creator>Mark Bakker</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/blog.xebia.com/www/wp-content/plugins/autometa/autometa.php</b> on line <b>303</b><br />
		<category><![CDATA[Java]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=4607</guid>
		<description><![CDATA[Summary In the first part of this review (the JavaEE6 back-end) I created a small application which is a JSON REST service to be used as back-end for a JavaFX front-end. This second part of my review covers a small review of JavaFX, to see if it meats my requirements as front-end for my personal [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Summary</strong><br />
In the first part of this review (the JavaEE6 back-end) I created a small application which is a JSON REST service to be used as back-end for a JavaFX front-end.<br />
This second part of my review covers a small review of JavaFX, to see if it meats my requirements as front-end for my personal finance application (see previous post).</p>
<p>My conclusion for now is that JavaFX is an interesting new technology, I think it can be used for small applications or forms (think about internet adds). But for serious applications it is not ready yet.<br />
I am really missing Datagrids, the way you have to deal with Session cookies for the Rest service is far to low level. I hope someone can point me to a place where I can find better solutions for those problems (if there are).</p>
<p><span id="more-4607"></span></p>
<p><strong>Requirements<br />
<span style="font-weight: normal;">The basic functional and technical requirements I described in my previous post, but the most important requirements for the front end are:</span></strong></p>
<ul>
<li><span style="font-size: small;">Have an tree data 	table (in Flex it is called an advanced datagrid) for visualizing an 	hierarchical data structure.</span></li>
<li><span style="font-size: small;">Be able to show adds 	in the front-end to be able to earn the costs of the hosting.</span></li>
</ul>
<p><strong>The back-end service<br />
<span style="font-weight: normal;">The service I used in this review is an simple service for which I have to logon via Basic Authentication an can get User information (username) via an Rest call.</span></strong></p>
<p><strong><span style="font-weight: normal;"><strong>The javaFX client</strong><br />
First I created a new FavaFX project and added some fields to the form.<br />
<img class="alignnone size-medium wp-image-4610" title="pf_client1" src="http://blog.xebia.com/wp-content/uploads/2010/05/pf_client11-300x199.png" alt="pf_client1" width="300" height="199" /></span></strong></p>
<p><strong><span style="font-weight: normal;">After this I created some code to do the login action and show the username.  (FYI: I now that this is no good OO-design but for this small test it is the best way to show it.)</span></strong></p>
<pre class="brush: java; title: ; notranslate">
public class User {

    var sessionCookie: String;
    var username: String;
}
var user: User = User {};

public class Main {
    // &lt;editor-fold defaultstate=&quot;collapsed&quot; desc=&quot;Generated Code&quot;&gt;

    var userJsonInput;
    var userParser = PullParser {
                documentType: PullParser.JSON;
                input: bind userJsonInput;
                onEvent: function (event: Event) { // parse the JSON user data and populate the user object
                    if (event.type == PullParser.END_VALUE) {
                        if (event.name == &quot;username&quot;) {
                            user.username = event.text;
                        }
                    }
                }
            }

    //todo make this a function to add the headers! Make ik possible to logout/ relogin
    function buttonOnMouseClicked(event: javafx.scene.input.MouseEvent): Void {
        var httpHeader = HttpHeader.basicAuth(usernameTextbox.text, passwordTextbox.text);
        var sessionHeader = HttpHeader {
            name: &quot;cookie&quot;
            value: user.sessionCookie
        };

        def request: HttpRequest = HttpRequest {
            location: &quot;http://localhost:8080/pfserver/services/private/account/show&quot;;
            headers: [ httpHeader,sessionHeader ]
            onInput: function(input: java.io.InputStream) {
                userJsonInput = input;
                userParser.parse();
                if(request.getResponseHeaderValue(&quot;set-cookie&quot;) != null){
                    user.sessionCookie = request.getResponseHeaderValue(&quot;set-cookie&quot;);
                }

           }
           onException: function(ex: java.lang.Exception) {
              println(&quot;onException - exception: {ex.getClass()} {ex.getMessage()}&quot;);
          }
        }
        request.start();

    }
}
</pre>
<p>The first thing you see is the PullParser, this parser is an parser for JSON data. I fetched the event of an new field an added this to a global value (ugly, I know <img src='http://blog.xebia.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).<br />
Using this was quite simple, but in my opinion to low level for big JSON data structures.<br />
Getting the data is done with the HttpRequest, searching for this function did costs me 30 minutes because this is changed in each new version of JavaFX. First there was some async package for this, but now we only have the HttpRequest. Using the HttpRequest was not complex but this time again to complex for big applications, simple things as a cookieManager are missing, of course I can write one myself, but this type of things will cost me to much time if I compare it to Flex.</p>
<p>The first requirement, having a tree data table is also not met, even a simple data table does not exists for now.</p>
<p><strong>Conclusion</strong><br />
I will not use the current version of Flex for my new front-end. It&#8217;s to low level at the moment compared to Flex. It is slowly getting there if I compare it to previous releases but it still has a long way to go.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2010/06/01/review-java-ee6-and-javafx-1-3-%e2%80%93-part-ii-the-front-end/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2010%2F06%2F01%2Freview-java-ee6-and-javafx-1-3-%25e2%2580%2593-part-ii-the-front-end%2F&amp;title=Review%20Java%20EE6%20and%20JavaFX%201.3%20%E2%80%93%20Part%20II%2C%20the%20front-end" id="wpa2a_6"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2010/06/01/review-java-ee6-and-javafx-1-3-%e2%80%93-part-ii-the-front-end/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Review Java EE6 and JavaFX 1.3 &#8211; Part I, the back-end</title>
		<link>http://blog.xebia.com/2010/05/27/review-java-ee6-and-javafx-1-3-part-i-the-back-end/</link>
		<comments>http://blog.xebia.com/2010/05/27/review-java-ee6-and-javafx-1-3-part-i-the-back-end/#comments</comments>
		<pubDate>Thu, 27 May 2010 06:00:34 +0000</pubDate>
		<dc:creator>Mark Bakker</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/blog.xebia.com/www/wp-content/plugins/autometa/autometa.php</b> on line <b>303</b><br />
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Flex]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=4543</guid>
		<description><![CDATA[Summary In the first part of this review (the JavaEE6 back-end) I tested a small application which is a JSON REST service to be used as back-end for a JavaFX front-end. My conclusion for now is that JavaEE6 has a lot of new features which makes it a lot easier to use Java EE without [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Summary</strong></p>
<p>In the first part of this review (the JavaEE6 back-end) I tested a small application which is a JSON REST service to be used as back-end for a JavaFX front-end. My conclusion for now is that JavaEE6 has a lot of new features which makes it a lot easier to use Java EE without extra libraries like Spring, Seam or Resteasy. I was able to make a back-end application which was noticeable fast with a low overhead in bandwidth and CPU usage.</p>
<p><strong>Introduction</strong></p>
<p>In a search for the current best technology platform I am building a small real-world application for personal use in different languages and frameworks. First up is Java EE 6 and JavaFX 1.3.</p>
<p>I think this review can be helpful for others as well. If you just want to see the implementation you can skip the functional and technical requirements. If you are interested in the application and want to help creating the new version; please send me a reply:-).</p>
<p><span id="more-4543"></span></p>
<p><strong>Functional requirements</strong></p>
<p>Currently I am using an application for managing my personal finances. This application is created in Java Swing with a Hsql database beneath it.  The application functions well, but is only usable for one person at a time an the Hsql database is not ideal.</p>
<p>I created this application because I could not find any other application to manage my personal finances which has the following features (and more):</p>
<ul>
<li>Register coming transactions on budgets
<ul>
<li>One time transactions</li>
<li>Repeated transactions (currently with a cron syntax)</li>
</ul>
</li>
<li>Be able to report on self defined periods
<ul>
<li>The period can be defined by a start date and and Unix cron syntax</li>
<li>The period reports shows
<ul>
<li>The budget for that period (based on all coming transactions) for each budget entry</li>
<li>The total amount spent for that period</li>
<li>The amount to spent for that period</li>
<li>The difference between the budget and the reality</li>
</ul>
</li>
<li>The multi period report shows
<ul>
<li>For the defined period the totals shown in the period reports</li>
<li>This report can be used to know your financial situation for the coming months.</li>
</ul>
</li>
<li>Be able to register transactions</li>
<li>Be able to import transactions (currently only from one bank)</li>
</ul>
</li>
</ul>
<p>To be able to let more users make use of this application I am thinking about rebuilding it.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><img class="alignleft size-full wp-image-4533" title="1" src="http://blog.xebia.com/wp-content/uploads/2010/05/1.jpg" alt="1" width="403" height="302" /><img class="alignleft size-medium wp-image-4534" title="2" src="http://blog.xebia.com/wp-content/uploads/2010/05/2-300x161.jpg" alt="2" width="300" height="161" /></td>
</tr>
</tbody>
</table>
<p><strong>Technology requirements</strong></p>
<p>I have some specific requirements for the technologies which I am going to use for this new version:</p>
<ul>
<li>Have a tree data table (in Flex it is called an advanced datagrid) for visualizing an hierarchical data structure.</li>
<li>Low resource utilization on server side to reduce the cost of running the server</li>
<li>Be able to run on mobile phones as well (maybe a basic version)</li>
<li>Use an extremely scalable backend to service lots of users</li>
<li>Be able to show ads in the front-end to be able to earn the costs of the hosting.</li>
</ul>
<p><strong>Java EE6 and JavaFX</strong></p>
<p>Since JEE6 is coming and the first beta releases of Glassfish and Netbeans are out I thought I try to use only Java EE6 technologies and try to make a basic test setup including client server communication and basic security. This will also give me the ability to deliver a small review of the new Java EE Edition.</p>
<p>In the past I have used a lot of different technologies to be able to use some kind of Dependency Injection (DI):</p>
<ul>
<li><span style="font-size: 13.1944px;">Self build DI framework (2003)</span></li>
<li><span style="font-size: 13.1944px;">Spring Framework(2006)</span></li>
<li><span style="font-size: 13.1944px;">Seam Framework (2007)</span></li>
</ul>
<p>JEE6 is the first Java EE edition to deliver a DI framework which appear to not need additional frameworks. So I will use the Injection framework of JEE6 for Dependency Injection.  For the client I choose JavaFX. Currently JavaFX 1.3 is in beta, but it at first glance it seems to fits my requirements.  For the communication between JavaFX and JavaEE I used JSON with JAX-RS (new in EE6). This way I hope to get low bandwidth and CPU overhead. I used JSON before but at that time the protocol was brand new. Now it is integrated in JavaEE.</p>
<p><strong>The back-end application</strong></p>
<p>For creating the back-end application I started a Netbeans 6.9 beta web project. I only gave the project a name, selected the internal Glassfish 3.0.1b14 server and selected the JEE6 profile.  First I created an User object which I can use to transfer data from the server to the client.</p>
<pre class="brush: java; title: ; notranslate">
@XmlRootElement
public class User {
     private String username;
     private String password;

     public User(){} //needed for Jaxb objects

     public User(String username, String password){
         this.username = username;
         this.password = password;
     }
     ...getters and setters for the username and password
}
</pre>
<p>The only thing I needed to do to use this object in JSON communication is adding the @XmlRootElement annotation.<br />
This is quite simple and saves a lot of work.  The next thing I created was a service to look up account information</p>
<pre class="brush: java; title: ; notranslate">
@SessionScoped
public class UserService implements Serializable{
    public UserService() {}

    private User user;

    public boolean login(String username,String password) {
       this.user = new User(username,password);
       return true;
    }

    public boolean isLoggedIn(){
        return(this.user != null);
    }

    public User getUser(){
        return user;
    }
}
</pre>
<p>Here I only needed to give the bean a scope. Since this bean is used for logging in and holding the account information, I make it a Session scoped bean. As you can see I did not connect it to a real back-end because I am going to choose the back-end later.  I now have a login service I have to connect to a security mechanism. Since I do not want to use external frameworks I used Basic authentication. This works well because it integrates well with JavaFX. To be more secure I can use transport layer security (https).  For the authentication I created a Servlet Filter</p>
<pre class="brush: java; title: ; notranslate">
@WebFilter(&quot;/services/private/*&quot;)
public class SecurityFilter implements Filter {

    @Inject UserService userService;

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        HttpServletRequest req = (HttpServletRequest) request;
        if (userService.isLoggedIn()) {
            chain.doFilter(request, response);
            return;
        } else {
            String username = null;
            String password = null;
            // Get the Authorization header, if one was supplied
            String authHeader = req.getHeader(&quot;Authorization&quot;);
            if (authHeader != null) {
                java.util.StringTokenizer st = new java.util.StringTokenizer(authHeader);
                if (st.hasMoreTokens()) {
                    String basic = st.nextToken();
                    if (basic.equalsIgnoreCase(&quot;Basic&quot;)) {
                        String credentials = st.nextToken();
                        sun.misc.BASE 64 Decoder decoder = new sun.misc.BASE 64 Decoder();
                        String userPass = new String(decoder.decodeBuffer(credentials));
                        int p = userPass.indexOf(&quot;:&quot;);
                        if (p != -1) {
                            username = userPass.sub string(0, p);
                            password = userPass.sub string(p + 1);
                        }
                    }
                }
            }
            if (username != null &amp;&amp; password != null &amp;&amp; !&quot;&quot;.equals(username) &amp;&amp; !&quot;&quot;.equals(password)) {
                if (userService.login(username, password)) {
                    chain.doFilter(request, response);
                    return;
                }
            }

        }
        HttpServletResponse res = (HttpServletResponse) response;
        String s = &quot;Basic realm=\&quot;Login Rest Services - PersonalFinance\&quot;&quot;;
        res.setHeader(&quot;WWW-Authenticate&quot;, s);
        res.setStatus(401);
    }
}
</pre>
<p>As you can see most of the code is quite simple and is only needed for decoding the basic authentication realm. The interesting JavaEE6 part is the @WebFilter(&#8220;/services/private/*&#8221;) annotation. With this annotation you can define where the filter will be used. It is no longer needed to define the filter in an web.xml file. The other interesting annotation is the @Inject UserService userService; with this annotation the UserService service is injected. Since the UserService has an @SessionScoped annotation this service will always be one instance for each session. The only part of the back-end that is left is the Rest Service itself. This service gives the current User bean back via JSON over REST.</p>
<pre class="brush: java; title: ; notranslate">
@Path(&quot;private/account/&quot;)
@RequestScoped
public class Accounts implements Serializable{
    @Inject UserService userService;

    @GET
    @Path(&quot;show&quot;)
    @Produces(&quot;application/json&quot;)
    public User show(){
        return userService.getUser();
    }
}
</pre>
<p>As we can see implementing JSON over REST is easy.<br />
The implementation of REST is done by using the @Path(&#8220;private/account/&#8221;) ,@GET and @Path(&#8220;show&#8221;) annotations. This produces an url /private/account/show for the show function. Which will accept the HTTP GET method.<br />
To deliver the JSON output all I had to do was adding the @Produces(&#8220;application/json&#8221;) annotation and be sure that the User object is annotated with the @XmlRootElement annotation.</p>
<p>To test this simple back-end I deployed the application to the build in Glassfish server by clicking with the right mouse button on the project and selecting deploy.<br />
After the deployment we can directly test the back-end:</p>
<p>As you can see we have to login. After typing an Username and password we see the JSON output.<br />
The requirement to have a minimum of bandwidth overhead will be met. The JSON output is very small.<br />
To test the performance I created a simple Jmeter test which just sends a correct REALM to login and shows the JSON output. The results where quite good.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><img class="alignleft size-medium wp-image-4536" title="4" src="http://blog.xebia.com/wp-content/uploads/2010/05/4-300x236.jpg" alt="4" width="300" height="236" /><img class="alignleft size-medium wp-image-4537" title="5" src="http://blog.xebia.com/wp-content/uploads/2010/05/5-300x236.jpg" alt="5" width="300" height="236" /></td>
</tr>
</tbody>
</table>
<p>I got 307 requests per second with 90% of the requests within 37 milliseconds without tuning anything and with 10 concurrent threads in Jmeter. The CPU load was 40% at that moment (Core i7 QC820). This proves for me that the overhead is low. With this case I simulated an worse case scenario where every request is a new session because I did not use an cookie manager in Jmeter.<br />
<img class="alignnone size-medium wp-image-4538" title="7" src="http://blog.xebia.com/wp-content/uploads/2010/05/7-300x76.jpg" alt="7" width="600" height="152" /></p>
<p><strong>Conclusions</strong><br />
The use of JavaEE6 for the back-end will be an appropriate choice. It is possible to develop very fast (I created the whole demo without any knowledge of the new features of JEE6 in less than 2 hours). And it meets the technical requirements in terms of overhead.<br />
In the next part I will blog about the front-end in JavaFX 1.3.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2010/05/27/review-java-ee6-and-javafx-1-3-part-i-the-back-end/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2010%2F05%2F27%2Freview-java-ee6-and-javafx-1-3-part-i-the-back-end%2F&amp;title=Review%20Java%20EE6%20and%20JavaFX%201.3%20%26%238211%3B%20Part%20I%2C%20the%20back-end" id="wpa2a_8"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2010/05/27/review-java-ee6-and-javafx-1-3-part-i-the-back-end/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Integrating Tivoli Access Manager with JBoss AS 4.x</title>
		<link>http://blog.xebia.com/2009/12/22/integrating-tivoli-access-manager-with-jboss-as-4-x/</link>
		<comments>http://blog.xebia.com/2009/12/22/integrating-tivoli-access-manager-with-jboss-as-4-x/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 08:13:45 +0000</pubDate>
		<dc:creator>Mark Bakker</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Middleware]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Opensource]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=3923</guid>
		<description><![CDATA[Introduction Currently I am working at a big Enterprise where they use Tivoli Access Manager as authorization and authentication source for a lot of there applications. This Enterprise is using JBoss as open source application server platform and is using this more and more. When they began using JBoss they got a TAM plug-in for [...]]]></description>
			<content:encoded><![CDATA[<h4>Introduction</h4>
<p>Currently I am working at a big Enterprise where they use Tivoli Access Manager as authorization and authentication source for a lot of there applications.</p>
<p>This Enterprise is using JBoss as open source application server platform and is using this more and more. When they began using JBoss they got a TAM plug-in for JBoss from IBM. This plug-in did the complete authorization and authentication by implementing JAAS and registering all the used security roles in TAM. This is done during deployment time.</p>
<p>If you have an application with a lot of roles this is very frustrating because it can take a lot of extra time to start up (think of 30 minutes per application) because TAM is synchronizing all the new roles.</p>
<p>Most applications at this customer are using JAAS but do not have special method level authorizations implemented by using TAM. So only the roles are important.</p>
<p>After realizing this I thought is could be a good idea to create a simpler solution for integration TAM and JBoss. For this I wrote some custom code (only 250 lines).</p>
<p><span id="more-3923"></span></p>
<h4>Things to keep in mind</h4>
<p>This method is using the iv-user and iv-groups headers at http transport level. Without transport level security (i.e. ssl) it is possible to fake this by using a man in the middle attack.</p>
<p>If you have proper firewall rules and security zones this does not have to be a problem.</p>
<p>When using this method you can use a mapping file for mapping TAM roles to application roles. With the TAM module this can be centrally managed. But since these roles normally only change at deployment time I don’t think this is a real problem.</p>
<p><strong><em><br />
</em></strong></p>
<h4>The steps to use this solution</h4>
<p>In the following overview you see the steps you need to take, after this overview I will go into detail for each step.</p>
<p><a href="http://blog.xebia.com/wp-content/uploads/2009/12/clip_image002.jpg"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="clip_image002" src="http://blog.xebia.com/wp-content/uploads/2009/12/clip_image002_thumb.jpg" border="0" alt="clip_image002" width="643" height="483" /></a></p>
<p><strong><br />
</strong></p>
<h5>Step 0</h5>
<p>Download the plugin including all sources <a title="here" href="http://blog.xebia.com/wp-content/uploads/2009/12/jbossssotam.zip">here</a>.</p>
<h5>Step 1</h5>
<p>Add the jboss_sso_tam.jar file to the server classpath (server/[profile]/lib)</p>
<h5>Step 2</h5>
<p>Set the authorization method to BASIC in the web.xml inside the application (application.war/WEB-INF/web.xml).</p>
<p>Set the roles in the web.xml (or in annotations). See <a href="http://java.sun.com/javaee/5/docs/tutorial/doc/bncav.html">http://java.sun.com/javaee/5/docs/tutorial/doc/bncav.html</a> for more information about security roles in Java.</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="711" valign="top"><em>&lt;login-config&gt;</em><em>&lt;auth-method&gt;<strong>BASIC</strong>&lt;/auth-method&gt;</em></p>
<p><em>…</em></p>
<p><em>&lt;/login-config&gt;</em></p>
<p><em> </em></p>
<p><em>&lt;security-role&gt;</em></p>
<p><em>&lt;role-name&gt;<strong>JBossAdmin</strong>&lt;/role-name&gt;</em></p>
<p><em>&lt;/security-role&gt;</em></td>
</tr>
</tbody>
</table>
<p>web.xml</p>
<h5>Step 3</h5>
<p>Add the TAM JBoss authorization Valve to the web deployer (apache). This can be done by editing jboss.web-deployer/META-INF/jboss-service.xml inside the deploy directory inside a server profile.</p>
<p>This authorization Valve is called before the servlet or static content is called for each request. It is important that the key is set to the same value as the authorization method in the web.xml inside the application (see step 2).</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="711" valign="top">&lt;attribute name=&#8221;Authenticators&#8221; serialDataType=&#8221;jbxb&#8221;&gt;…</p>
<p><strong> </strong>&lt;java:property&gt;</p>
<p>&lt;java:key&gt;<strong>BASIC</strong>&lt;/java:key&gt;</p>
<p>&lt;java:value&gt;<strong>com.infra.tam.jboss.TamJBossSSOValve</strong></p>
<p>&lt;/java:value&gt;</p>
<p>&lt;/java:property&gt;</p>
<p>&lt;/attribute&gt;</td>
</tr>
</tbody>
</table>
<p>Jboss-service.xml</p>
<p><strong><br />
</strong></p>
<h5>Step 4</h5>
<p>Edit the login-config.xml file inside the server/[profle]/conf directory. Here you have to add the login-module to the application-policy which is used. In this example case I edited the jmx-console policy. The security domain for an application defaults to the name of the war or ear file. (i.e. jmx-console.war à jmx-console).</p>
<p>You can override the security domain in a jboss-web.xml file in the WEB-INF directory of an application.</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="711" valign="top"><em>&lt;application-policy name = “jmx-console&#8221;&gt;</em><em>&lt;authentication&gt;</em></p>
<p><em>&lt;application-policy name = &#8220;jmx-console&#8221;&gt;</em></p>
<p><em>&lt;authentication&gt;</em></p>
<p><strong><em> </em></strong><em>&lt;login-module code=&#8221;<strong>com.infra.tam.jboss.TamJBossSSOLoginModule</strong>“</em></p>
<p><em>flag = &#8220;required&#8221;&gt;</em></p>
<p><strong><em>&lt;module-option name=&#8221;tamrolesProperties&#8221;&gt;</em></strong></p>
<p><strong><em>props/tamroles.properties&lt;/module-option&gt;</em></strong></p>
<p><strong><em> </em></strong><em>&lt;/login-module&gt;</em></p>
<p><em>&lt;/authentication&gt;</em></p>
<p><em>&lt;/application-policy&gt;</em></td>
</tr>
</tbody>
</table>
<p>login-config.xml</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="711" valign="top"><em>&lt;jboss-web&gt;</em><em>&lt;security-domain&gt;java:/jaas/jmx-console&lt;/security-domain&gt;</em></p>
<p><em>&lt;/jboss-web&gt;</em></td>
</tr>
</tbody>
</table>
<p>jboss-web.xml</p>
<p>After editing the login-config.xml file it is possible to use a mapping file for mapping the tam roles to application roles. Default you can use the server/[profile]/conf/props/tamroles.properties file for this.</p>
<p>The name of this file can be overridden with a module-option tag with the name tamrolesProperties<strong><em>.</em></strong></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="711" valign="top">TAM_ROLE_A=AppRoleATAM_ROLE_B=AppRoleB</p>
<p>…</td>
</tr>
</tbody>
</table>
<p>tamroles.properties</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/12/22/integrating-tivoli-access-manager-with-jboss-as-4-x/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F12%2F22%2Fintegrating-tivoli-access-manager-with-jboss-as-4-x%2F&amp;title=Integrating%20Tivoli%20Access%20Manager%20with%20JBoss%20AS%204.x" id="wpa2a_10"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/12/22/integrating-tivoli-access-manager-with-jboss-as-4-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.xebia.com/author/mbakker/feed/ ) in 1.17395 seconds, on Feb 9th, 2012 at 4:03 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 9th, 2012 at 5:03 pm UTC -->
