Package com.im.imjutil.exception

Examples of com.im.imjutil.exception.TransactionException


   *
   * @throws TransactionException caso ja estiver ativa.
   */
  public void begin() throws TransactionException {
    if (active) {
      throw new TransactionException("A transacao ja esta ativa");
    }
    this.setActive();
  }
View Full Code Here


   * @throws ValidationException caso a acao for nula.
   * @throws TransactionException caso a transacao nao estiver ativa.
   */
  public void add(Action action) {
    if (!active) {
      throw new TransactionException(
          "Nao e possivel adicionar acoes em uma transacao inativa");
    }
    if (action == null) {
      throw new ValidationException("O parametro action e nulo");
    }
View Full Code Here

   * @throws ValidationException caso a acao for nula.
   * @throws TransactionException caso a transacao nao estiver ativa.
   */
  public void remove(Action action) {
    if (!active) {
      throw new TransactionException(
          "Nao e possivel remover acoes em uma transacao inativa");
    }
    if (action == null) {
      throw new ValidationException("O parametro action e nulo");
    }
View Full Code Here

   *
   * @throws Exception caso ocorra algum erro.
   */
  public void commit() throws TransactionException {
    if (!active) {
      throw new TransactionException(
          "Nao e possivel cometer uma transacao inativa");
    }
    for (Action action : actions) {
      action.execute();
      ++index;
View Full Code Here

   *
   * @throws Exception caso ocorra algum erro.
   */
  public void rollback() throws TransactionException {
    if (!active) {
      throw new TransactionException(
          "Nao e possivel reverter uma transacao inativa");
    }
    for (int i = index; i >= 0 ; --i) {
      actions.get(i).undo();
    }
View Full Code Here

TOP

Related Classes of com.im.imjutil.exception.TransactionException

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.