Package org.modeshape.common

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


        } catch (InterruptedException e) {
            Thread.interrupted();
        }

        if (!deltaReconciliationCompleted()) {
            throw new SystemFailureException(JcrI18n.journalHasNotCompletedReconciliation.text(journalId(), clusterName(),
                                                                                               MAX_MINUTES_TO_WAIT_FOR_RECONCILIATION));
        }
    }
View Full Code Here

        protected String name() {
            try {
                Path path = node().path();
                return path.isRoot() ? "" : stringFor(path.getLastSegment());
            } catch (Exception e) {
                throw new SystemFailureException(e);
            }
        }
View Full Code Here

                return node().getPath();
            } catch (Throwable e) {
                try {
                    return node().toString();
                } catch (SAXException e2) {
                    throw new SystemFailureException(e2);
                }
            }
        }
View Full Code Here

            }

            return defn;
        } catch (ConstraintViolationException e) {
            // this is never expected
            throw new SystemFailureException(e);
        }
    }
View Full Code Here

                    }
                }
            }
            this.initialized = true;
        } catch (RepositoryException e) {
            throw new SystemFailureException(e);
        } finally {
            if (session != null) {
                session.logout();
            }
        }
View Full Code Here

    }

    private static void initializeI18nField( Field fld ) throws IllegalAccessException {
        // Ensure field is public
        if ((fld.getModifiers() & Modifier.PUBLIC) != Modifier.PUBLIC) {
            throw new SystemFailureException(CommonI18n.i18nFieldNotPublic.text(fld.getName(), fld.getDeclaringClass()));
        }

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

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

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

            }
            // Get the URL to the localization properties file ...
            final String localizationBaseName = i18nClass.getName();
            URL bundleUrl = ClasspathLocalizationRepository.getLocalizationBundle(i18nClass.getClassLoader(), localizationBaseName, locale);
            if (bundleUrl == null && i18nClass == CommonI18n.class) {
                throw new SystemFailureException("CommonI18n.properties file not found in classpath !");
            }
            if (bundleUrl == null) {
                LOGGER.warn(CommonI18n.i18nBundleNotFoundInClasspath,
                            ClasspathLocalizationRepository.getPathsToSearchForBundle(localizationBaseName, locale));
                // Nothing was found, so try the default locale
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

                                    Collection<String> unexportableNamespaces ) {
        try {
            this.writer = new OutputStreamWriter(os, DEFAULT_ENCODING);
        } catch (UnsupportedEncodingException e) {
            // This should never happen ...
            throw new SystemFailureException(e);
        }
        this.unexportableNamespaces = unexportableNamespaces;
        this.mappedPrefixes = new HashMap<String, String>();
        this.declaration = "version=\"1.0\" encoding=\"" + DEFAULT_ENCODING + "\"";
    }
View Full Code Here

TOP

Related Classes of org.modeshape.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.