Terracotta Framework Library > Samples > RemoteInvoker

RemoteInvoerk - Demo for the Terracotta RemoteInvoker

About

This sample is a part of the Terracotta Framework Library - tclib. More information is available from the Terracotta Framework Library readme.html.

This application implements a remote class that is invoked "remotely".

Build Instructions

This sample application requires Maven 2 and Java 5. First download and install Maven 2. Then perform these steps:

  1. Step up into the parent tclib directory cd ../..
  2. Invoke mvn install to install the tclib library
  3. Step back into the rmi sample directory
  4. Invoke mvn package to build the sample rmi application.

Run Instructions

To demonstrate the Remote Invoker:

  1. Start a TC Server:

    $ mvn tc:start

  2. Start one sample:

    $ mvn tc:run

    [INFO] [node] I am servicing requests...
    [INFO] [node] Incrementing counter by: 3
    [INFO] [node] Proxy returns: 3

  3. Start another sample:

    $ mvn tc:run

    [INFO] [node] Proxy returns: 6
        
Notice that the first process, not the second process, performed the second calculation, you should see on the console window, the additional line:
[INFO] [node] Incrementing counter by: 3