Package org.jboss.dna.common

Examples of org.jboss.dna.common.SystemFailureException


     * {@inheritDoc}
     */
    @Override
    protected void doUnregisterRepository( String name ) throws SystemFailureException {
        if (this.repositories.remove(name) == null) {
            throw new SystemFailureException(RepositoryI18n.unableToRemoveRepository.text(name));
        }
    }
View Full Code Here


     */
    @Override
    protected Repository findRegisteredRepository( String name ) throws SystemFailureException {
        Repository repository = this.repositories.get(name);
        if (repository == null) {
            throw new SystemFailureException(RepositoryI18n.unableToFindRepositoryWithName.text(name));
        }
        return repository;
    }
View Full Code Here

                    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

                    // 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

                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

                output.write(buffer, 0, numRead);
            }
            output.close();
        } catch (IOException e) {
            error = true;
            throw new SystemFailureException(e); // error using reading from byte array!
        } finally {
            try {
                input.close();
            } catch (IOException e) {
                if (!error) new SystemFailureException(e); // error closing input stream
            }
        }

        // Return value according to relevant encoding.
        try {
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

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.