COP 4610 Fall 2002                         Final Exam Samples                    Name:_____________________

 

1.       The A in ACID, as used in transaction semantics, stands for Atomicity. What does this mean and why is this property important?

Atomicity is the property that the transaction appears to be just one operation, even though it may be comprised of many more primitive actions. This means that other activities will not be able to be interleaved with this, providing a semantics equivalent to a critical region.

2.       What does the term Introspection mean in Java? Give one example of where Introspection is useful.

It means that a class can has services that allow you to learn about its attributes (state variables), its services, its lineage, events that it responds to and events that it generates, etc. Moreover, method objects may be created and then run on any instance of the class. Given this, we can start with any object, determine its class and then look “under its hood.” One consequence is the ability to inspect and change properties of a bean, that is, any object that adheres to the bean design pattern.

3.       Explain why depth first search is relevant to object serialization.

In order to serialize an object, we must serialize its primitive parts (that’s the easy part) and then recursively serialize its object parts. If we just walk the graph without concern about revisiting nodes, we can take an unbounded amount of time and consume an unbounded amount of space. The problem is that many objects contain self references, either directly or indirectly. In the process of serializing we only want to serialize each visited object once and note the recursive references so these can be restored when the object is unserialized. Depth first search is perfect because it processes each node exactly once is traverses each edge exactly once.

4.       What is LRU and how is it relevant to web container management?

LRU stands for Least Recently Used. It is a strategy that is based on a list which is ordered by time of reference to an object. The least recently used item are those that are selected whenever a decision is made to remove or serialize an object so it will not place a burden on the container. The assumption is one of locality. Things recently used are most likely to be needed in the near future; things not accessed for a long time will probably not be needed any time soon.

5.       Under what circumstances is JSP more appropriate than a Servlet.

JSP makes it easier to send html, xml, dhtml, etc. back to the client. You just write the lines in the JSP. This is a pain in a Servlet, as you need to issue println commands. However, adding complex logic is much easier in a Servlet since it is a Java class in which you write Java methods to carry out the service logic.

6.       Let A and B be two participants in a secure transaction. Further let their respective public/private key pairs be
<PuA, PrA>, <PuB, PrB>. Finally, let the public key encryption/decryption algorithm be represented by the functions
Encrypt(plaintext, key) and Decrypt(ciphertext, key)

Using the above terminology, describe how A might securely send the message M to B. Show any actions that A needs to do to prepare the message for secure delivery and that B must subsequently do to receive the message.

A needs to encrypt the mess M in a way so that B is the only one who can decrypt this ciphertext. To do so, A sends

Encrpt(M, PuB)

B must use its private key to decrypt the ciphertext. This is done by

Decrypt(M', PrB), where M' is Encrpt(M, PuB), the encrypted message from A.

7.       Describe how tuples can be used to do barrier synchronization. Be specific. We will assume that 10 threads must arrive at the barrier before any may continue past it. Using write, read and take, show the actions necessary to initialize the barrier and then use it.

Set barrier:
write(<“BARRIER”, 10>);

Arrive at Barrier:
take(“<BARRIER”, ?howMany>);
howMany--;
write(“<BARRIER”, howMany>);
read(“<BARRIER”, 0>);

1.       Why is a lease useful in managing remote object references?

Distributed garbage collection is non-trivial. That is, finding active remote references to an object is a costly task, especially if the recipients of references have passed them on to others. If we require a lease, and the lease needs to be renewed prior to its expiration, we can assume any expired lease means that the remote user is no longer interested in our object. If they fail to renew a lease, it’s their problem because we are free to garbage collect when all local references are gone and all leases for remote references have expired.

2.       How does an Enterprise Java Bean relate to a database entry?

EJB’s are local caches (on tier 2) of individual lines (entries) in a database table (on tier 3).

3.       How might packet storms arise when an object request broker recovers from a crash? How does Jini avoid these storms?

When all the service providers try to re-offer their services (join), they need to first discover the request brokers on which they wish to advertise. If no discipline is obeyed, they will all start multicasting (or unicasting) discovery packets simultaneously. That’s the storm. Jini requires that these providers wait a random amount of time (up to 15 seconds) before trying to do a re-discovery. That spreads the requests out, reducing the probability of such a storm.

4.       Describe a distributed search as you might encounter in a P2P system. Why does this not take order of the number of nodes in the net time?

We could multicast to all our local peers, looking for some advertised items, e.g., another peer, a music file, or whatever. Some one or more of these peers could pass the request on to other peers in other groups to which they belong. This could continue on out, typically controlled by a time to live (TTL) parameter. Using a depth first strategy avoid peers being visited a second time. Even so, a standard depth first search is order the sum of the number of nodes and the number of links (an enormous number on the Internet). The reason it is not that bad is that we are doing a true distributed process where many nodes are involved, so there is a great deal on parallelism.