FileDocCategorySizeDatePackage
ProcessIt.javaAPI DocExample2416Thu Feb 04 16:10:38 GMT 1999None

ProcessIt

public class ProcessIt extends Object implements Runnable

Fields Summary
String[]
is
Barrier
bpStart
Barrier
bp1
Barrier
bp2
Barrier
bpEnd
Constructors Summary
public ProcessIt(String[] sources)

		is = sources;
		bpStart = new Barrier(sources.length);
		bp1 = new Barrier(sources.length);
		bp2 = new Barrier(sources.length);
		bpEnd = new Barrier(sources.length);

		for (int i=0; i < is.length; i++) {
			(new Thread(this)).start();
		}
	
Methods Summary
public voiddoPhaseOne(java.lang.String ps)

		System.out.println("phase one -- " + ps);
	
public voiddoPhaseThree(java.lang.String ps)

		System.out.println("phase three -- " + ps);
	
public voiddoPhaseTwo(java.lang.String ps)

		System.out.println("phase two -- " + ps);
	
public static voidmain(java.lang.String[] args)

		System.out.println("Starting");
		ProcessIt pi = new ProcessIt(args);
	
public voidrun()

		System.out.println("Starting");
		try {
			int i = bpStart.waitForRest();
			doPhaseOne(is[i]);
			bp1.waitForRest();
			doPhaseTwo(is[i]);
			bp2.waitForRest();
			doPhaseThree(is[i]);
			bpEnd.waitForRest();
			System.out.println("Exiting");
		} catch (InterruptedException ex) {};