OCSelot
- A Lightweight Java Middleware
<< Participating classes   Example 2 >>

Example 1

sets the scene with a purely local application, putting the participating classes Agent and Listener/ListenerImpl to a first use.

The following examples will depart from here, turning it into a variety of client/server structures.

Structure


Code

package tw.net.ocs.example;

public class Example1 {
   public static void main(String[] args) {

      System.out.println("Running Example1: Agent+Listener HERE");

         // Create an Agent, pass it a Listener
      Agent agent = new Agent(new ListenerImpl());
         // ... and let the Agent act
      agent.act();
   }
}

Demo

To run the demo, enter

java -cp ocs-examples.jar tw.net.ocs.example.Example1
Last modified Jun 8, 2006