Esempio n. 1
0
  public void start() {
    log.infof("Starting HeartbeatEmitter. Observe the HeartbeatEvent to subscribe.", Instant.now());

    final Runnable emitter =
        new Runnable() {
          @Override
          public void run() {
            try {
              log.debugf("heartbeat: %s", Instant.now());
              heartbeat.fire(new HeartbeatEvent());
            } catch (Exception e) {
              log.error(e);
            }
          }
        };

    emitterHandle =
        scheduler.scheduleAtFixedRate(emitter, initialDelay, periodInSeconds, TimeUnit.SECONDS);
  }
Esempio n. 2
0
 @Override
 public final void hotelSelected(
     final String customerName, final String hotelName, final String city) {
   log.infof(hotelSelected$str(), customerName, hotelName, city);
 }
Esempio n. 3
0
 @Override
 public final void bookingConfirmed(final String hotelName, final String customerName) {
   log.infof(bookingConfirmed$str(), hotelName, customerName);
 }
Esempio n. 4
0
 @Override
 public final void hotelEntityInPersistenceContext(final boolean state) {
   log.infof(hotelEntityInPersistenceContext$str(), state);
 }
Esempio n. 5
0
 @Override
 public final void bookingInitiated(final String customerName, final String hotelName) {
   log.infof(bookingInitiated$str(), customerName, hotelName);
 }