Package ru.vassaev.core.exception

Examples of ru.vassaev.core.exception.SysException


          ex.printStackTrace();
          attempt--;
          if (attempt > 0) {
            con = Manager.reInitConnection(con);
          } else
            throw new SysException(ex);
        }

      long tm = 0;
      sql = "select u.dt_goal from tasks u \n" + "where u.id=?";

      attempt = 2;
      while (true)
        try {
          pst = con.prepareStatement(sql);
          try {
            pst.setLong(1, id);
            ResultSet rs = pst.executeQuery();
            if (rs.next())
              tm = rs.getTimestamp(1).getTime();
            rs.close();
          } finally {
            pst.close();
          }
          return tm;
        } catch (SQLException ex) {
          ex.printStackTrace();
          attempt--;
          if (attempt > 0) {
            con = Manager.reInitConnection(con);
          } else
            throw new SysException(ex);
        } catch (Exception ex) {
          throw new SysException(ex);
        }
    } finally {
      Manager.freeConnection(con);
    }
  }
View Full Code Here


  }

  public final PoolThread getProcessPoolByName(String name) throws SysException {
    String poolProcessName = Strings.getString(cntx.getPrmString(name));
    if (poolProcessName == null)
      throw new SysException("Parameter \"" + name + "\" isn't set");
    AppInfo ai = ApplicationManager.getCurrentAppInfo();
    Pool<?> poolprc = ai.getContainer().getRM().getPool(poolProcessName);
    if (Null.equ(poolprc))
      throw new SysException("There is no pool by name \"" + poolProcessName
          + "\"");
    try {
      PoolThread prcs = (PoolThread) poolprc;
      return prcs;
    } catch (ClassCastException e) {
      throw new SysException("The pool by name \"" + poolProcessName
          + "\" dosn't contain process' object");
    }
  }
View Full Code Here

  public void start(ru.vassaev.core.thread.Process prc, long id_processor,
      long id_task, ITaskAPI ta, TaskInfo ti) throws SysException {
    synchronized (this) {
      if (isRun)
        throw new SysException("The processor is busy.");
      isRun = true;
    }
    this.id_processor = id_processor;
    cntx = new Context(id_processor, id_task, ta, ti);
    ta.log(id_processor, id_task, "Starting...");
View Full Code Here

          ex.printStackTrace();
          attempt--;
          if (attempt > 0) {
            con = Manager.reInitConnection(con);
          } else
            throw new SysException(ex);
        } catch (Exception ex) {
          throw new SysException(ex);
        }
    } finally {
      Manager.freeConnection(con);
    }
  }
View Full Code Here

      if (mi != null) {
        File x;
        try {
          x = Process.getTempFile();
        } catch (IOException e) {
          throw new SysException(e);
        }
        try {

          MailSender ms = new MailSender();
          ms.setInitProperty("mail.smtp.host", mi.smtphost);
View Full Code Here

          ex.printStackTrace();
          attempt--;
          if (attempt > 0) {
            con = Manager.reInitConnection(con);
          } else
            throw new SysException(ex);
        }
    } finally {
      Manager.freeConnection(con);
    }
  }
View Full Code Here

        ta.log(id_processor, id_task,
            "The task was completed with " + st.name() + " status");
        saveParams(Saved.TIME.after);
        ta.setState(id_processor, id_task, st, null);
      } else {
        ta.setTaskError(cntx.id_task, new SysException(
            "It is impossible processing"));
        saveParams(Saved.TIME.after);
        ta.setCanceled(id_processor, id_task);
      }
    } catch (RuntimeException ex) {
View Full Code Here

          ex.printStackTrace();
          attempt--;
          if (attempt > 0) {
            con = Manager.reInitConnection(con);
          } else
            throw new SysException(ex);
        } catch (Exception ex) {
          throw new SysException(ex);
        }
    } finally {
      Manager.freeConnection(con);
    }
  }
View Full Code Here

          ex.printStackTrace();
          attempt--;
          if (attempt > 0) {
            con = Manager.reInitConnection(con);
          } else
            throw new SysException(ex);
        } catch (Exception ex) {
          throw new SysException(ex);
        }
    } finally {
      Manager.freeConnection(con);
    }
  }
View Full Code Here

          ex.printStackTrace();
          attempt--;
          if (attempt > 0) {
            con = Manager.reInitConnection(con);
          } else
            throw new SysException(ex);
        } catch (Exception ex) {
          throw new SysException(ex);
        }
    } finally {
      Manager.freeConnection(con);
    }
  }
View Full Code Here

TOP

Related Classes of ru.vassaev.core.exception.SysException

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.