<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>John Catherino&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/" />
<modified>2008-06-20T02:58:21Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/cajo/142</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2008, cajo</copyright>
<entry>
<title>Messaging vs. RPC? Let&apos;s fuse &apos;em.</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2008/06/messaging_vs_rp.html" />
<modified>2008-06-20T02:58:21Z</modified>
<issued>2008-06-20T02:58:08Z</issued>
<id>tag:weblogs.java.net,2008:/blog/cajo/142.9997</id>
<created>2008-06-20T02:58:08Z</created>
<summary type="text/plain">The spirited debate following my last post on messaging being degenerate RPC got me thinking; is there some way to combine these two somewhat orthogonal methodologies, to create a unique hybrid approach? A bit of insight led me back to update the original cajo Queue messaging class, and the results were indeed most satisfying.</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Patterns</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[What is the fundamental premise of <a href="http://java.sun.com/developer/technicalArticles/Networking/messaging/">messaging</a>, and how is it different from RPC?<br><br>

Essentially, messaging focuses on the concept of <i>loosely coupled,</i> event/information delivery; between one or more producers, and one or more consumers. RPC focuses on the concept of <i>tightly coupled</i> synchronous functional invocation; between a client and a server. What would happen if we applied <a href="https://cajo.dev.java.net">cajo</a> technology to <i>coalesce</i> these two concepts?<br><br>

This is precisely what the newly updated cajo <a href="https://cajo.dev.java.net/docs/gnu/cajo/utils/extra/Queue.html">Queue</a> class does. Queue instances are initially constructed by providing a topic object. This object is a mutually agreed upon class, between producers and consumers, which provides the context for why the community is using this particular Queue instance. For example: the topic object could be something as simple as a string – "Wine Enthusiasts" or as elaborate as a HashMap of subtopics and values.<br><br>

Consumer objects can be either local or remote to the JVM in which the Queue object is operating, and register using its enqueue method. Producer objects can also be either local or remote, and create events by invoking arbitrary methods on a Queue object reference. These invocations <i>return immediately</i> for producers; and are <i>asynchronously invoked</i> on <u>all</u> registered consumers. The invocation's successful return to the producer, <i>guarantees</i> that the event has been accepted. As the object's name implies; producer invocations are queued, as necessary.<br><br>

For example:

<blockquote><code>
// Producer actions:<br><br>
queue.ping(); // invokes the method ping() on all consumers<br>
queue.position("37.391008, -122.082073"); // new location<br>
queue.fill(x, y, width, height, Color.red); // mask area<br><br>
// note: queue does not implement any of these methods itself<br>
// they are invoked on the consumers, only if they support them
</code></blockquote>

The real gist of <i>fusion</i> takes place in the concept of method invocation on the Queue object. A producer may invoke a method taking no arguments; this is traditional <i>notification messaging.</i> A producer could invoke a method taking a single argument; this is traditional <i>data messaging.</i> Finally, a producer could invoke methods taking multiple arguments; this is traditional RPC, but <i>loosely coupled,</i> i.e. <i>functional  messaging</i> -- exhibiting three key features:

<blockquote>
* The function signatures are <i>independent</i> of any class or interface definition<br>
* The potential <i>one-to-many</i> relationship, between the producer and its consumers<br>
* The consumer is not <i>required</i> to implement the functions being invoked by the producer
</blockquote>

The Queue class performs the consumer invocations asynchronously from the producer's; it discards any direct return values, and exceptions from the consumers. Therefore, if the producer wanted feedback from consumers, it could provide a callback reference as an argument, for example.<br><br>

If there is only <i>one</i> producer, and <i>one</i> consumer, this is what is commonly referred to as <i>point-to-point</i> messaging. When there is <i>one or more</i> producers, and <i>more than one</i> consumer; this is what is commonly referred to as <i>publish/subscribe</i> messaging. With the Queue class approach, these are just variations in how the object is used.<br><br>

Lastly, just for fun, the Queue class is serialisable, meaning Queue objects can be passed between JVMs at runtime, <i>(i.e. cloned)</i> whilst retaining <i>all</i> producer <i>and</i> consumer links. The possibilities created by this, are nothing short of <i>mind-boggling.</i> ;-)<br><br>

Best of all, Queue is implemented in a single <a href="https://cajo.dev.java.net/source/browse/cajo/gnu/cajo/utils/extra/Queue.java?rev=1.5&view=markup">class</a>, consisting of less than <u>100 lines of code</u>. I recommend giving it a try; it is extremely simple to use, highly intuitive, and very powerful. It is a handy new tool, to add to your kit.<br><br>

Enjoy,<br><br>

<a href="http://wiki.java.net/bin/view/People/JohnCatherino">John</a>]]>

</content>
</entry>
<entry>
<title>Simple Inter-JVM communication... The Grail!</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2007/09/simple_interjvm.html" />
<modified>2008-02-14T05:05:33Z</modified>
<issued>2007-09-04T00:19:18Z</issued>
<id>tag:weblogs.java.net,2007:/blog/cajo/142.8164</id>
<created>2007-09-04T00:19:18Z</created>
<summary type="text/plain">Announcing a significant breakthrough from the cajo project in the area of dynamic co-operation between Java Virtual Machines. I&apos;ll bet you never thought it could be this easy.</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Distributed</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[I am very pleased to announce a most significant breakthrough from the <a href=https://cajo.dev.java.net>the cajo project</a>, in the ease with which distributed computing can be accomplished in Java; and in only 20 <b><i>kilobytes</i></b>. It works with all JREs, 1.3 and later. (And before you <i>Rocket Scientists</i> out there ask; yes, it's also 64-bit clean ;)<br><br>

<a href=https://cajo.dev.java.net/files/documents/974/64714/Grail.html>Just three methods:</a> (click the link, for greater detail)<br><br>

<blockquote>
<tt>void export(Object object);</tt><br>
This makes any object's public methods remotely callable<br><br>
<tt>Object[] lookup(Class methodSet);</tt><br>
This finds remote objects matching the given interface<br><br>
<tt>Object proxy(Object reference, Class methodSet);</tt><br>
This creates a local proxy for using the remote object<br><br>
</blockquote>

That's it. These allow for complete interoperability between distributed JVMs. It just <i>can't</i> get any easier than this.<br><br>

Any object can be exported for remote object invocation, irrespective of the classes it implements, or interfaces it extends. An exported object can be used by a client, simply if it is compatible with the signature requirements specified by the <u><i>client</i></u>. Argument and return type co&euml;rcion is applied, in compliance with the language specification.</i></u><br><br>

Comfortably, the exported methods can be used with the same syntax and language conventions as local methods. However, it is always well to keep in mind the <a href=http://www.rgoarchitects.com/Files/fallacies.pdf>Eight Fallacies</a> of Distributed Computing. <tt>[pdf warning]</tt><br><br>

Strictly speaking the simple 3 method Grail interface <b><i>could</i></b> be implemented by <i>other</i> distributed frameworks; Jini, EJB, Spring, etc. So I've placed the <a href=https://cajo.dev.java.net/files/documents/974/64638/Grail.java>interface specification</a> into the public domain: To leave that as a bit of an open <b><i><u>challenge</u>!</i></b> ;-)<br><br>

OK, time for an example: <a href=https://cajo.dev.java.net/files/documents/974/66192/Server.java>Server.java</a><br>

<tt><pre>
import <a href=https://cajo.dev.java.net/files/documents/974/64962/Cajo.java>gnu.cajo.Cajo</a>; // The cajo implementation of the Grail

public class Server {
   public static class Test { // remotely callable classes must be public
      public String foo(Object bar, int count) {
         System.out.println("foo called w/ " + bar + ' ' + count + " count");
         return "Thanks";
      }
      public Boolean bar(int count) {
         System.out.println("bar called w/ " + count + " count");
         return Boolean.TRUE;
      }
      public boolean baz() {
         System.out.println("baz called");
         return false;
      }
   } // but needn't be defined in the same class

   public static void main(String args[]) throws Exception { // unit test
      Cajo cajo = new Cajo(1198, null, null);
      cajo.export(new Test());
      System.out.println("Server running");
   }
}
</tt></pre>

Compile via:  javac -cp <a href=https://cajo.dev.java.net/files/documents/974/66455/grail.jar>grail.jar</a>;. Server.java<br>
Execute via:  java  -cp grail.jar;. Server<br><br>

Now for a client: <a href=https://cajo.dev.java.net/files/documents/974/66193/Client.java>Client.java</a>

<tt><pre>
import gnu.cajo.Cajo;

interface ClientSet { // client interfaces need not be public
   void baz();
   boolean bar(Integer quantum);
   Object foo(String barbaz, int foobar);
} // the order of the client method set does not matter

public class Client {
   public static void main(String args[]) throws Exception { // unit test
      Cajo cajo = new Cajo(0, null, null); // port does not matter for clients
      Thread.currentThread().sleep(100); // allow a little discovery time
      Object refs[] = cajo.lookup(ClientSet.class);
      if (refs.length > 0) {
         System.out.println("Found " + refs.length);
         ClientSet cs = (ClientSet)cajo.proxy(refs[0], ClientSet.class);
         cs.baz();
         System.out.println(cs.bar(new Integer(77)));
         System.out.println(cs.foo(null, 99));
      } else System.out.println("No servers found");
      System.exit(0);
   }
}
</tt></pre>

Compile via:  javac -cp grail.jar;. Client.java<br>
Execute via:  java  -cp grail.jar;. Client<br><br>

That's all there is to it. Detailed information, including source code, can be found <a href=https://cajo.dev.java.net/servlets/ProjectDocumentList;jsessionid=6873D9AFED742EE9876EBAEC568F9D72>here</a>, also the main <a href=https://cajo.dev.java.net>project site</a> is a very helpful resource.<br><br>

Technically it's still beta, and will be officially added to the cajo project soon, however there are no known issues at this time. So please feel free to kick the tyres, and take her out for a spin!<br><br>

Enjoy, and as always, your comments and feedback are encouraged.<br><br>

-<a href=http://wiki.java.net/bin/view/People/JohnCatherino>John</a>]]>

</content>
</entry>
<entry>
<title>Dynamic Client Subtyping</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2006/12/dynamic_client.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-12-08T04:44:34Z</issued>
<id>tag:weblogs.java.net,2006:/blog/cajo/142.6124</id>
<created>2006-12-08T04:44:34Z</created>
<summary type="text/plain">As a client, ever need to only use a portion of a service object&apos;s interface? How about small pieces from several of its interfaces? It could really simplify things to use a custom interface, containing only the methods needed. This is Dynamic Client Subtyping; let me show you how it&apos;s done.</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Patterns</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[Given the enthusiastic feedback to the <a href=http://weblogs.java.net/blog/cajo/archive/2006/06/take_that_net.html>Take That .NET!</a> blog entry; I thought I might expound a bit upon a small, but highly important bit, at the end of the <a href=http://wiki.java.net/bin/view/Communications/TransparentProxy>example</a>.<br><br>

Oftentimes service objects implement a large, rich interface. Other times service objects implement several interfaces, grouping their functionality into distinct logical concerns. Quite often, a client needs only to use a small portion of an interface; or perhaps some methods from a few of the logical grouping interfaces, to satisfy its <i>own</i> needs.<br><br>

The ability of a client to define its own interface, from ones defined by the service object, is known as <a href=http://en.wikipedia.org/wiki/Subtype>subtyping</a> in Java. <i>(in contrast to subclassing)</i> However, unlike conventional Java subtyping; Dynamic Client Subtyping means creating an entirely <i>different</i> interface. What makes this subtyping dynamic, is that it works with the original, unmodified service object.<br><br>

This can be a very <i>potent</i> technique, for client-side complexity management.<br><br>

Doubtlessly, an example would help.<br><br>

Assume we had a service object representing an auto manufacturer, and it implements several interfaces in its own package; say auto.perspectives:<br><br>

<code><pre>
public interface Physical {
   Location currentLocation();
   Terms shipTo(Location location);
   Petrol petrolRequirement();
   int kilogrammes();
   int litresPer100kilometres();
}
public interface Visual {
   Colour colour();
   Image image();
}
public interface Financial {
   int costEuro();
   Set&lt;Terms&gt; terms(int downpaymentEuro);
}
public interface Advert {
   String description();
   int modelYear();
}
...
</code></pre>

Then assume it had an implementation class in some other package; say auto.products:<br><br>

<code><pre>
public class AutoX implements Physical, Visual, Financial, Advert... {
   ...
}
</code></pre>

Now let's assume a client, perhaps an auto broker, needed only a small portion of this. It could define its <i>own</i> interface, i.e. a subtype, in its <i>own</i> package; say broker.info:<br><br>

<code><pre>
public interface Commission {
   Location currentLocation();
   Terms shipTo(Location location);
   Colour colour();
   int costEuro();
   Image image();
   String description();
}
</code></pre>

An extremely useful feature of <a href=https://cajo.dev.java.net>the cajo project</a> is that it allows ordinary objects to be used <i>between</i> Java Virtual Machines, <i>exactly</i> as they are used locally; <i>without</i> modification.<br><br>

Assume we have an auto reference:<br><br>

<code><pre>
Object auto;
</code></pre>

Suppose when the auto object is local to the client JVM:<br><br>

<code><pre>
auto = AutoFactory.selectAuto(Details...);
</code></pre>

If the auto object is in a remote JVM:<br><br>

<code><pre>
auto = <a href=https://cajo.dev.java.net/docs/gnu/cajo/invoke/Remote.html#getItem(java.lang.String)>Remote.getItem</a>("//somehost:1198/someAuto");
</code></pre>

In either case, the auto object reference is customised thus:<br><br>

<code><pre>
Commission commission = (Commission)<a href=https://cajo.dev.java.net/docs/gnu/cajo/utils/extra/TransparentItemProxy.html>TransparentItemProxy</a>.
   <a href=https://cajo.dev.java.net/docs/gnu/cajo/utils/extra/TransparentItemProxy.html#getItem(java.lang.Object,%20java.lang.Class[])>getItem</a>(auto, new Class[] { Commission.class });
</code></pre>

Now it will work exactly as you would expect:<br><br>

<code><pre>
System.out.println(commission.description());
</code></pre>

Enjoy,<br><br>

John]]>

</content>
</entry>
<entry>
<title>Messaging is degenerate RPC</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2006/06/messaging_is_de.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-06-25T21:28:33Z</issued>
<id>tag:weblogs.java.net,2006:/blog/cajo/142.5091</id>
<created>2006-06-25T21:28:33Z</created>
<summary type="text/plain">After reading several recent posts on other Java sites boasting how distributed messaging is somehow &apos;superior&apos; to distributed objects; well, I have reached my limit. While I agree the technique is useful; it is but a trivial subset of a Remote Procedure Call. Are you curious to know why?</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[Allow me to start with a small disclaimer: For those who do not already know; I lead <a href=https://cajo.dev.java.net>the cajo project</a>, where we promote the idea that the internet can be a collection of World Wide Virtual Machines; where remote objects are used <i>just</i> as local objects.<br><br>

Yet there is a small, but rather vocal community, who wish to espouse that distributed object RPC is <i>somehow</i> flawed, and that 'messaging' is a superior solution. Being a somewhat more mature developer; I remember old tales from my childhood, where <i>'modern'</i> twentieth century businessmen were admonished:
<blockquote><tt><b>"Avoid the telephone; the network is <i>unreliable:</i> the post is <i>superior</i>."</b></tt></blockquote>

Clearly they were wrong then; yet surprisingly this ideology is again being promulgated as fact.<br><br>

To be sure, synchronous invocations are odious, and they are difficult to scale. For example; I actually <i>prefer</i> email to the telephone, since I am not required to respond immediately. Email does not disrupt my work, and I can deal with it when I am ready. However, it is easy to forget: sending email is still <i>synchronous RPC!</i> No matter how you slice it: data must be sent from one computer to another; over the network.<br><br>

A brand new <a href=https://cajo.dev.java.net/nonav/docs/gnu/cajo/utils/extra/Queue.html>class </a> has just been added to the cajo project; in less than 30 lines of code, it clearly illustrates that 'messaging' can be <i>trivially</i> implemented, <i>including</i> queueing, in a synchronous RPC environment:

<pre><tt>
public final class Queue implements gnu.cajo.invoke.Invoke {
   private java.util.LinkedList list;
   private final Object object;
   public Queue(Object object) { this.object = object; }
   public synchronized Object invoke(String method, Object args) {
      if (list == null) {
         list = new java.util.LinkedList();
         new Thread(new Runnable() {
            public void run() {
               try {
                  while (list.size() == 0)
                     synchronized(Queue.this) { Queue.this.wait(); }
                  String method = (String)list.removeFirst();
                  Object args = list.removeFirst();
                  gnu.cajo.invoke.Remote.invoke(object, method, args);
               } catch(Exception x) { return(); }
            }
         }).start();
      }
      list.add(method);
      list.add(args);
      notify();
      return Boolean.TRUE;
   }
}
</tt></pre>

Here <i>any</i> object reference, either local <i>or</i> remote, can be made remotely invokable, in <i>any</i> JVM. Yet <i>every</i> method invocation on a Queue object is executed asynchronously, on its member object, in a <i>separate</i> thread. If result data is desired, one could simply provide a callback object reference, as one of the method arguments. The boolean true is returned simply to <i>'guanantee'</i> that the message has been successfully received.<br><br>

If you want messaging, by all means, go for it! It is a very useful technique. However, it must be seen for what it is; <i>degenerate</i> synchronous RPC: i.e. a <i>tiny</i> subset of the functionality that is possible with distributed objects.]]>

</content>
</entry>
<entry>
<title>Take that .NET!</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2006/06/take_that_net.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-06-08T18:21:26Z</issued>
<id>tag:weblogs.java.net,2006:/blog/cajo/142.4990</id>
<created>2006-06-08T18:21:26Z</created>
<summary type="text/plain">As an outspoken advocate of Java distributed computing, I was recently confronted by a group of .NET enthusiasts. They felt compelled go on about how much more &quot;advanced&quot; .NET remoting is; no need for a registry, syntactic transparency, things they said were &quot;impossible&quot; with Java. They said that to the wrong guy...</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[I felt as if a gauntlet had been thrown down before me. How could I profess that Java truly makes the network the computer, if it can not match the functionality of .NET remoting? While I am not yet convinced .NET is going about remoting in the best way, it is definitely <i>very</i> intuitive. Surely Java <i>must</i> be able to do it like that too... right?<br><br>

Well friends, I am happy to say that the challenge has been both accepted, <i>and</i> met! I welcome you to have a look at the newest <a href=http://wiki.java.net/bin/view/Communications/TransparentProxy>wiki page</a> of the cajo project. Even if you have <i>never</i> developed using distributed computing before, this can <i>literally</i> have you up and running, in <i>minutes.</i><br><br>

For those of you who are tired of hearing about how new and powerful .NET is, and how Java cannot possibly match its <i>"advanced"</i> functionality; this page will certainly bring a smile to your face.<br><br>

Take that .NET! ;-)]]>

</content>
</entry>
<entry>
<title>Thanks... and good luck Bruce!</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2006/05/thanks_and_good.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-05-28T17:54:02Z</issued>
<id>tag:weblogs.java.net,2006:/blog/cajo/142.4916</id>
<created>2006-05-28T17:54:02Z</created>
<summary type="text/plain">It is unfortunate that Bruce Tate forgot to enable comments to his final blog entry. It would be a shame to see him off without at least a small well-wishing. (possibly a little roast too ;-)</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[I guess that means I should start:<br><br>

I sincerely hope you find what you are looking for Bruce. It would be an amazing discovery for sure:

<blockquote><i><b>Now people can develop sophisticated solutions, with little effort, time, skill, or even knowledge!</b></i></blockquote>

It is a Holy Grail; and to be sure, you are not the only one questing for it. It has been quested for ages actually, harking back to the dawn of computers.<br><br>

Unfortunately, some of us have begun to doubt its existence.<br><br>

However, if it exists; Bruce, I genuinely hope <i>you</i> are the one to discover it.<br><br>

<i>(At least I would buy <u>that</u> book!)</i><br><br>

Best wishes, and thank-you for your participation in the Java community.]]>

</content>
</entry>
<entry>
<title>The cajo what?</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2005/08/the_cajo_what.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2005-08-31T03:44:32Z</issued>
<id>tag:weblogs.java.net,2005:/blog/cajo/142.3184</id>
<created>2005-08-31T03:44:32Z</created>
<summary type="text/plain">With two major milestones this month; our 100th new member, and official recognition by the Internet Assigned Numbers Authority: The cajo project is quite likely, the most famous unknown project on the net. Please help let this cat out of the bag...</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Open Source</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[<a href=https://cajo.dev.java.net>The cajo project</a> is a very compact framework to enable completely transparent use, and transport of, ordinary <i>unmodified</i> Java objects; <u>between</u> Java Virtual Machines. It allows distributed computers to effectively coalesce; into a seamless, <i>Virtual</i> Virtual Machine. Its ease of use is undoubtedly its most intriguing feature.<br><br>
 
The foundation of its operation is its transparent method invocation mechanism. It allows dynamic interchangeability of local and remote objects, with <i>no</i> source impact. As a result, the framework requires <i>no</i> interfaces, <i>no</i> XML, <i>no</i> annotations, and works with <i>all</i> JREs; 1.2 and higher. This makes cajo a unique, <i>'drop-in'</i> technology; which can distribute literally <i>any</i> application, <i>without</i> re-designing it.<br><br>

The framework applies four basic technologies; referred to as <b><i><u>IPMB</u></b>.</i> Click on the links below, for more detailed information.<br><br>

<a href=https://cajo.dev.java.net/overview.html><b>Items</b></a> – Remote objects:<br>
An item is an ordinary object, which is made remotely accessible. This can be done with as little as <i>one</i> line of code. The framework allows the public methods of the object to be invoked remotely.<br><br>

<a href=http://wiki.java.net/bin/view/Communications/ProxyUsage><b>Proxies</b></a> – Mobile objects:<br>
A proxy is an ordinary object, which is transparently duplicated inside another VM. A proxy allows otherwise remote code, and data, to be accessed locally.<br><br>

<a href=http://cajo.dev.java.net/multicast.html><b>Multicast</b></a> – Object discovery:<br>
Multicasting provides a mechanism whereby a remote object reference can be broadcast, and be received, by <i>all</i> listening VMs. It provides the ability to both transmit, and to receive these broadcasts.<br><br>

<a href=http://wiki.java.net/bin/view/Communications/CajoScripting><b>BeanShell</b></a> – Object scripting:<br>
BeanShell provides an interactive, or file driven scripting environment, using pure Java. It is extremely useful; for quick jobs, experiments, and debugging. Items and Proxies integrate cleanly, as regular objects.<br><br>

All these capabilities, and several more very interesting classes, come in its 38kB codebase jar. It has no dependencies on any frameworks; other than a Java Runtime Environment 1.2+, and optionally, the BeanShell jar.]]>

</content>
</entry>
<entry>
<title>The java.net community really works!</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2004/08/the_javanet_com.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2004-08-20T02:44:26Z</issued>
<id>tag:weblogs.java.net,2004:/blog/cajo/142.849</id>
<created>2004-08-20T02:44:26Z</created>
<summary type="text/plain">Have an interesting idea? Start a project! You could be surprised at how many people you could help.</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Distributed</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[Some of you may know me as the host of <a href=https://cajo.dev.java.net>the cajo project</a>. In fact, the topic of my blog entry today is that thanks to java.net; there are a lot more of you than I thought!<p><p>

I was just informed about the <a href=https://logger.dev.java.net/>logger project</a>; it allows java.net project owners to view access statistics for their projects. What I found out <i>astonished</i> me. So much so, that I thought it important to share this discovery with you.<p>

I started my project after a lot of introspection, (pause for geeky-Java-pun laughter :) For those of you who have not yet visited, the cajo project deals with virtualizing barriers between virtual machines; it allows objects to both interoperate, and travel between them, transparently. While implemented simply, I thought; this is <i>sort-of</i> abstract, and I wondered: Would anybody be interested?<p>

Well, I was amazed to find more than 25 <i>thousand</i> visitors, just this year. On top of that, over 350 <i>thousand</i> page views this year. I never expected anything like this! (Some <i>must</i> be search engine hits, but unless Google got infatuated, it is still a <i>lot</i> of people)<p>

So First I have to sincerely thank all of you who came to visit.  Now instead of wondering: Will anybody notice? I am starting to think that this is an idea with some real peer-reviewed merit. I truly hope this project helps you; and I am very glad to be of help. And oh yes, please, spread the word!<p>

Secondly, I am also delighted to have the opportunity to bring this idea to so <i>many</i> interested people! My deepest thanks to Sun, who made this possible; with this site, and through the development of Java; both at no charge! You have given the little developer all the tools of the big-guys, and as result; a real chance to make a difference.<p>

Thirdly, for those of you thinking; is my idea good enough to be a project? There is only one way to find out; please try it! For those of you already running projects, if you have not already; please check out the logger project, it has very interesting information. And finally, as dutiful project leader: for those of you who have not yet visited <b><a href=https://cajo.dev.java.net>the cajo project</a></b>; please give it a look. The odds seem promising that you will find it enlightening.]]>

</content>
</entry>
<entry>
<title>Inside the World Wide Virtual Machine</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2004/08/inside_the_worl.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2004-08-01T18:08:40Z</issued>
<id>tag:weblogs.java.net,2004:/blog/cajo/142.673</id>
<created>2004-08-01T18:08:40Z</created>
<summary type="text/plain">In this, his second blog entry on the  WWVM, the founder of the cajo project describes the fundamental concepts behind this free evolutionary distributed environment.</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[As I mentioned in my <a href=http://weblogs.java.net/pub/wlg/1129>previous</a> blog, the World WideVirtual Machine is a very exciting free space for the development of robust scalable fault-tolerant distributed applications. The cajo project is a small free framework defined to simply and easily realize this vision. Its reception by the java.net community has been both strong and positive. So in response to this, I thought it would be worthwhile take a little time to explain the philosophical concepts of the WWVM.<br><br>

For the developers of the World Wide Virtual Machine, there is a fundamental viewpoint, which can be stated as follows:

<blockquote>The network is a <i>vast</i> collection of objects, ready to be used to create <i>other</i> objects.</b><br></blockquote>

If you stop to think about it, this is not too different from what exists in a typical single Virtual Machine design: There is the runtime library, and a collection of other local objects, both used to create applications. In fact, <i>any</i> application can be defined as follows:

<blockquote>An application is an object, which itself is composed of, a collection of objects.</blockquote>

As you can see, the WWVM is not a really large conceptual jump, especially considering all the exciting possibilities it enables. So let's take a look at some more WWVM fundamentals.<br><br>

It has been stated that an application is a collection of objects, and it has also been stated that the network is a collection of objects; so necessarily the WWVM must have a very clear definition of what an object is:

<ul><li>An object has 1 or more public methods,
<li>An object has 0 or more non-public member objects,
<li>An object's public methods interact with 0 or more private member objects, with 0 or more argument objects, to return 0 or 1 result object; or to throw an Exception.</ul>

In a single-VM design, there is only one general category of object: local ones. These run in the address space of the host VM. However, in the WWVM there are <i>three</i> fundamental object categories:

<ul><li>Local Objects: existing in the local VM address space.
<li>Remote Objects: existing in the address space of a remote VM, linked by the network.
<li>Proxy Objects: existing in the local VM address space on behalf of a remote VM, and may <i>(or may not)</i> be communicating with it.</ul>

Each of these objects, being fundamentally different, are obtained in different ways:

<ul><li>Local objects are instantiated, either via a <tt>new</tt> or <tt>newInstance</tt> method invocation; or are deserialized from an <tt>ObjectInputStream</tt>.
<li>Proxy objects are obtained via a remote object method result, or exception.
<li>Remote objects are obtained via a request from a remote VM; or via a remote VM broadcast. <i>(sometimes called listening to radio station <a href=https://cajo.dev.java.net/multicast.html>WWVM</a> :-)</i></ul>

While each category of object is used identically syntactically; the objects themselves exhibit fundamental properties, based on their category:

<ul><li>A local object can be passed to a remote object, only if allowed by <i>both</i> sides, where it will exist there, as a proxy.
<li>A remote object reference can be <i>freely</i> passed between all objects <i>and</i> Virtual Machines.
<li>A proxy is <i>unique</i> to the runtime in which it exists, and <i>cannot</i> be passed to another VM.</ul>

Objects are passed to other objects, either as method arguments, method returns, or in method exceptions. A proxy may even provide a <i>distributed user interface</i>, by instantiating a <tt>Window</tt>, as needed, at its hosting VM.<br><br>

In the WWVM there are no primitive types per se; such as <tt>char</tt> and <tt>int</tt>. These are considered purely special case optimizations, of value solely within a local Virtual Machine. Also there is no inheritence of  network objects.  The WWVM focus is solely on the use of objects, by objects. Distributed objects are used solely via their public method interface.<br><br>

The following security philosophy is inherent in the WWVM:

<blockquote>It is expected that <i>all</i> proxy objects <i>will</i> be hosted in a JNLP/Applet-type sandbox.</blockquote>

This makes the development and use of the WWVM no more risky than using ordinary applets, or WebStart applications; in fact, <i>proxy codebases are typically unsigned</i>. In other words; using the WWVM is safe.<br><br>

At <a href=https://cajo.dev.java.net>the cajo project</a>, we are delighted to welcome new developers into the WWVM. It is a fascinating free environment that will only grow richer with greater participation. We welcome you to come look inside. It really does create some very exciting opportunities for an entirely new type of Internet.<br><br>

(And of course, it also works equally well for the development of powerful distributed <i>LAN</i> applications :-)]]>

</content>
</entry>
<entry>
<title>A treatise on open source development</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2004/06/a_treatise_on_o.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2004-06-28T00:21:01Z</issued>
<id>tag:weblogs.java.net,2004:/blog/cajo/142.1271</id>
<created>2004-06-28T00:21:01Z</created>
<summary type="text/plain">The recent java.net milestone of its 1000th project started me thinking.  I am proudly a free (or open source) software developer.  For those of you considering starting an open source project; I&apos;d like to offer you the benefit my experiences. I also welcome and invite the java.net community, both project developers, and community members, to share their experiences.</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Open Source</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[Why become an open source developer? I think there are probably as many answers to this question as there are developers.  I can only tell you about my decisions. I have been actively developing software professionally for nearly twenty years. I feel, as it is with many of us; it is not only my profession, but also my passion, and my hobby. I delight in learning useful new technologies. In the mid-90's, Java struck me like nothing I had seen before. I began to realize that the network could actually become the computer! <i>(If anyone still remembers that slogan)</i><br><br>

I was a very enthusiastic, and early adopter of the nascent <i>'object-oriented'</i> technology. Having done a lot of assembly language network programming, I immediately saw the benefits it offered in many cases, compared to modular <i>'procedurally-oriented'</i> programming. I saw in the Java environment, an opportunity to turn networked physical machines, into logical <i>'objects'</i>. I spent several years actively exploring, and developing the concept; and it steadily continued to astound me. I searched the net exhaustively: did such an approach to simple dynamic clustering of machines already exist?  As far as I could tell, it did not. For a moment, selfishness set in; I thought hey, I could lock this down, and cash in!<br><br>

However, after a lot of consideration, my personal motivation to open the source was that the benefit realized by greater cooperation, was more valuable to me than financial gain. I thought I was already a lucky guy, enjoying an excellent standard of living, and standing on the shoulders of giants. I felt a need to <i>'give-back'</i>, and to help advance the state of the art. I also thought community input would make the framework even better; as I certainly do not have a monopoly on good ideas. Besides, I personally knew I wouldn't have the heart to exclude users of this technology, though I could willingly fight to keep it free for everyone.<br><br>
 
Once I decided to create a project; a strange multitude of concerns set in. First I felt a strong sense of urgency. I worried that if I delayed, some company might come up with a similar technique, and assert proprietary rights. I worked day and night, on my most dreaded of tasks: thorough documentation. I knew without that, the project stood no chance at all.  Next I realized that even <i>more</i> importantly; people would need an example: simple, extensive, and fully functional. I found this to be even more challenging than the documentation!<br><br>
 
Finally: My project site was ready.<br><br>
 
Next came fears to which I think every open source project leader can relate:
<ul><li>Would people flame my work?
<li>Even worse; would some company steal it?
<li>Much worse; would no one care?</ul>

Fortunately, I can say none of these came to pass. To my delight, initial reception was very positive.  However, the challenges were far from over. At times, community input was so active; I worried that I would not be able to keep up. I was after all, doing this on my personal time, <i>and</i> for no money.  These typically seemed followed by periods of such light activity; I thought the project had died altogether.<br><br>

My next issue was how to get the word out; especially with no marketing budget. Every successful design requires mindshare, every bit as much as innovation.  Adopting a framework requires not only awareness, but effort on the part of developers. Here I believe open source excels on both sides of the equation: Projects have to be genuinely interesting to justify so much effort, and the community is actively looking for good new ideas.<br><br>
 
Developing an open source project requires a lot of time and effort. It certainly is not for everyone. I believe it is as challenging as bringing a commercial product to market.  However, if you have an interesting idea, and community spirit, I unhesitatingly urge you to do it. I strongly encourage everyone to investigate, use, and contribute to open source software. I think it is both a social responsibility, and our legacy. As a project owner, I feel deeply indebted to my project's contributors, members, and users.<br><br>

Rest assured, you will find me working on my <b><a href=https://cajo.dev.java.net/index.html>project</a></b>, for the long haul.<br><br>]]>

</content>
</entry>
<entry>
<title>The World Wide Virtual Machine</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2004/03/the_world_wide.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2004-03-17T16:29:22Z</issued>
<id>tag:weblogs.java.net,2004:/blog/cajo/142.988</id>
<created>2004-03-17T16:29:22Z</created>
<summary type="text/plain">Can the network really become a computer? A description of a simple technique to share, and connect to, objects in other VMs, architecturally as though they are all in the same VM.</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Community: Java Communications</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[<p>Disclaimer: This entry is in no way meant to slight the many other fine distributed frameworks out there. It&#146;s just that this one is designed for us non-rocket scientists. :-)

<p>I host a free project here on java.net called <a href=https://cajo.dev.java.net>the cajo project</a>. It allows any Virtual Machine to easily expose access to any of its selected objects to Remote Virtual Machines, as well as to send any of its selected objects to RVMs. It offers a very simple yet highly flexible framework for applications to work together. Most importantly, any existing object can be made remotely usable, with no changes to its source; an application simply adds this framework, not restructures around its requirements. I have found this unique amongst distributed frameworks.

<p>A client can obtain a remote reference to an exposed object in one of two ways. It can request one explicitly, using just the name of the server, and the name under which the exposed object is registered, if it knows these things. In the framework, this is called static binding. It can also listen for object reference broadcasts, sent from RVMs. This is called dynamic binding. The references can then be freely shared in turn with other remote objects. Exposing an object for remote reference is done conversely; it can be bound locally under a name, or be broadcast to all listening VMs, even both.

<p>Clients can invoke the remote object&#146;s methods, and receive the resulting return, just as though it was a local object. How does the client know how to use a remote object? The object can implement a getDescription() method, it would provide detailed usage information. The object often implements a getProxy() method, it would generally return a graphical user interface component with which to interact with the remote object. The framework also features a standard generic client, which can be run as applet in a browser, or as an application via JNLP, to remotely host the GUI component.
 
<p>Any VM can send an object (or remote object reference) to an RVM, as an argument to one of its methods, or by returning it as a method result. The objects will physically exist locally in the RVM, i.e. in the same address space, as its own objects. These objects are known as proxies in the context of this project, as they exist to act in a remote location, on behalf of their sender. The previously mentioned the getProxy() method is used to return a GUI proxy object.

<p>The framework borrows from the best concepts of Jini, CORBA, and DCOM, but it is far smaller, as powerful, and much simpler to use. The core framework consists of only two packages; a total of only 13 small class files. It can be so small and easy to use, as it does not impose any application semantics beyond those outlined above. It comes with a detailed example file, ample documentation, and several support fora. It is completely free, licensed under the GNU LGPL, to allow both free and proprietary applications to operate together.

<p>The framework is currently running on <i>all</i> Java Runtime Environments; J2EE, J2SE, and even J2ME. It is in active use on Linux, Windows, Solaris, and OSX systems.  The goal of the project is to foster the creation of a WWVM. This is an exciting shared space of applications and object libraries, where they all appear and are used as though they were local, to foster the creation of new dynamic, interactive application networks. All VMs are free to join, from big mainframes, to tiny PDAs. (You can use any JVM compatible language, even Java)

<p>Please come visit the WWVM community, all are welcome. Participants needed. :-)]]>

</content>
</entry>
<entry>
<title>Java raised to the power Linux</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/cajo/archive/2004/03/java_raised_to.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2004-03-14T03:03:07Z</issued>
<id>tag:weblogs.java.net,2004:/blog/cajo/142.1098</id>
<created>2004-03-14T03:03:07Z</created>
<summary type="text/plain">Java and Linux exhibit true synergy; the whole is very much greater than the sum of its parts.</summary>
<author>
<name>cajo</name>

<email>cajo@dev.java.net</email>
</author>
<dc:subject>Community: linux.java.net</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/cajo/">
<![CDATA[<p>For passionate Java developers, the network is the computer. However Java, and in particular its runtime environment, require a highly sophisticated operating system on which to run. Enter Linux; you would be hard pressed to find any system with more features. So, how does Linux increase the power of Java?</p>

<p>First let&#146;s look at what Linux represents; it is a free, heterogeneous, network-integrated operating system. It runs on many hardware architectures (RISC, CISC&#133;) and many platforms (ARM, PPC, x86, SPARC&#133;). On the other hand, Java is a heterogeneous, network-integrated <i>language</i>. It is architecture agnostic, meaning no recompiling, and its code is network loadable. Together they can provide a ubiquitous standard environment, on a diversity of platforms.</p>

<p>Next look at all of the fine Java projects here at java.net, and other places, like Sourceforge and Savannah. Not only are our numbers increasing, but also another interesting thing is happening. You&#146;ll see all sorts of projects to develop standard utility applications; browsers, mail clients, office suites, and even media players. Are we reinventing the wheel? No. We are inventing the ubiquitous wheel. Very soon all major utility applications will have been rewritten in Java.</p>

<p>Finally consider how easy it will be to make useful new devices. Design the hardware, bring up Linux, add in Java, and <i>presto</i>! A multitude of pre-written software, from enthusiastic developers, all dynamically loadable. Innovation and platform diversity is an exciting vision. Would all this flexibility require Java to be open source? I believe yes, to be as adaptive as would be required for this scenario. Linux combined with Java create the opportunity to easily and quickly create &#145;JVMlets&#146;, i.e. small fully functional runtime environments, on multitudes of devices, all working together.</p>

<p>There is no question, Java is huge, and I truly believe Java will reach even greater heights, standing on the exceptionally broad shoulders of Linux. Essentially, Linux abstracts the hardware, and Java abstracts the network.</p>

<p> This is where I want to go today, how about you?</p>]]>

</content>
</entry>

</feed>