コード例 #1
0
  @Override
  public void onPostUpdate(final PostUpdateEvent event) {
    Object entity = event.getEntity();
    if (!(entity instanceof HTextFlowTarget)) {
      return;
    }

    try {
      new Work<Void>() {
        @Override
        protected Void work() throws Exception {
          ContentState oldContentState =
              (ContentState)
                  Iterables.find(
                      Lists.newArrayList(event.getOldState()),
                      Predicates.instanceOf(ContentState.class));

          HTextFlowTarget target = HTextFlowTarget.class.cast(event.getEntity());
          prepareTransUnitUpdatedEvent(target.getVersionNum() - 1, oldContentState, target);
          return null;
        }
      }.workInTransaction();
    } catch (Exception e) {
      log.error("fail to publish TransUnitUpdate event", e);
    }
  }
コード例 #2
0
  public void onPostUpdate(PostUpdateEvent event) {
    final Object entity = event.getEntity();
    AbstractSavePersistentMethod.clearDisabledValidations(entity);
    if (postUpdateEventListener == null) {
      return;
    }

    doWithManualSession(
        event,
        new Closure(this) {
          @Override
          public Object call() {
            postUpdateEventListener.call(entity);
            return null;
          }
        });
  }
コード例 #3
0
 @Override
 public void onPostUpdate(PostUpdateEvent event) {
   evictCache(event.getEntity(), event.getPersister(), event.getSession(), event.getOldState());
 }