Package org.jboss.dna.common

Examples of org.jboss.dna.common.SystemFailureException


                    Reflection reflection = new Reflection(newInstance.getClass());
                    reflection.invokeSetterMethodOnTarget(entry.getKey(), newInstance, entry.getValue());
                }
            }
        } catch (Throwable e) {
            throw new SystemFailureException(e);
        }
        if (newInstance instanceof Component && ((Component<ConfigType>)newInstance).getConfiguration() == null) {
            throw new SystemFailureException(CommonI18n.componentNotConfigured.text(config.getName()));
        }
        return newInstance;
    }
View Full Code Here


    StringBuilder sb = new StringBuilder();
    sb.append("[ ");
    try {
      sb.append(new String(array, "UTF-8"));
    } catch (UnsupportedEncodingException e) {
      throw new SystemFailureException(e);
    }
    sb.append(" ]");
    return sb.toString();
  }
View Full Code Here

          // Ensure field is of type I18n
          if (fld.getType() == I18n.class) {

            // Ensure field is public
            if ((fld.getModifiers() & Modifier.PUBLIC) != Modifier.PUBLIC) {
              throw new SystemFailureException(CommonI18n.i18nFieldNotPublic.text(fld.getName(), i18nClass));
            }

            // Ensure field is static
            if ((fld.getModifiers() & Modifier.STATIC) != Modifier.STATIC) {
              throw new SystemFailureException(CommonI18n.i18nFieldNotStatic.text(fld.getName(), i18nClass));
            }

            // Ensure field is not final
            if ((fld.getModifiers() & Modifier.FINAL) == Modifier.FINAL) {
              throw new SystemFailureException(CommonI18n.i18nFieldFinal.text(fld.getName(), i18nClass));
            }

            // Ensure we can access field even if it's in a private class
            ClassUtil.makeAccessible(fld);
View Full Code Here

    if (text != null) {
      return text;
    }
    // If not, there was a problem, so throw it within an exception so upstream callers can tell the difference between normal
    // text and problem text.
    throw new SystemFailureException(problem(locale));
  }
View Full Code Here

            newInstance = doCreateInstance(componentClass);
            if (newInstance instanceof Component) {
                ((Component<ConfigType>)newInstance).setConfiguration(config);
            }
        } catch (Throwable e) {
            throw new SystemFailureException(e);
        }
        if (newInstance instanceof Component && ((Component<ConfigType>)newInstance).getConfiguration() == null) {
            throw new SystemFailureException(CommonI18n.componentNotConfigured.text(config.getName()));
        }
        return newInstance;
    }
View Full Code Here

                gzos.write(source, off, len);
                gzos.close();
            } catch (IOException e) {
                error = true;
                throw new SystemFailureException(e); // error using reading from byte array!
            } finally {
                if (gzos != null) {
                    try {
                        gzos.close();
                    } catch (IOException e) {
                        if (!error) new SystemFailureException(e); // error closing streams over byte array!
                    }
                }
            }

            // Return value according to relevant encoding.
View Full Code Here

                StringBuilder sb = new StringBuilder();
                sb.append("" + source[srcOffset] + ": " + (DECODABET[source[srcOffset]]) + "\n");
                sb.append("" + source[srcOffset + 1] + ": " + (DECODABET[source[srcOffset + 1]]) + "\n");
                sb.append("" + source[srcOffset + 2] + ": " + (DECODABET[source[srcOffset + 2]]) + "\n");
                sb.append("" + source[srcOffset + 3] + ": " + (DECODABET[source[srcOffset + 3]]) + "\n");
                throw new SystemFailureException(sb.toString(), e);
            }
        }
    }
View Full Code Here

                    }

                }

            } else {
                throw new SystemFailureException("Bad Base64 input character at " + i + ": " + source[i] + "(decimal)");
            }
        }

        byte[] out = new byte[outBuffPosn];
        System.arraycopy(outBuff, 0, out, 0, outBuffPosn);
View Full Code Here

                    try {
                        if (gzis != null) {
                            try {
                                gzis.close();
                            } catch (IOException e) {
                                throw new SystemFailureException(e); // bad problems with JRE if this doesn't work
                            }
                        }
                    } finally {
                        try {
                            bais.close();
                        } catch (Exception e) {
                            if (!error) throw new SystemFailureException(e); // bad problems with JRE if this doesn't work
                        }
                    }
                }

            }
View Full Code Here

                    // Ensure field is of type I18n
                    if (fld.getType() == I18n.class) {

                        // Ensure field is public
                        if ((fld.getModifiers() & Modifier.PUBLIC) != Modifier.PUBLIC) {
                            throw new SystemFailureException(CommonI18n.i18nFieldNotPublic.text(fld.getName(), i18nClass));
                        }

                        // Ensure field is static
                        if ((fld.getModifiers() & Modifier.STATIC) != Modifier.STATIC) {
                            throw new SystemFailureException(CommonI18n.i18nFieldNotStatic.text(fld.getName(), i18nClass));
                        }

                        // Ensure field is not final
                        if ((fld.getModifiers() & Modifier.FINAL) == Modifier.FINAL) {
                            throw new SystemFailureException(CommonI18n.i18nFieldFinal.text(fld.getName(), i18nClass));
                        }

                        // Ensure we can access field even if it's in a private class
                        ClassUtil.makeAccessible(fld);
View Full Code Here

TOP

Related Classes of org.jboss.dna.common.SystemFailureException

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.