Code Search for Developers
 
 
  

CallbackThread.java from MASE: Agile Software Engineering at Krugle


Show CallbackThread.java syntax highlighted

package persister.network;

import java.io.ObjectInputStream;

import persister.Message;
import persister.distributed.CallbackCommunicator;

public class CallbackThread extends Thread {
	
	CallbackCommunicator comm;
	ObjectInputStream in ;
	
	public CallbackThread(ObjectInputStream in, CallbackCommunicator comm){
		this.in= in;
		this.comm = comm;
		this.start();
	}
	
	public void run(){
		try{
			while(true){
				Object obj = in.readObject();
				try{
					Message msg = (Message)obj;
					comm.receiveMessage(msg);
				}catch(ClassCastException e){
					//ignore message but don't close connection
					System.out.println("Invalid Class in Stream:" + obj.getClass());
				}
			}
		}catch(Exception e){
//			e.printStackTrace();
			this.stop();
		}
	}
}




See more files for this project here

MASE: Agile Software Engineering

The MASE project investigates methods to support the coordination and executable acceptance testing of software projects. Keywords: Agile methods, distributed teams, Extreme Programming. See http://ebe.cpsc.ucalgary.ca/ebe for more information.

Project homepage: http://sourceforge.net/projects/mase
Programming language(s): Java,XML
License: other

  CallbackThread.java
  NetworkClient.java
  NetworkServer.java
  ServerContext.java
  ServerThreadWorker.java