160 likes | 347 Views
Lime Team. Adam Bazinet Hau San Si Tou. LIME vs. JavaSpace. Similarities: Both are Java-based JavaSpace is written in Java & is a Jini Technology service Both act as a middleware for dynamic communication, coordination & sharing of objects Both are different from a client/server model
E N D
Lime Team • Adam Bazinet • Hau San Si Tou
LIME vs. JavaSpace • Similarities: • Both are Java-based • JavaSpace is written in Java & is a Jini Technology service • Both act as a middleware for dynamic communication, coordination & sharing of objects • Both are different from a client/server model • JavaSpace typically runs in the middle tier of a three tier client/server model • Difference: • JavaSpace requires a server to access the space
Lime Console • 3 types of operations: • Access operations such as • out - inserts a tuple in the Lime tuple space. • in - withdraws a tuple from the Lime tuple space, and blocks if no tuple is found. • rd - reads a tuple from the Lime tuple space, and blocks if no tuple is found
Lime Console • Engagement operations such as • Engage Tuple Space – engages the Lime tuple space, i.e., allows sharing with other agents. • Disengage Tuple Space - disengages the Lime tuple space, i.e., makes it private and prohibits sharing with other agents. • Reactive operations such as • Add Strong Reactions – registers a set of strong reactions with the Lime tuple space. • Add Weak Reactions - registers a set of weak reactions with the Lime tuple space.
Chat • Disengage Agent: Selecting this button will disengage you from the other agents on this host. • Engage Agent: Selecting this button will engage you with other agents on your host. Only one of the disengage and engage buttons can be active at once. • Disengage Host: Selecting this button will disengage the host on which this agent is running from the other hosts in the network. • Engage Host: Selecting this button will engage this host with others in the network. This allows agents on this host to communicate with Chat programs running on other hosts.
SimpleLime Sample output: >java SimpleLime Hi -mcast off Lime:Factory set to lights.adapters.builtin.TupleSpaceFactory Lime:Lime server murphy:1973 activated Lime:Listening for agents Lime:Agent SimpleLime loaded and started. I wrote the tuple: <Hi> Lime:Shutting down Lime server... Lime:Done.
SimpleLime // Pass Lime arguments (if any) through the Launcher and launch the // LimeServer. In this case, NUMLOCALPARAMETERS is the index of the first // Lime parameter (as opposed to the index of the application parameter) new lime.util.Launcher().launch(args,NUMLOCALPARAMETERS);
SimpleLime // load a SimpleLime, passing the first command line argument as the only parameter LimeServer.getServer().loadAgent("SimpleLime", new String[]{args[0]});
SimpleLime LimeTupleSpace lts = null; ITuple myTuple = new Tuple().addActual(msg); // create the new tuple space (default name) lts = new LimeTupleSpace(); lts.out(myTuple);
SimpleLime // shut down Lime gracefully. LimeServer.getServer().shutDown();
Technical Notes • Multicast packets are automatically sent to hosts on the same subnet • Arbitrary connection and disconnection is currently not supported • A mobile agent cannot write or access tuples using classes that are not present on the file system of the hosting Lime server
Strategy for Implementation • How can you conserve bandwidth in an ad hoc network?
Example Exchange • Writer: “I wrote a tuple (id X) whose hash is H.” Taker: “I want to take a tuple whose hash is H.” Taker: “Send the contents of tuple id X.” Writer: “The contents of tuple id X are . . .” Taker: “Request (id Y) to take tuple id X.” Taker: “Request (id Z) to take tuple id X.” Writer: “Request id Y to take tuple id X granted.” Writer: “Request id Z to take tuple id X not granted.”
Anhinga Spaces • Define the M2M remote interface used between Anhinga Spaces instances under the hood. • Define the Anhinga Spaces client API. Implement Anhinga Spaces. • Demonstrate some applications of Anhinga Spaces.