Bond Installation and User Guide

(the hands-on quick guide)


What is Bond ?

Bond is a framework for a message passing system, providing a foundation for the development and deployment of a distributed system. Essentially this means that it provides capabilities to create, deploy, migrate code at different locations, and also provides means for communication betveen all the components of the system.

System architecture and philosophy

The bond system consists on an enviroment (the bond resident) that will host a special kind of code (the bond objects) and which (the environment) will provide means to pass messages between the objects located at the specific residents.
The messages that are being passed between the objects existing at the residents provide the functionality of the system. The objects that receive messages form other objects will perform the actions associated with those messages and return the results (if necessary). The messages that are passed to objects are formated using the KQML language (a usual choice for agent communication language). There is also the possibility to format the messages using XML, and therefore the bond environment needs the XML package.
To find the objects that are available at some resident (remember, the object came migrate to a different resident), there is a directory service for registration purposes. In order for some object to receive a message, it must be registered in the local directory.
The shadow is a very important component of the communication system, since it will provide the means to send messages to remote objects. When some object A wants to communicate with another (local or remote) object B, A will need to create a shadow of B (by using the address of the machine hosting the bond resident and the identifier of the remote bond object. The identifier of the bond object is generated by the environment when the object is created. When A has the shadow of B, it will call on the shadow the communications methods (available on all Bond bojects) and this way will have its message delivered to the destination object
The communication between the objects can be synchronous (the caller blocks waiting for a reply) or asynchronous (the object waiting a message will register at the communicator and reserve a waiting slot, and it will be able to do some other processing until the incoming message arrives).
Some important characteristic of the bond objects is that they support dynamic properties. This means that we can add "on the fly" fields and methods (by using get and set methods to read/add objects that include the desired additional fields or methods). How is this important ? Say you have object A, and you want it evolve (in the sense that it will be able to do more things), so the way to do that is to add new methods and fiels. All bond objects have this feature. This is desirable in the case of migrating and dynamic code.

Agents

Bond has implemented some code with more advanced functionality: agent.
The agent is a special kind of object that can perform complex activities. The Bond agent has a specific architecture that enables it to be extended easily, to process in paralel different tasks (which can communicate with each other) and to reconfigure itself.
The agent is structurally an multiplane finite state machine (several state machines running in parallel). The description of this MFSM si called the blueprint of the agent. In each state of the finite state machines there is defined a strategy (a small sequence of atomic actions). The actions determine the behaviour of the agent, and take their information (data to process) from another component of the agent, the model of the world.
This model of the wold contains the information the agent has gathered, inherited, processed, and can be used as shared memory for inter-FSM communication purposes. It is usually loaded when the agent is started and is a XML - formated file, holdingn initialization values for various fields needed by the agent. For a detailed description see later.
The agent can be modified by having its strategies loaded and unloaded on the fly, also it can be added or removed a number of planes, and can have its model of the world modified.
To facilitate the creation of the agents, there is available a special object, the AgentFactory. This will take a description of the agent (in the form of the blueprint), and it will create the MFSM of the agent and then load the strategies for all its states.

Having said all that, and hoping that you already have an ideea of what Bond is about, let's install the package and later play around with it.

Installation steps

  1. Have installed JDK1.2.2 on your system. To do that, plese refer to
  2. Download and inflate the required packages:
    Bond Distribution: http://bond.cs.purdue.edu
    You will end up with jar archive: Bond jar which you will extract using jar.:
    jar xvf Bond.jar
    As an alternative you can inflate the bond package using unzip. Here is what the result shold look like:
    drwxr-xr-x  7 tstef  wheel   512 Mar 22 13:21 .
    drwxrwxrwx  5 root   wheel   512 Mar 22 13:20 ..
    drw-r--r--  2 tstef  wheel   512 Dec  1 15:26 META-INF
    -rw-r--r--  1 tstef  wheel  8970 Dec  1 15:20 README
    -rw-r--r--  1 tstef  wheel  1317 Dec  1 14:08 Resident.class
    -rw-r--r--  1 tstef  wheel  1889 Dec  1 14:08 Resident.java
    drw-r--r--  2 tstef  wheel   512 Dec  1 14:09 announcements
    drw-r--r--  3 tstef  wheel  1024 Dec  1 14:09 blueprint
    drw-r--r--  7 tstef  wheel   512 Dec  1 14:09 bond
    -rw-r--r--  1 tstef  wheel    92 Dec  1 14:08 go.bat
    drw-r--r--  2 tstef  wheel   512 Dec  1 14:09 models
    -rw-r--r--  1 tstef  wheel    92 Dec  1 14:08 start
    -rw-r--r--  1 tstef  wheel  5824 Dec  1 14:08 tspaces.cfg
    
    This directory we will be called the BONDROOT directory
  3. Add the support libraries: The support libraries are third party software that facilitate the communication between the system's components, and specifically will enable intercommunication between heterogenous systems.
    The required support libraries are: You will create a subdirectory called support in the BONDROOT, and you will need to copy into this new subdir the jar files containing the support libraries: xerces.jar, tspace.jar, tspaces-client.jar
  4. Configuraton We can customize the bond environment by editing the following file: BONDROOT/bond/core/properties
    
          bond.debug = true/false:  display logging messages for debug purpose
          bond.distributedAwareness = false/true: for discovery
          bond.agentLazyLoading = true/false: for faster agent startup
          bond.communicationengine=UDP, (TCP): protocol messaging depends on
          bond.UDP.port=2000: default port when UDP is used for messaging 
          bond.TCP.port=2000:       default port when TCP is used for messaging
          bond.scheduler=RR (MT): agent thread scheduler.RR uses one thread
             which is shared by round-robin way. MT uses multiple threads.
          bond.microserver.enable=false/true. for Web access
          bond.microserver.port=2099. default port for micro server
          bond.strategy.repository=http://danube.cs.purdue.edu:8001/Bond/
             web server address for remote dynamic class loading. Unless you're
             using remote loading, don't change it.       
          bond.agent.visual = false/true: show the finite state machine of agent.
          bond.faultDetection=false/true
             distributed fault detection, which will be included in next release
             of Bond.
          default.monitoring.agent=...: for fault detection, which will be
             used in next release
    
    The only thing left to worry about is to set the CLASSPATH for the java such that it will take advantage of the support libraries installed in the BONDROOT/support directory.
    We can do this by setting
    CLASSPATH=.:support/xerces.jar:support/tspaces.jar:support/tspaces-client.jar
    or by providing the path to the commnad line that starts the resident:
    java -classpath .:support/tspaces_client.jar:support/tspaces.jar:support/xerces.jar Resident

Short exploration of the interface. What's going on at the resident.

TODO ...