Changes

Jump to: navigation, search

Teams Winter 2011/team6/lab2

1,097 bytes added, 13:50, 12 April 2011
Create Java Classes Required
}
}
 
SimpleChatSystem.java
 
import java.util.ArrayList;
import cs.dps914.osgi.lab.chatinterface.IChatClient;
import cs.dps914.osgi.lab.chatinterface.IChatSystem;
import cs.dps914.osgi.lab.chatinterface.IMessage;
public class SimpleChatSystem implements IChatSystem {
public static ArrayList<IChatClient> clientList=new ArrayList<IChatClient>();
public static ArrayList<IMessage> messageList=new ArrayList<IMessage>();
public void registerClient(IChatClient client) {
clientList.add(client);
}
public ArrayList<IMessage> appendMessage(String src, String msg) {
IMessage newMsg=new SimpleMessage(src,msg);
messageList.add(newMsg);
for (IChatClient client:clientList) {
client.receiveMessage(newMsg);
}
return messageList;
}
}
 
lalala
1
edit

Navigation menu