@Override
    public synchronized void connected(final Mesos mesos) {
      System.out.println("Connected");
      state = State.CONNECTED;
      retryTimer = new Timer();
      retryTimer.schedule(new TimerTask() {
        @Override
        public void run() {
          doReliableRegistration(mesos);
        }
      }, 0, 1000); // Repeat every 1 second
    }
@Override
    public synchronized void connected(final Mesos mesos) {
      System.out.println("Connected");
      state = State.CONNECTED;
      retryTimer = new Timer();
      retryTimer.schedule(new TimerTask() {
        @Override
        public void run() {
          doReliableRegistration(mesos);
        }
      }, 0, 1000);
    }
@override public synchronized void connected(final mesos mesos) { system.out.println("connected"); state = state.connected; retrytimer = new timer(); retrytimer.schedule(new timertask() { @override public void run() { doreliableregistration(mesos); } }, 0, 1000); }