CS476/576

Assignment #5

Due Midnight, Wednesday Dec. 3, 2003


Write a Java/swing program with the following descriptions:

NAME

cascade - A  Java program with a swing interface that creates/terminates a set of tcp-connected threads.
SYNOPSIS
java cascade
DESCRIPTION

The program creates n > 1 threads. Thread i creates thread i+1, for i=1, 2, ...n-1. Therefore,  thread i is considered the parent of thread i+1 and  thread i+1 is considered the child of thread i, for i=1, 2,..., n-1. Each thread is connected to its next thread with a tcp socket. 

If  thread i is terminated then all  other n-1 threads will be terminated. Therefore terminating any thread  will have a cascading effect on all other threads.

Program Interface:

You have the complete freedom of designing your own SWING interface.
However, each interface must have the  following features:

Thread i STARTED:  Parent Port x, Child Port y
Thread i  TERMINATED:  reason
where reason can be one of  three values: self/parent/child.

* For  CS476 students: You may not implement this option, you may always terminate the first or the last thread.

Extra Credit: If you implement this program as Applet & Application,  you will get +2
(cs576 students) or +3 (cs476 students).