Package edu.pdx.cs410J.net
package edu.pdx.cs410J.net
This package contains classes that demonstrates Java's networking and concurrent programming facilities.
Some networking and threading resources:
- The Threads trail of Sun's Java Tutorial
- The networking trail of Sun's Java Tutorial
- General networking information
-
ClassesClassDescriptionThis class demonstrates how concurrent access to a bank account needs to be synchronized in order to guarantee the balance is always correct.A
BackAccountmaintains a integer balance.AChatCommunicatorobtains aSocketand then creates aChatSpeakerand aChatListenerthat run in their own threads.AChatListenerruns in the background and listens for messages on a socket on localhost.This class represents a message that is passed between twoChatSessions.This class allows two people to chat.AChatSpeakerruns in the background and sendsChatMessages over aSocket.ACounteris something that counts in its own thread.This class demonstrates concurrency in Java by having Big Bird and Mr.A server that waits for aDateClientto connect to it.A worker thread that waits five seconds before returning the current date.This program dumps the contents of a URL to standard out.This class is used to demonstrate object serialization support for referential integrity.This program starts up a bunch ofWorkingThreads and also starts anInterruptingThreadthat will interrupt eachWorkingThreadafter a given number of seconds.This program listens to a socket.Uses aURLClassLoaderto load a resource from a given URL.AMcCustomerarrives aMcDonaldsand waits for a BigMac.This class models aMcDonalds.This class represents an employee of aMcDonaldswho makes BigMacs(tm).This class demonstrates object serialization by reading an instance ofDatefrom a file.This class demonstrates serialization support for referential integrity by deserializing a graph ofGraphNodes.ASpeakersends strings over aSocketto aListener.This class demonstrates obtains a lock before access theBankAccount.Synchronized methods ensure that the data in the balance is accessed correctly.Transfers money between twoBankAccounts.This thread will work until and then wait until it is interrupted.Demonstrates serialization by writing an instance ofDateto a file.This program constructs a graph ofNodes and serializes them to a file.