示例#1
0
 @Override
 public Iterable<ADataPacket> relayMsg(ADataPacket data) {
   ArrayList<ADataPacket> packetList = new ArrayList<ADataPacket>();
   for (IUser user : localUserList) {
     try {
       packetList.add(user.receiveData(data));
     } catch (RemoteException e) {
       e.printStackTrace();
     }
   }
   return packetList;
 }
示例#2
0
 public ChatRoom(IUser meStub, Iterable<IUser> userList) {
   this.localUserList = new ArrayList<IUser>();
   if (userList != null) {
     for (IUser tempUser : userList) {
       try {
         tempUser.receiveData(new DataPacket<IAddUser>(IAddUser.class, meStub, new AddUser()));
       } catch (RemoteException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
       }
       localUserList.add(tempUser);
     }
   }
   this.addLocalUser(meStub);
 }