Examples of SystemFailureException


Examples of org.jboss.dna.common.SystemFailureException

        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

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

Examples of org.jboss.dna.common.SystemFailureException

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

Examples of org.jboss.dna.common.SystemFailureException

        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

Examples of org.jboss.dna.common.SystemFailureException

            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

Examples of org.jboss.dna.common.SystemFailureException

            javax.naming.InitialContext context = new javax.naming.InitialContext();
            if (name1 != null) context.rebind(name1, obj1);
            if (name2 != null) context.rebind(name2, obj2);
            if (name3 != null) context.rebind(name3, obj3);
        } catch (NamingException e) {
            throw new SystemFailureException("Unable to create the mock InitialContext", e);
        }
    }
View Full Code Here

Examples of org.jboss.dna.common.SystemFailureException

        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

Examples of org.jboss.dna.common.SystemFailureException

    public byte[] computeHash( String value ) {
        try {
            return SecureHash.getHash(SecureHash.Algorithm.SHA_1, value.getBytes());
        } catch (NoSuchAlgorithmException e) {
            throw new SystemFailureException(e);
        }
    }
View Full Code Here

Examples of org.jboss.dna.common.SystemFailureException

            javax.naming.InitialContext context = new javax.naming.InitialContext();
            if (name1 != null) context.rebind(name1, obj1);
            if (name2 != null) context.rebind(name2, obj2);
            if (name3 != null) context.rebind(name3, obj3);
        } catch (NamingException e) {
            throw new SystemFailureException("Unable to create the mock InitialContext", e);
        }
    }
View Full Code Here

Examples of org.modeshape.common.SystemFailureException

                    case org.modeshape.jcr.api.PropertyType.SIMPLE_REFERENCE:
                        return this.getString().equals(that.getString());
                    case PropertyType.URI:
                        return this.getString().equals(that.getString());
                    default:
                        throw new SystemFailureException(JcrI18n.invalidPropertyType.text(this.type));
                }
            } catch (RepositoryException e) {
                return false;
            }
            // will not get here
        }
        if (obj instanceof Value) {
            Value that = (Value)obj;
            if (this.type != that.getType()) return false;
            try {
                switch (this.type) {
                    case PropertyType.STRING:
                        return this.getString().equals(that.getString());
                    case PropertyType.BINARY:
                        return IoUtil.isSame(this.getStream(), that.getBinary().getStream());
                    case PropertyType.BOOLEAN:
                        return this.getBoolean() == that.getBoolean();
                    case PropertyType.DOUBLE:
                        return this.getDouble() == that.getDouble();
                    case PropertyType.LONG:
                        return this.getLong() == that.getLong();
                    case PropertyType.DECIMAL:
                        return this.getDecimal().equals(that.getDecimal());
                    case PropertyType.DATE:
                        return this.getDate().equals(that.getDate());
                    case PropertyType.PATH:
                        return this.getString().equals(that.getString());
                    case PropertyType.NAME:
                        return this.getString().equals(that.getString());
                    case PropertyType.REFERENCE:
                    case PropertyType.WEAKREFERENCE:
                    case org.modeshape.jcr.api.PropertyType.SIMPLE_REFERENCE:
                        return this.getString().equals(that.getString());
                    case PropertyType.URI:
                        return this.getString().equals(that.getString());
                    default:
                        throw new SystemFailureException(JcrI18n.invalidPropertyType.text(this.type));
                }
            } catch (IOException e) {
                return false;
            } catch (RepositoryException e) {
                return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.