Package com.iisigroup.cap.exception

Examples of com.iisigroup.cap.exception.CapException


    try {
      OutputStream out = response.getOutputStream();
      out.write(string.getBytes(encoding));
      out.flush();
    } catch (Exception e) {
      throw new CapException(e.getMessage(), e, getClass());
    }
  }
View Full Code Here


      if (e.getCause() instanceof CapMessageException) {
        throw (CapMessageException) e.getCause();
      } else if (e.getCause() instanceof CapException) {
        throw (CapException) e.getCause();
      } else {
        throw new CapException(e.getCause(), this.getClass());
      }
    } catch (Throwable t) {
      throw new CapException(t, this.getClass());
    }
    return result;
  }// ;
View Full Code Here

        if (e.getCause() instanceof CapMessageException) {
          throw (CapMessageException) e.getCause();
        } else if (e.getCause() instanceof CapException) {
          throw (CapException) e.getCause();
        } else {
          throw new CapException(e.getCause(),
              executeHandler.getClass());
        }
      } catch (Throwable t) {
        throw new CapException(t, executeHandler.getClass());
      }
      if (!hasMethod) {
        throw new CapMessageException("action not found", getClass());
      }
      return rtn;
View Full Code Here

      }
      logMessage = formatMessage(request, logMessage,
          ce.getExtraInformation());
      errorMessage.put(AJAX_SESSION_EXPIRE_EXCEPTION, logMessage);
    } else if (e instanceof CapException) {
      CapException ce = (CapException) e;
      logMessage = new StringBuffer(ce.getCauseClass().getName())
          .append(":").append(e.getMessage()).toString();
      errorMessage.put(AJAX_HANDLER_EXCEPTION, logMessage);
    } else {
      logMessage = e.getLocalizedMessage();
      errorMessage.put(AJAX_HANDLER_EXCEPTION, logMessage);
View Full Code Here

        len += length;
      }
      response.setContentLength(len);
      output.flush();
    } catch (Exception e) {
      throw new CapException(e, getClass());
    } finally {
      IOUtils.closeQuietly(in);
      IOUtils.closeQuietly(output);
    }
View Full Code Here

      try {
        ts.execute();
      } catch (CapException e) {
        throw e;
      } catch (Exception e) {
        throw new CapException(e, e.getClass());
      }
    }
    executeService(startTime, rService, rTimeout);
    executeService(startTime, nrService, nrTimeout);
    // merge data
View Full Code Here

    } catch (NullPointerException e) {
      throw new CapMessageException("msg.job.fileNotFund", getClass());
    } catch (CapMessageException me) {
      throw me;
    } catch (Exception e1) {
      throw new CapException(e1, getClass());
    }
  }// ;
View Full Code Here

        }
      }
    } catch (CapException ce) {
      throw ce;
    } catch (Exception e) {
      throw new CapException(e, getClass());
    } finally {
      logger.debug("Operation cost : {} ms",
          (System.currentTimeMillis() - startOperation));
    }
  }
View Full Code Here

        if (method != null) {
          method.invoke(this, value);
        }
      }
    } catch (Exception e) {
      throw new CapException(new StringBuffer("field:").append(field)
          .append(" ").append(e.getMessage()).toString(), e,
          getClass());
    }
    return (T) this;
  }
View Full Code Here

   *            欄位名稱
   * @return Object
   */
  public Object get(String fieldId) {
    if (CapString.isEmpty(fieldId)) {
      throw new CapException("field [" + fieldId + "] is empty!!",
          getClass());
    }
    try {
      String field = fieldId;
      int index = fieldId.indexOf(".");
      if (index > 0) {
        field = fieldId.substring(0, index);
        Object keyClazz = get(field);
        if (keyClazz instanceof GenericBean) {
          return ((GenericBean) keyClazz).get(fieldId
              .substring(index + 1));
        }
      } else {
        String getter = new StringBuffer("get")
            .append(String.valueOf(field.charAt(0)).toUpperCase())
            .append(field.substring(1)).toString();
        Method method = ReflectionUtils.findMethod(getClass(), getter);
        if (method == null) {
          getter = "is" + getter.substring(3);
          method = ReflectionUtils.findMethod(getClass(), getter);
        }
        if (method != null) {
          return method.invoke(this);
        } else {
          Field f = ReflectionUtils.findField(getClass(), field);
          if (f != null) {
            f.setAccessible(true);
            return f.get(this);
          }
        }
      }
      throw new CapException(new StringBuffer("field:").append(field)
          .append(" is not exist!!").toString(), getClass());

    } catch (Exception e) {
      throw new CapException(e, getClass());
    }

  }// ;
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.exception.CapException

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.