<?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>Werx Limited &#187; java</title>
	<atom:link href="http://werxltd.com/wp/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://werxltd.com/wp</link>
	<description>We make IT work.</description>
	<lastBuildDate>Thu, 29 Jul 2010 19:00:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Simple JSON-RPC updated to 0.9.7</title>
		<link>http://werxltd.com/wp/2010/06/01/simple-json-rpc-updated-to-0-9-7/</link>
		<comments>http://werxltd.com/wp/2010/06/01/simple-json-rpc-updated-to-0-9-7/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 12:00:19 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[json-rpc]]></category>
		<category><![CDATA[rpc]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=604</guid>
		<description><![CDATA[Simple JSON-RPC has been updated to 0.9.7. This new version includes the ability to enable using full class names rather than simple method names. This makes using multiple classes with the same public method names possible. To enable this functionality simply add an init-param to your web.xml file like: &#60;init-param&#62; &#60;param-name&#62;use_full_classname&#60;/param-name&#62; &#60;param-value&#62;true&#60;/param-value&#62; &#60;/init-param&#62; With this [...]]]></description>
			<content:encoded><![CDATA[<p>Simple JSON-RPC has been updated to 0.9.7. This new version includes the ability to enable using full class names rather than simple method names. This makes using multiple classes with the same public method names possible.</p>
<p>To enable this functionality simply add an <a href="http://www.factorypattern.com/storing-parameters-in-webxml-context-param-init-param/">init-param</a> to your <a href="http://en.wikipedia.org/wiki/WAR_(Sun_file_format)">web.xml</a> file like:</p>
<pre class="brush:xml">
&lt;init-param&gt;
	&lt;param-name&gt;use_full_classname&lt;/param-name&gt;
	&lt;param-value&gt;true&lt;/param-value&gt;
&lt;/init-param&gt;
</pre>
<p>With this feature enabled, you then call methods via their full classname + method name separated by a dot (this nomenclature is for both static as well as non-static methods, the framework handles the particulars in the back-end).</p>
<p>Special thanks to Stephan of <a href="http://www.crosspollinate.org/">Cross Pollinate</a> for suggesting this improvement!</p>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2010/06/01/simple-json-rpc-updated-to-0-9-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bible Flashcards for Android 1.0</title>
		<link>http://werxltd.com/wp/2010/05/20/bible-flashcards-for-android-1-0/</link>
		<comments>http://werxltd.com/wp/2010/05/20/bible-flashcards-for-android-1-0/#comments</comments>
		<pubDate>Thu, 20 May 2010 12:00:56 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[bible]]></category>
		<category><![CDATA[educational]]></category>
		<category><![CDATA[flashcard]]></category>
		<category><![CDATA[greek]]></category>
		<category><![CDATA[hebrew]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=595</guid>
		<description><![CDATA[Bible Flashcards is an Android application based on the data files provided by the Crosswire Bible Society&#8216;s Flashcard application. It contains flashcards for both Greek and Hebrew along with appropriate fonts for proper display. I&#8217;ve also included an additional lesson set titled &#8220;greekBasics&#8221; which includes flashcards for the Greek alphabet. Here are some screenshots: You [...]]]></description>
			<content:encoded><![CDATA[<p>Bible Flashcards is an Android application based on the data files provided by the <a href="http://www.crosswire.org">Crosswire Bible Society</a>&#8216;s <a href="http://www.crosswire.org/flashcards/">Flashcard application</a>. It contains flashcards for both Greek and Hebrew along with appropriate fonts for proper display.</p>
<p>I&#8217;ve also included an additional lesson set titled &#8220;greekBasics&#8221; which includes flashcards for the Greek alphabet.</p>
<p>Here are some screenshots:</p>
<div style="float: left;"><img class="alignleft size-medium wp-image-594" style="margin-left: 5px; margin-right: 5px;" title="lessonset_chooser" src="http://werxltd.com/wp/wp-content/uploads/2010/05/lessonset_chooser-168x300.png" alt="" width="168" height="300" /><img class="alignleft size-medium wp-image-593" style="margin-left: 5px; margin-right: 5px;" title="lesson_chooser" src="http://werxltd.com/wp/wp-content/uploads/2010/05/lesson_chooser-168x300.png" alt="" width="168" height="300" /><img class="alignleft size-medium wp-image-590" style="margin-left: 5px; margin-right: 5px;" title="card_front_vertical" src="http://werxltd.com/wp/wp-content/uploads/2010/05/card_front_vertical-168x300.png" alt="" width="168" height="300" /><img class="alignleft size-medium wp-image-589" style="margin-left: 5px; margin-right: 5px;" title="card_back_vertical" src="http://werxltd.com/wp/wp-content/uploads/2010/05/card_back_vertical-168x300.png" alt="" width="168" height="300" /></div>
<div style="clear: both;">You can find Bible Flashcards in the Android app Market by entering &#8220;Bible Flashcards&#8221; or by scanning the barcode below:<br />
<img src="http://werxltd.com/wp/wp-content/plugins/wp-qrencoder/qr_img.php?d=http://market.android.com/search?q=pname:com.werxltd.bibleflash&#038;t=other&#038;s=4&#038;s=M" /></p>
<p>Additionally, if you are interested in helping out with new lessons or if you would like to provide feedback, please feel free to email me.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2010/05/20/bible-flashcards-for-android-1-0/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Learning Languages: Java</title>
		<link>http://werxltd.com/wp/2010/05/18/learning-languages-java/</link>
		<comments>http://werxltd.com/wp/2010/05/18/learning-languages-java/#comments</comments>
		<pubDate>Tue, 18 May 2010 12:00:56 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[enviroment]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=532</guid>
		<description><![CDATA[The first thing you&#8217;ll need to consider is the development environment you want to use primarily. This is important as it will have an impact on how you run through tutorials and examples later on. Environments can be broken down into two broad categories; command-line or a visual IDE. Both have their merits and you&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>The first thing you&#8217;ll need to consider is the development environment you want to use primarily. This is important as it will have an impact on how you run through tutorials and examples later on.</p>
<p>Environments can be broken down into two broad categories; command-line or a <a href="http://en.wikipedia.org/wiki/Integrated_development_environment">visual IDE</a>. Both have their merits and you&#8217;ll eventually need to be familiar with both (especially if you expect to be releasing production code or participating in any well-maintained development environment).</p>
<p>The most common command-line environments are <a href="http://maven.apache.org/">Maven</a> and <a href="http://ant.apache.org/ivy/">Ivy</a>. Both come with a somewhat steep learning curve (which, unfortunately is unavoidable) but both are well worth investigating as they are both very common in production environments.</p>
<p>Starting out, however, you&#8217;ll most likely find that using a visual IDE will help you get right down to learning and compiling example code fairly quickly.</p>
<p>There are several common IDEs; <a href="http://www.jetbrains.com/idea/">IntelliJ</a>, <a href="http://netbeans.org/">NetBeans</a>, and <a href="http://www.eclipse.org">Eclipse</a> are all great ones that I&#8217;ve seen used in production. My favorite hands-down is Eclipse, especially since it also has configurations to help you develop in other languages such as  <a href="http://www.aptana.org/">PHP (Aptana)</a> and <a href="http://www.eclipse.org/cdt/">C/C++</a>.</p>
<p>For general basics and a broad overview of Java; I would recommend you take a look at <a href="http://www.javabeginner.com/">the Java Beginner site</a>.</p>
<p>There&#8217;s also several handy video tutorials (mostly using Eclipse) on YouTube such as this one:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/UGmhks4K13g&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/UGmhks4K13g&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Once you get the basics down, I&#8217;ve found that working on a full project helps. A great place to start would be to help our with an existing open-source project like <a href="http://www.crosswire.org/jsword/">JSword</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2010/05/18/learning-languages-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple HBase query bridge</title>
		<link>http://werxltd.com/wp/2010/03/25/simple-hbase-query-bridge/</link>
		<comments>http://werxltd.com/wp/2010/03/25/simple-hbase-query-bridge/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 12:00:43 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[hbase]]></category>
		<category><![CDATA[interoperability]]></category>
		<category><![CDATA[json-rpc]]></category>
		<category><![CDATA[map reduce]]></category>
		<category><![CDATA[mapreduce]]></category>
		<category><![CDATA[servlet]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=522</guid>
		<description><![CDATA[I&#8217;ve recently released a simple json-rpc query bridge (using our own simple json-rpc framework) for HBase at http://code.google.com/p/hbasebridge/ You can use this bridge to query HBase for either the current record or the last few versions of a record. To see the methods http://localhost:8080/hbasebridge/rpc?debug=true Which returns a list of usable RPC methods: { "jsonrpc": "2.0", "result": [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently released a simple json-rpc query bridge (using our own <a href="http://werxltd.com/wp/portfolio/json-rpc/simple-java-json-rpc/">simple json-rpc framework</a>) for <a href="http://hadoop.apache.org/hbase/">HBase </a>at <a href="http://code.google.com/p/hbasebridge/">http://code.google.com/p/hbasebridge/</a></p>
<p>You can use this bridge to query HBase for either the current record or the last few versions of a record.</p>
<p>To see the methods</p>
<pre>http://localhost:8080/hbasebridge/rpc?debug=true</pre>
<p>Which returns a list of usable RPC methods:</p>
<pre class="brush:javascript">{
  "jsonrpc": "2.0",
  "result": {"method": [
    {
      "class": "com.werxltd.hbasebridge.HBaseInfo",
      "name": "listtables",
      "params": [],
      "returns": "org.json.JSONObject",
      "static": false
    },
    {
      "class": "com.werxltd.hbasebridge.HadoopInfo",
      "name": "clusterstatus",
      "params": [],
      "returns": "org.json.JSONObject",
      "static": false
    },
    {
      "class": "com.werxltd.hbasebridge.HadoopInfo",
      "name": "jobstatus",
      "params": [],
      "returns": "org.json.JSONObject",
      "static": false
    },
    {
      "class": "com.werxltd.jsonrpc.RPC",
      "name": "listrpcmethods",
      "params": [],
      "returns": "org.json.JSONObject",
      "static": false
    },
    {
      "class": "com.werxltd.hbasebridge.TableLookup",
      "name": "lookup",
      "params": ["org.json.JSONObject"],
      "returns": "org.json.JSONObject",
      "static": false
    }
  ]}
}</pre>
<p>To list tables:</p>
<pre>http://localhost:8080/hbasebridge/rpc?debug=true&#038;method=listtables</pre>
<p>Which returns:</p>
<pre class="brush:javascript">
{
  "jsonrpc": "2.0",
  "result": {"tables": [
    "mytable"
  ]}
}
</pre>
<p>To get the current status of the cluster:</p>
<pre>http://localhost:8080/hbasebridge/rpc?debug=true&#038;method=clusterstatus</pre>
<p>Which returns:</p>
<pre class="brush:javascript">{
  "jsonrpc": "2.0",
  "result": {
    "activetrackernames": [
      "trackernode1:localhost/127.0.0.1:33455",
      "trackernode2:localhost/127.0.0.1:54616",
    ],
    "blacklistedtrackernames": [],
    "blacklistedtrackers": 0,
    "jobqueues": {"queues": [{
      "jobs": [
        {
          "cleanuptasks": [{"state": ""}],
          "complete": false,
          "filename": "hdfs://hadoophdfsnode:9000/data/hadoop/mapred/system/job_201003191557_0442/job.xml",
          "jobpriority": "normal",
          "mapprogress": 1,
          "name": "My mapreduce job",
          "reduceprogress": 0.9819000363349915,
          "runstate": "running",
          "schedulinginfo": "NA",
          "setupprogress": 1,
          "starttime": 1269024863960,
          "username": "hadoop-admin"
        }
      ],
      "name": "default"
    }]},
    "jobtrackerstate": "running",
    "maptasks": 1,
    "maxmaptasks": 116,
    "maxmemory": 2079719424,
    "maxreducetasks": 58,
    "reducetasks": 16,
    "tasktrackers": 34,
    "ttyexpiryinterval": 600000,
    "usedmemory": 969170944
  }
}</pre>
<p>Key/Value Query:</p>
<pre>http://localhost:8080/hbase_tape/rpc?debug=true&#038;data={"method":"lookup","params":{"table":"tablename","keys":["mykey"]}}</pre>
<p>Results:</p>
<pre class="brush:javascript">
{
  "jsonrpc": "2.0",
  "result": {"rows": [{"mykey": {
    "family:col": "myvalue"
  }}]}
}
</pre>
<p>Key/Value query with versions:</p>
<pre>http://localhost:8080/hbase_tape/rpc?debug=true&#038;data={"method":"lookup","params":{"table":"tablename","keys":["mykey"],versions:2}}</pre>
<p>Results:</p>
<pre class="brush:javascript">
{
  "jsonrpc": "2.0",
  "result": {"rows": [{"mykey": {
    "family:col": [{
      "value": "myval",
      "version": 123456789
    }],
    "family:col": [{
      "value": "myoldval",
      "version": 123456788
    }]
  }}]}
}
</pre>
<p>The code should also provide a handy reference for anyone who wants to learn how to query HBase and scrape <a href="http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html">Result</a> objects for values without knowing family or column names in advance.</p>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2010/03/25/simple-hbase-query-bridge/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple Java implementation of JSON-RPC</title>
		<link>http://werxltd.com/wp/2009/12/29/simple-java-implantation-of-json-rpc/</link>
		<comments>http://werxltd.com/wp/2009/12/29/simple-java-implantation-of-json-rpc/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 12:00:49 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[json-rpc]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[pom]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[war]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=323</guid>
		<description><![CDATA[Preamble Explanation of standard formats and protocols: JSON (JavaScript Object Notation) is a lightweight1 data-interchange format with language bindings for C, C++, C#, Java, JavaScript, Perl, TCL and many others. JSON-RPC is a simple remote procedure call protocol similar to XML-RPC although it uses the lightweight JSON format instead of XML. What is it? I [...]]]></description>
			<content:encoded><![CDATA[<h2>Preamble</h2>
<p>Explanation of standard formats and protocols:</p>
<ul>
<li><strong><a href="http://www.json.org/">JSON</a></strong> (JavaScript Object Notation) is a lightweight<sup>1</sup> data-interchange format with language bindings for C, C++, C#, Java, JavaScript, Perl, TCL and many others.</li>
<li><strong><a href="http://json-rpc.org/">JSON-RPC</a></strong> is a simple remote procedure call protocol similar to <a href="http://www.xmlrpc.com/">XML-RPC</a> although it uses the lightweight <a href="http://www.json.org/">JSON</a> format instead of <a href="http://en.wikipedia.org/wiki/XML">XML</a>.</li>
</ul>
<h2>What is it?</h2>
<p>I love the simplicity of <a href="http://json-rpc.org/">JSON-RPC</a> when it comes to rapidly devloping cutting-edge web applications.</p>
<p>I recently decided to start writing more server-side code in <a href="http://en.wikipedia.org/wiki/Java_Servlet">Java servlets</a> in order to take advantage of cloud-based infrastructures such as the <a href="http://code.google.com/appengine/">Google App Engine</a>. Until now I have written my web applications using <a href="http://php.net/">PHP</a> as the server-side language. Specifically using frameworks such as <a href="http://www.symfony-project.org/">Symfony</a> or <a href="http://www.kohanaphp.com/">Kohana</a>, which makes writing simple JSON-RPC services relatively trivial.</p>
<p>So I started looking for a simple JSON-RPC system I could use in Java to abstract my business logic classes from the mundane tasks associated with handling web requests. I found several packages which all claimed to implement the JSON-RPC protocol via Java servlets, however they seemed to require far more by way of setup than I wanted and they all seemed to require the developer to write applications to their specific implementation&#8217;s standards.<sup>2</sup></p>
<p>So I decided to write yet another Java implementation of the JSON-RPC specification myself with the following goals in mind:</p>
<ul>
<li>Easy to implement. Setup for this package should be kept at a minimum. This includes both development as well as production setup.</li>
<li>Easy to code in. Application developers using this class should not need to know much about JSON-RPC beyond exposing methods in their code that can be called remotely from other applications via the web.</li>
<li>Non-invasive. Developers using this implementation should be able to reuse <a href="http://en.wikipedia.org/wiki/Plain_Old_Java_Object">plain old Java object</a> (POJO) classes as much as possible, making the transport layer of JSON-RPC as transparent as possible.</li>
</ul>
<p>With these goals in mind I set off to develop the package com.werxltd.jsonrpc to be a simple wrapper designed to be used inside of a <a href="http://mindprod.com/jgloss/warfile.html">standard .war project</a>.</p>
<h2>Setting it up</h2>
<p>You can either <a href="http://maven.werxltd.com/com/werxltd/jsonrpc/0.9/jsonrpc-0.9.jar">download the .jar file here</a> to include in your project manually or (and this is my preferred method) you can import the com.werxltd.jsonrpc package as a dependency in your Maven-managed project by specifying the following in your project&#8217;s <a href="http://maven.apache.org/pom.html">pom.xml</a> configuration file:</p>
<pre class="brush:xml">&lt;repositories&gt;
    &lt;repository&gt;
        &lt;id&gt;werxltd&lt;/id&gt;
        &lt;url&gt;http://maven.werxltd.com &lt;/url&gt;
        &lt;snapshots&gt;
            &lt;enabled&gt;true&lt;/enabled&gt;
        &lt;/snapshots&gt;
        &lt;releases&gt;
           &lt;enabled&gt;true&lt;/enabled&gt;
       &lt;/releases&gt;
    &lt;/repository&gt;
&lt;/repositories&gt;

&lt;dependencies&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;com.werxltd&lt;/groupId&gt;
        &lt;artifactId&gt;jsonrpc&lt;/artifactId&gt;
        &lt;version&gt;0.9&lt;/version&gt;
    &lt;/dependency&gt;
&lt;/dependencies&gt;</pre>
<p>Next, you&#8217;ll need to specify endpoints in your .war file&#8217;s <a href="http://en.wikipedia.org/wiki/WAR_(Sun_file_format)">web.xml</a> configuration file. Here&#8217;s an example:</p>
<pre class="brush:xml">&lt;web-app&gt;
    &lt;servlet&gt;
        &lt;servlet-name&gt;example&lt;/servlet-name&gt;
        &lt;servlet-class&gt;com.werxltd.jsonrpc.RPC&lt;/servlet-class&gt;
        &lt;init-param&gt;
            &lt;param-name&gt;rpcclasses&lt;/param-name&gt;
            &lt;param-value&gt;YourClass&lt;/param-value&gt;
        &lt;/init-param&gt;
    &lt;/servlet&gt;

    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;example&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/example&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
&lt;/web-app&gt;</pre>
<p>That&#8217;s it! Now your project is configured to filter all requests sent to /example through the JSON-RPC class which examines the class name you passed in (in this case, YourClass) for public methods it can expose. An instance of your class is created internally if your class is not static and it will remain in memory throughout the life of the servlet. Any exceptions your class generates are gracefully wrapped inside a JSON-RPC error message for proper handling upstream.</p>
<h2>Using it</h2>
<p>While the setup is pretty much straightforward, due to the loose typing found in JavaScript (and, as a result, JSON) there are some caveats in how methods are called. Specifically in how arguments are passed to those methods.</p>
<p>Scanned methods are stored internally with a signature consisting of the method name and how many arguements that method accepts. When a JSON-RPC request is made, the servlet determines how many parameters were included and attempts to match the method requested with a corresponding internal method which has the same number of parameters/arguements.</p>
<p>Because parameters are passed in via the web, only Java primitive data types along with three others, <a href="http://www.json.org/javadoc/org/json/JSONObject.html">JSONObject</a>, <a href="http://www.json.org/javadoc/org/json/JSONArray.html">JSONArray</a> and <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html">java.lang.String</a> are accepted as valid parameter data types.</p>
<p>If a match of method name and number of parameters is found, an attempt is made to parse the passed-in data into the method&#8217;s required type. Any methods which accept as their first parameter a parameter of the JSONObject type, this method automatically takes prescience over all other parameters.</p>
<p>To use the JSON-RPC interface from another application, you must pass a valid JSON-RPC object to your final servlet as a parameter named &#8220;json&#8221; via either GET or POST. Here is an example of the valid JSON-RPC object you need to pass:</p>
<pre class="brush:javascript">{
    "method":"add",
    "params":[1 2 3]
}</pre>
<p>This JSON-RPC implementation accepts either named parameters or positional parameters like the ones shown above. Here is a named parameters example:</p>
<pre class="brush:javascript">{
    "method":"echo",
    "params":{
        "text":"testing"
    }
}</pre>
<h2>The road ahead</h2>
<p>Future development of this class will include more formalized access between the JSON-RPC layer and the underlying classes.</p>
<p>I&#8217;m also planning to post the <a href="http://en.wikipedia.org/wiki/Javadoc">Javadocs</a> and the source to an example project that utilizes the JSON-RPC transport package.</p>
<p>Hope this helps someone else. I&#8217;m looking forward to using this class as a central component in many <a href="http://en.wikipedia.org/wiki/Rich_Internet_application">rich web projects</a> I have planned.</p>
<ol class="footnotes"><li id="footnote_0_323" class="footnote">Lightweight in both size and resources required to process data encoded in JSON vs. XML.</li><li id="footnote_1_323" class="footnote">I did find <a href="http://software.dzhuvinov.com/json-rpc-2.0-base-java-classes.html">this project</a> after finishing the first revision of my class. It looks great and like it would do much of what I wanted, however the code is proprietary. After I finish documenting my classes I plan on releasing them under an <a href="http://www.opensource.org/licenses">OSI-approved licence</a>. If you are interested in helping me with this project, feel free to let me know!</li></ol>]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/12/29/simple-java-implantation-of-json-rpc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Maven and Eclipse to play together</title>
		<link>http://werxltd.com/wp/2009/12/24/getting-maven-and-eclipse-to-play-together/</link>
		<comments>http://werxltd.com/wp/2009/12/24/getting-maven-and-eclipse-to-play-together/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 12:00:35 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[development enviroment]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[project management]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=307</guid>
		<description><![CDATA[I love using Maven for dependency management and code portability, and I love Eclipse as an enviroment to develop in. However, for the longest time I had trouble getting the two to play well together until I discovered the following commands that made combining the two much easier. To add Maven repositories to your Eclipse [...]]]></description>
			<content:encoded><![CDATA[<p>I love using <a href="http://maven.apache.org/">Maven</a> for dependency management and code portability, and I love <a href="http://www.eclipse.org/">Eclipse</a> as an enviroment to develop in. However, for the longest time I had trouble getting the two to play well together until I discovered the following commands that made combining the two much easier.</p>
<p>To add Maven repositories to your Eclipse workspace (for code completion and syntax verification) run the following command:</p>
<pre class="brush:bash">mvn -Declipse.workspace=/path/to/workspace eclipse:add-maven-repo</pre>
<p>To add an Eclipse .project file to your project run the following command:</p>
<pre class="brush:bash">mvn eclipse:eclipse</pre>
<p>That&#8217;s it! You should now be able to import the project into Eclispe. I haven&#8217;t figured out how to build Maven projects in Eclipse yet<sup>1</sup> so building and testing your code still requires you to use Maven via the command line.</p>
<p>You&#8217;ll also need to re-create the Eclipse project file if you add any dependencies in order for them to be picked up properly in Eclipse.</p>
<p>Need more? <a href="http://m2eclipse.sonatype.org/">Check out this site</a> for more on Maven integration in Eclipse</p>
<ol class="footnotes"><li id="footnote_0_307" class="footnote">I&#8217;ve seen the plugins but haven&#8217;t gotten any to work well enough to rely on.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/12/24/getting-maven-and-eclipse-to-play-together/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running PHP in Java</title>
		<link>http://werxltd.com/wp/2009/10/06/running-php-in-java/</link>
		<comments>http://werxltd.com/wp/2009/10/06/running-php-in-java/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 21:25:54 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php in the cloud]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=227</guid>
		<description><![CDATA[Many might consider even the thought of running PHP inside of a Java Virtual Machine to be anathema. Others will wonder why bother (apart from the novelty). However running PHP in Java has one crucal benefit: it future-proofs your code. Quercus is a nifty utility that will allow you to run PHP code in clouds such [...]]]></description>
			<content:encoded><![CDATA[<p>Many might consider even the thought of running <a href="http://www.php.net/">PHP</a> inside of a <a href="http://en.wikipedia.org/wiki/Java_Virtual_Machine">Java Virtual Machine</a> to be anathema. Others will wonder why bother (apart from the novelty). However running PHP in Java has one crucal benefit: it future-proofs your code.</p>
<p><a href="http://caucho.com/resin/doc/quercus.xtp">Quercus</a> is a nifty utility that will allow you to run PHP code in clouds such as <a href="http://blog.caucho.com/?p=187">Google App Engine</a><sup>1</sup>. This means your <a href="http://drupal.org/">Drupal</a> and <a href="http://wordpress.org/">WordPress</a> sites can now be distributed across a highly avaliable and scalable cloud infrustructure.</p>
<p>Now if we can only get an <a href="http://en.wikipedia.org/wiki/Model–view–controller">MVC</a> framework like <a href="http://kohanaphp.com/">Kohana</a> or <a href="http://www.symfony-project.org/">Symfony</a> to work on top of this system..</p>
<ol class="footnotes"><li id="footnote_0_227" class="footnote">Other great articles on running PHP in Google&#8217;s App Engine can be found <a href="http://www.phpclasses.org/blog/post/92-Running-PHP-on-Google-App-Engine.html">here</a> and <a href="http://www.webdigi.co.uk/blog/2009/run-php-on-the-google-app-engine/">here</a>. <a href="http://www.ibm.com/developerworks/web/library/wa-quercus/index.html?ca=dgr-twtrQuercusdth-WD&amp;S_TACT=105AGY46&amp;S_CMP=TWDW">IBM has also highlighted</a> this utility.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/10/06/running-php-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with Hadoop and MapReduce</title>
		<link>http://werxltd.com/wp/2009/08/26/getting-starte-with-hadoop-and-mapreduce/</link>
		<comments>http://werxltd.com/wp/2009/08/26/getting-starte-with-hadoop-and-mapreduce/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 18:12:58 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[it industry]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[distributed computing]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mapreduce]]></category>
		<category><![CDATA[pyhon]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=175</guid>
		<description><![CDATA[Recently I&#8217;ve been studying several technologies that appear to form the core of cloud computing. In short, these are the technologies behind such technological marvels as Amazon, Google, Facebook, Yahoo, NetFlix, Pixar, etc.1 Since each of these technologies by themselves is worthy of a new book, and since even those familiar with the common implementation [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been studying several technologies that appear to form the core of cloud computing. In short, these are the technologies behind such technological marvels as <a href="http://amazon.com">Amazon</a>, <a href="http://google.com">Google</a>, <a href="http://facebook.com">Facebook</a>, <a href="http://yahoo.com">Yahoo</a>, <a href="http://netflix.com">NetFlix</a>, <a href="http://www.pixar.com/">Pixar</a>, etc.<sup>1</sup></p>
<p>Since each of these technologies by themselves is worthy of a new book, and since even those familiar with the common implementation languages of these technologies (like Java and Python), I decided to put together all the resources I&#8217;ve found on these technologies in hopes that they will help someone else get started in this fascinating world of distributed or &#8220;cloud computing&#8221;.</p>
<h3>Introduction to cloud computing</h3>
<p>One might wonder why they should take the time to learn these technologies and concepts. A fair question to ask considering the amount of time and energy that will potentially be required in order to put any of this knowledge to any functional use. With that in mind I found the following videos particularly helpful in answering the question &#8220;why should I care?&#8221;:</p>
<ul>
<li>Hadoop, Map Reduce, and Big Data Sets <a href="http://www.youtube.com/watch?v=CMt-IqQlnQ8">Part 1</a>, <a href="http://www.youtube.com/watch?v=YtkaDQOuJ4k&amp;feature=related">Part 2</a></li>
<li><a href="http://www.youtube.com/watch?v=Aq0x2z69syM">O&#8217;Reilly Webcast: An Introduction to Hadoop</a></li>
<li><a href="http://www.youtube.com/watch?v=MXoMWC6xPUw">Computing in the Cloud &#8211; Introduction</a></li>
</ul>
<h3>Hadoop</h3>
<p><a href="http://hadoop.apache.org/">Hadoop</a><sup>2</sup> is essentially a compilation of a number of different projects  that make distributed computing a lot less painful. The best source of beginner&#8217;s information on Hadoop I&#8217;ve found has come from these Google lectures as well as from <a href="http://www.cloudera.com">Cloudera</a>&#8216;s <a href="http://www.cloudera.com/hadoop-training">training pages</a>:</p>
<ul>
<li><a href="http://www.cloudera.com/hadoop-training-programming-with-hadoop">Programming with Hadoop</a></li>
</ul>
<h3>MapReduce</h3>
<p>MapReduce is more of a paradigm than a language. It is a way to write algorithms that can be run in parallel in order to utilize the computing power of a number of computers across a large data set. There are a number of software frameworks that make writing MapReduce jobs a lot easier and in the following videos you will learn how to use some of the most common.</p>
<ul>
<li>Cluster Computing and MapReduce <a href="http://www.youtube.com/watch?v=yjPBkvYh-ss">Lecture 1</a>, <a href="http://www.youtube.com/watch?v=-vD6PUdf3Js&amp;feature=channel">Lecture 2</a>, <a href="http://www.youtube.com/watch?v=5Eib_H_zCEY&amp;feature=related">Lecture 3</a>, <a href="http://www.youtube.com/watch?v=1ZDybXl212Q&amp;feature=related">Lecture 4</a>, <a href="http://www.youtube.com/watch?v=BT-piFBP4fE&amp;feature=related">Lecture 5</a></li>
<li><a href="http://www.cloudera.com/hadoop-training-mapreduce-hdfs">MapReduce and HDFS</a></li>
<li><a href="http://www.cs.brandeis.edu/~cs147a/lab/hadoop-intro/">Introduction to Hadoop</a> at Brandies University</li>
</ul>
<h3>Quickstart packages</h3>
<p>As with many complex technologies, just setting up a working environment can be a challenge in itself. One that is enough to discourage the causal learner. To help alleviate the stress of setting up a general Hadoop environment to help you start working with Hadoop and the related cloud technologies, as well to help you gain some useful hands-on experience, here are a few resources to help you get a working Hadoop environment going fairly quickly.</p>
<ul>
<li><a href="http://www.youtube.com/watch?v=Y3eL6DfNkTw">Introduction to Cloudera&#8217;s distribution of Hadoop</a></li>
<li><a href="http://www.cloudera.com/hadoop-training-virtual-machine">Cloudera&#8217;s VMWare training image</a>, perfect for quick-access to hands-on examples preconfigured in <a href="http://www.eclipse.org/">Eclipse</a> projects. Requires the free <a href="http://www.vmware.com/products/player/">VMWare Player</a> which works great on Linux and Windows.</li>
<li><a href="http://www.opensolaris.org/os/project/livehadoop/;jsessionid=76A7D3B6D9C487EB1D7075F8EE938FDE">OpenSolaris Hadoop LiveCD</a>, works great in <a href="http://www.virtualbox.org/">VirtualBox</a>, can also install distribution to disk for a more permanent and dedicated development environment</li>
</ul>
<p>Helpful hint regarding videos: If you are like me and prefer to watch/listen to long lectures in your car or otherwise on the go on your netbook, iPod or other mobile device.  Try looking for the above mentioned videos on Google Video instead of YouTube. Google Video includes a helpful download link that allows you to take a copy of the movie with you.</p>
<ol class="footnotes"><li id="footnote_0_175" class="footnote">This article is a continuation of a recent article I wrote on the <a href="http://werxltd.com/wp/2009/06/29/cloud-computing-101/">different approaches to cloud computing taken by Google and Microsoft</a></li><li id="footnote_1_175" class="footnote">Hadoop was actually inspired by Google, more history and background <a href="http://en.wikipedia.org/wiki/Hadoop">here</a>.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/08/26/getting-starte-with-hadoop-and-mapreduce/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
