Ver Mensaje Individual
  #5 (permalink)  
Antiguo 23/10/2012, 07:48
cucuru
 
Fecha de Ingreso: marzo-2009
Mensajes: 509
Antigüedad: 15 años, 2 meses
Puntos: 17
Respuesta: problema con HashMap

He descubierto un poquito más, pero no llego a nada.

He empezado de cero:

Código:
public MyTimer(long mac, String ipAddress){
    this.macAddress = mac;
    this.ip = ipAddress;

    timer = new Timer();

    TimerTask timerTask = new TimerTask() {

        @Override
        public void run() {
            log.info("mac " + String.valueOf(macAddress) + " ip " + ip);

        }
    };

    timer.schedule(timerTask, 30*1000,30*1000);
    log.info("timer created, mac:" String.valueOf(macAddress) + " ip " + ip);
}
Desde otra clase

Código:
MyTimer timer1 = new MyTimer(mac1, ip1);
MyTimer timer2 = new MyTimer(mac2, ip2);
Cuando se crean:

Código:
Oct 23, 2012 1:36:43 PM spb.MyTimer <init>
INFO: timer created, mac: 26954208388119 ip 77.209.184.53
Oct 23, 2012 1:36:43 PM spb.MyTimer <init>
INFO: timer created, mac 26954208388118 ip 178.139.7.27
Cuando se alcanza el timer la cosa falla

Código:
Oct 23, 2012 1:39:13 PM spb.MyTimer$1 run
INFO: mac 26954208388119 ip 178.139.7.27
Oct 23, 2012 1:39:13 PM spb.MyTimer$1 run
INFO: mac 26954208388118 ip 178.139.7.27
También he probado con "MyTimer extends TimerTask" pero nada, que no doy con ello...