Package at.molindo.esi4j.chain.Esi4JBatchedEventProcessor

Examples of at.molindo.esi4j.chain.Esi4JBatchedEventProcessor.EventSession


  }

  @Override
  public void onPostInsert(PostInsertEvent event) {
    EventSession eventSession = findEventSession(event.getSession());
    if (eventSession != null) {
      eventSession.onPostInsert(event.getEntity());
    } else {
      _batchedEventProcessor.onPostInsert(event.getEntity());
    }
  }
View Full Code Here


    }
  }

  @Override
  public void onPostUpdate(PostUpdateEvent event) {
    EventSession eventSession = findEventSession(event.getSession());
    if (eventSession != null) {
      eventSession.onPostUpdate(event.getEntity());
    } else {
      _batchedEventProcessor.onPostUpdate(event.getEntity());
    }
  }
View Full Code Here

    }
  }

  @Override
  public void onPostDelete(PostDeleteEvent event) {
    EventSession eventSession = findEventSession(event.getSession());
    if (eventSession != null) {
      eventSession.onPostDelete(event.getEntity());
    } else {
      _batchedEventProcessor.onPostDelete(event.getEntity());
    }
  }
View Full Code Here

  }

  private EventSession findEventSession(EventSource hibernateSession) {
    if (hibernateSession.isTransactionInProgress()) {
      final Transaction transaction = hibernateSession.getTransaction();
      EventSession session = _map.get(transaction);
      if (session == null) {
        session = _batchedEventProcessor.startSession();

        transaction.registerSynchronization(new Esi4JHibernateSynchronization(transaction));
View Full Code Here

    }

    @Override
    public void afterCompletion(int status) {

      EventSession session = _map.remove(_transaction);

      if (session == null) {
        log.error("no session registered for transaction");
      } else if (status == Status.STATUS_COMMITTED) {
        session.flush();
      }
    }
View Full Code Here

    _batchedEventProcessor = batchedEventProcessor;

  }

  public void onPostInsert(PostInsertEvent event) {
    EventSession eventSession = findEventSession(event.getSession());
    if (eventSession != null) {
      eventSession.onPostInsert(event.getEntity());
    } else {
      _batchedEventProcessor.onPostInsert(event.getEntity());
    }
  }
View Full Code Here

      _batchedEventProcessor.onPostInsert(event.getEntity());
    }
  }

  public void onPostUpdate(PostUpdateEvent event) {
    EventSession eventSession = findEventSession(event.getSession());
    if (eventSession != null) {
      eventSession.onPostUpdate(event.getEntity());
    } else {
      _batchedEventProcessor.onPostUpdate(event.getEntity());
    }
  }
View Full Code Here

      _batchedEventProcessor.onPostUpdate(event.getEntity());
    }
  }

  public void onPostDelete(PostDeleteEvent event) {
    EventSession eventSession = findEventSession(event.getSession());
    if (eventSession != null) {
      eventSession.onPostDelete(event.getEntity());
    } else {
      _batchedEventProcessor.onPostDelete(event.getEntity());
    }
  }
View Full Code Here

  }

  private EventSession findEventSession(EventSource hibernateSession) {
    if (hibernateSession.isTransactionInProgress()) {
      final Transaction transaction = hibernateSession.getTransaction();
      EventSession session = _map.get(transaction);
      if (session == null) {
        session = _batchedEventProcessor.startSession();

        transaction.registerSynchronization(new Esi4JHibernateSynchronization(transaction));
View Full Code Here

    }

    @Override
    public void afterCompletion(int status) {

      EventSession session = _map.remove(_transaction);

      if (session == null) {
        log.error("no session registered for transaction");
      } else if (status == Status.STATUS_COMMITTED) {
        session.flush();
      }
    }
View Full Code Here

TOP

Related Classes of at.molindo.esi4j.chain.Esi4JBatchedEventProcessor.EventSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.