示例#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);
 }