Livespaces
Training Workshop - Entities Exercise

Exercise 2: Entities

By the end of this exercise you will:

Files involved:

Run targets:

Steps:

  1. Run the local elvin daemon
  2. Open a cygwin shell
  3. Run the Elvin consumer tool ec and listen for Livespace events with the command:
    ec -e elvin://localhost "require(Livespace-Protocol)"
  4. Open Eclipse from the desktop shortcut
  5. Look at Hobbit.java and note the boilerplate code
    • constructors
    • ENTITY_TYPE constant
    • getType() method
  6. Look at HobbitServer.java
    • main() method
      • Finding the Elvin connection
      • Finding or creating the local RoomEntity
      • Creating a server
      • Cleaning up resources
    • constructor
      • Creating the Hobbit Entity
      • Creating the EntityRegistry and adding listeners
      • Creating the EntityServer
    • dispose() method
    • Running the server using a different Hobbit name.
  7. Run the Livespace Browser Application pointed at the localhost
    • Play with Hobbit properties
  8. Look at a basic client
    • HobbitFinder1.java
      • Finding the Elvin connection
      • Finding the local Room
      • Clean up
    • HobbitFinder2.java
      • Find our Hobbit
    • HobbitFinder3.java
      • Make changes to our Hobbit
      • Note use of synchronisation
  9. Run the HobbitServer but pointing it to ics-linux as the host.
    • Change the name of your hobbit (first command line argument)
    • Use the -Dlivespace.elvin=elvin://ics-linux command line switch to use ics-linux
  10. Use the Service Browser from your Livespace Dashboard to manipulate all the Hobbits.
  11. Questions

category: Documentation, Public