Olá, sou novo no fórum e gostaria de um help de vocês. Assim estou implementando uma agenda utilizando RMI, e preciso criar uma thread para CADA USUÁRIO que entrar no servidor, ou seja, cada usuário terá uma thread rodando no servidor. No método run da thread, como irei informar o que o usuário optou, se foi uma busca, alteração ou exclusão? E como irei monitorar essas escolharsdo usuário na view e passar para a thread já iniciada no começo do programa?? Desde já agradeço.
Classe UsoAgenda
public class UsoAgenda implements Runnable{
Service service;
public UsoAgenda(Service service) {
this.service = service;
}
@Override
public void run() {
}
}
__________________<strong><strong><strong><strong><strong><strong><strong><strong>-</strong></strong></strong></strong></strong></strong></strong></strong>
classe ServeImpl (onde preciso criar as threads para usuário)
public class ControllerAgenda {
public ControllerAgenda() {
evento = new Evento();
eventos = new ArrayList<>();
}
public void iniciaServico() throws RemoteException {
Client cliente = new Client();
this.service = cliente.inicia();
ViewAcessoUser acessoUser = new ViewAcessoUser();
acessoUser.setVisible(true);
}
public Evento marcarCompromisso(String nome, String data, String hora, String desc) throws RemoteException {
evento = service.marcarCompromisso(nome, data, hora, desc);
return evento;
}
public ArrayList<Evento> attList() throws RemoteException {
eventos = service.getEventos();
return eventos;
}
}
