### Bean Example

This is a simple example of a Hello World bean configured using Spring and deployed using Rio. The bean is dynamically remoted by Rio, turning the bean into a Jini service. This document is organized as follows :

- POJO Basics
- Building the Example
- Example Source Files
- Running the Example

Spring Basics
Rio provides the capability to build dynamic applications using Spring. You can wire up your beans using Spring, and use Rio to turn a Spring bean into a dynamic service, providing transparent Jini technology remoting, with built-in management, fault detection and automated deployment.
Building the Example
Building the example is straight forward, you must have Ant and the JDK. If these requirements are met :
$ cd <rio-home>/examples/springbean
$ ant

Example Source Files
Source code is located in <rio-home>/examples/springbean directory

File Name | Location | Description
Hello.java | /src/main/java/springbean | The interface for the bean
HelloClient.java | /src/test/java/springbean/client | Provides a command line interface for running the example
HelloImpl.java | /src/main/java/springbean/service | The bean implementation
springbean.xml | /src/main/conf | The opstring for the example
hello-spring.xml | /src/conf | The Spring application configuration for the example
build.xml | . | The ant build file
readme.html | . | This file

Running the Example

How to run the example :

1. Start Rio services :
   $ cd <rio-home>/bin
   $ startall
2. Deploy the example
   - Using the Rio CLI
     $ cd <rio-home>/bin
     $ rio deploy ../examples/springbean/src/main/conf/springbean.xml
   - Using Ant deploy task
     $ cd <rio-home>/examples/springbean
     $ ant deploy

3. Run the client using ant
   $ cd <rio-home>/examples/springbean
   $ ant client
   Buildfile: build.xml
   client:
   [java] Discovering Hello service ...
   [java] Discovered Hello service
   [java] Invoking Hello service ...
   [java] Received: Hello vistor : 3 from Hello service
   BUILD SUCCESSFUL
   Total time: 1 second
   $
4. Undeploy the example using of the of following methods
   - Using the Rio CLI
     $ cd <rio-home>/bin
     $ rio undeploy ../examples/springbean/src/main/conf/springbean.xml
   - Using Ant deploy task
   $ cd <rio-home>/examples/springbean
   $ ant undeploy