Пример #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);
  }
Пример #2
0
 @Override
 public final void hotelSelected(
     final String customerName, final String hotelName, final String city) {
   log.infof(hotelSelected$str(), customerName, hotelName, city);
 }
Пример #3
0
 @Override
 public final void bookingConfirmed(final String hotelName, final String customerName) {
   log.infof(bookingConfirmed$str(), hotelName, customerName);
 }
Пример #4
0
 @Override
 public final void hotelEntityInPersistenceContext(final boolean state) {
   log.infof(hotelEntityInPersistenceContext$str(), state);
 }
Пример #5
0
 @Override
 public final void bookingInitiated(final String customerName, final String hotelName) {
   log.infof(bookingInitiated$str(), customerName, hotelName);
 }