You are on page 1of 2

Distributed Systems

Task 1: Client / server application "Distributed message queue

Goals:

1. Get to know and understand RMI

2. Implement a client / server application

3. Ensure interoperability

Preliminary remarks:

In this task a chat-like application is developed: Clients exchange via a 'standardized'

RMI interface behind which a reflector server is located. decisive

Features of this small distributed system are the distribution transparency, the openness

(Interoperability) and the fault tolerance. Correspondingly, careful implementation is essential

and testing these core features.

Task:

Develop a client / server pair according to the following specifications

dierent laboratory computers via JAVA / RMI. Therefor

1. first design the program structure, in particular the distribution components

and their mistakes;

2. implement client and server under strict adherence to the communication interface;

3. then test your programs, especially interoperability with neighboring groups;

4. Investigate the RMI communication with the network snier, document your
observations and substantiated interpretations in a protocol.

Specification:

Server:

1. The server uses its remote method newMessage ()

Clients, stores them together with an ongoing message ID and

the delivery time in its delivery queue.

2. The delivery queue has a configurable limited length so that the latest n

Messages are kept. Displacement operates according to the FIFO principle.

3. Clients can retrieve message strings using the remote method nextMessage ()

wherein the server remembers for a limited time t which message was last sent to the respective

Client was delivered. Delivered message strings have the form

<messageID> "<clientID>": "<message>" "<timestamp>, where the

clientID is defined as the string of the client IP address.

If there are no messages for the client, zero is returned.

4. The memory time t is held individually for each client and always refreshed when a

Message retrieval from the client. After expiration of the memory time, the client becomes
complete

to forget.

5. The server implements an 'at-most-once' error in the message delivery.

6. The server remains robust against client misconduct and logs its actions into one

meaningful log files.

7. The server registers its remote interface under the name MessageService".

Interface:

Client and server communicate via the following remote interface:

public interface MessageService extends Remote {


public String nextMessage(String clientID) throws
RemoteException;
public void newMessage(String clientID, String message) throws
RemoteException;
}

Client:

1. The client has two functional areas: the editing and the reception. Both Functions are
part of a GUI in which the corresponding server is also configured can be.
2. As an editor client, messages with the remote method newMessage () are displayed the
server. In this case, the client implements an 'at-least-once' error semantics the message delivery.
3. As a read client, messages are sent with the remote method nextMessage () from the
Server, where the client provides a mode in which all available Messages are fetched and
displayed. The client implements a 'Maybe' error in message retrieval.
4. The client remains robust against server failures during a configurable tolerance interval
of seconds.

Submission (as stated in the lecture):

Before the practical:

1. Conception of program set-up and distribution components with error semantics

After the practical:

2. Revised concept with implementation documentation and well-founded experimental protocol


3. Documented program code

Online Documentation about Java RMI:

http://docs.oracle.com/javase/tutorial/rmi/overview.html
http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136424.html

Pay particular attention to the necessary security settings for the RMI Registry!