Package ru.vassaev.core.exception

Examples of ru.vassaev.core.exception.SysException


      throw e;
    } catch (Throwable e) {
      Throwable t = e.getCause();
      if (t != null && t instanceof SysException)
        throw (SysException) t;
      throw new SysException(e);
    }
  }
View Full Code Here


        return o;
      if (o instanceof WaitValue)
        try {
          o = ((WaitValue) o).getValueWait();
        } catch (Throwable e1) {
          throw new SysException(e1);
        }
      if (Null.equ(o))
        return o;
      OutputByteBuffer obb = null;
      if (o instanceof Element) {
View Full Code Here

                                           qr.getDeclareHelperClassBody(rowClass.getCanonicalName()
                                                                        , false));
      }
      ctm = new ClassTableModel(rowClass);
    } catch (java.sql.SQLException ex) {
      throw new SysException(ex);
    } finally {
      if (qr != null)
        try {
          qr.destroy();
        } catch (SQLException e) {
View Full Code Here

      String charset = props.getProperty("charset");
      String fileName = props.getProperty("file");

      File fl = new File(fileName);
      if (!createNewFile(fl))
        throw new SysException("Cannot create file");
      FileOutputStream fls = new FileOutputStream(fl.getCanonicalPath());
      IRowFormat rf1 = rf;
      if (rf1 == null)
        rf1 = new DSVRowFormat();
      int i = 0;
      Object o = rowClass.newInstance();
      while (rs.next()) {
        dh.loadFromRs(tp_src, rs, o);
        ctm.addRowAt(o, 0);
        String s = rf1.format(ctm, 0);
        fls.write(s.getBytes(charset));
        fls.write("\r\n".getBytes(charset));
        ctm.delRowAt(0);
        i++;
      }
      rs.close();
      fls.close();
    } catch (java.sql.SQLException ex) {
      throw new SysException(ex);
    } catch (IllegalAccessException ex) {
      throw new SysException(ex);
    } catch (InstantiationException ex) {
      throw new SysException(ex);
    } catch (IOException ex) {
      throw new SysException(ex);
    } finally {
      Manager.freeConnection(con);
      if (qr != null)
        qr.close();
    }
View Full Code Here

      } else if (State.READY.equals(st)) {
        return setReady(id_subject, id, processor_id);
      } else if (State.DONE_TOUT.equals(st)) {
        return setTimeout(id_subject, id);
      } else
        throw new SysException("Unsupported state " + st.name());
    }
    return 0;
  }
View Full Code Here

    } catch (ClassNotFoundException e) {
      cls_task_api = defClass;
      try {
        method_inst = cls_task_api.getMethod("getInstance", new Class[] {String.class});
      } catch (NoSuchMethodException e1) {
        throw new SysException(e1);
      } catch (SecurityException e1) {
        throw new SysException(e1);
      }
    } catch (NoSuchMethodException e) {
      throw new SysException(e);
    } catch (SecurityException e) {
      throw new SysException(e);
    }
    try {
      return (ITaskAPI) method_inst.invoke(cls_task_api, new Object[]{alias});
    } catch (IllegalAccessException e1) {
      throw new SysException(e1);
    } catch (IllegalArgumentException e1) {
      throw new SysException(e1);
    } catch (InvocationTargetException e1) {
      throw new SysException(e1);
    }
  }
View Full Code Here

    need_send = Strings.parseBoolean(cntx.getPrmNvl("need_send", "true"));
    if (!need_send)
      return State.DONE_OK;
    urls = cntx.getPrmString("url");
    if (Null.equ(urls))
        throw new SysException("Parameter \"url\" isn't set");
    grp_in = cntx.getPrmNvl("grp_in", "in");
    grp_out = cntx.getPrmNvl("grp_out", "out");
    String tpx = cntx.getPrmString("proxy_type");
    if (tpx == null)
      proxy = null;
    else {
      if (!"SOCKS".equals(tpx) && !"DIRECT".equals(tpx) && !"HTTP".equals(tpx))
        throw new SysException("Parameter \"proxy_type\" is incorrect. Use: DIRECT, SOCKS, HTTP");
      Proxy.Type type_proxy = Proxy.Type.valueOf(tpx);
      if (Proxy.Type.DIRECT.equals(type_proxy))
        proxy = null;
      else {
        String proxy_host = cntx.getPrmString("proxy_host");
View Full Code Here

        into_map.put(into.getAttribute("from"), into.getTextContent());
      }

      dbfer = Strings.getXMLValue(fr, "update/db");
      if (dbfer == null)
        throw new SysException("There is no update/db for-each-row element");
      update = (Element) Strings.getXMLObject(fr, "update/sql");
      if (update == null)
        throw new SysException("There is no update/sql for-each-row element");
      stmt = new Sttmnt(dbfer, update, "i", "p", "o");
    }
View Full Code Here

        }
        try {
          st.execute();
          Manager.commit(con);
        } catch (SQLException e) {
          throw new SysException(e);
        }
      } catch (SysException e) {
        stmt.freeStatement(st);
        throw e;
      } finally {
View Full Code Here

        fos.close();
      }
      s.close();
      return to;
    } catch (SysException e) {
      throw new SysException(e);
    } catch (FileNotFoundException e) {
      throw new SysException(e);
    } catch (IOException e) {
      throw new SysException(e);
    }
  }
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.