Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Chatmessage implements Serializable{
- private String name;
- private String text;
- private String linha;
- private String nameReserved;
- private String estado;
- private Action action;
- private LoteestadoTESTE lote;
- private Set<LoteestadoTESTE> listLotes;
- private Set<LinhasOnline> listLinhaOnline;
- private Boolean admin=false;
- //GET's E SET's
- private synchronized void sendValoresAndon() {
- // LoteestadoTESTE lote =new LoteestadoTESTE();
- Set<LoteestadoTESTE> listLotes = new HashSet<LoteestadoTESTE>();
- Chatmessage message = new Chatmessage();
- //percorre TODOS OS COMPUTADORES ONLINES
- for (Map.Entry<String, ObjectOutputStream> linhasuser : mapUsers.entrySet()) {
- for (LoteestadoTESTE i : SetlinhaLoteStateATUAL) {
- //verifica se a cabine que o user está é igual a da linha a ser processada
- //se sim adiciona na lista [LISTA FICA COM O CONHECIMENTO DE TODAS AS LINHAS DA CABINE]
- if (linhasuser.getKey().equals(getCabineByLinha(getLinhaByCod(i.getLinha())))) {
- listLotes.add(i);
- System.out.println(" +-+-+-+-+" + i); //para verificar o que vou enviar
- }
- }
- try {
- message.setListLotes(listLotes);
- message.setAction(Action.VALORESANDON);
- linhasuser.getValue().writeObject(message);
- listLotes.clear();
- } catch (IOException ex) {
- Logger.getLogger(ServidorService.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement