Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. public class Chatmessage implements Serializable{
  2. private String name;
  3. private String text;
  4. private String linha;
  5. private String nameReserved;
  6. private String estado;
  7. private Action action;
  8. private LoteestadoTESTE lote;
  9. private Set<LoteestadoTESTE> listLotes;
  10. private Set<LinhasOnline> listLinhaOnline;
  11. private Boolean admin=false;
  12.  
  13. //GET's E SET's
  14.  
  15. private synchronized void sendValoresAndon() {
  16.  
  17. // LoteestadoTESTE lote =new LoteestadoTESTE();
  18. Set<LoteestadoTESTE> listLotes = new HashSet<LoteestadoTESTE>();
  19. Chatmessage message = new Chatmessage();
  20.  
  21. //percorre TODOS OS COMPUTADORES ONLINES
  22. for (Map.Entry<String, ObjectOutputStream> linhasuser : mapUsers.entrySet()) {
  23.  
  24. for (LoteestadoTESTE i : SetlinhaLoteStateATUAL) {
  25. //verifica se a cabine que o user está é igual a da linha a ser processada
  26. //se sim adiciona na lista [LISTA FICA COM O CONHECIMENTO DE TODAS AS LINHAS DA CABINE]
  27. if (linhasuser.getKey().equals(getCabineByLinha(getLinhaByCod(i.getLinha())))) {
  28. listLotes.add(i);
  29. System.out.println(" +-+-+-+-+" + i); //para verificar o que vou enviar
  30. }
  31.  
  32. }
  33.  
  34. try {
  35. message.setListLotes(listLotes);
  36. message.setAction(Action.VALORESANDON);
  37. linhasuser.getValue().writeObject(message);
  38. listLotes.clear();
  39. } catch (IOException ex) {
  40. Logger.getLogger(ServidorService.class.getName()).log(Level.SEVERE, null, ex);
  41. }
  42.  
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement