Examples of SystemFailureException


Examples of org.modeshape.common.SystemFailureException

     * @see #getInitialContext(Hashtable)
     * @see #getInstance(Hashtable)
     */
    public static synchronized Context getInstance() {
        if (SINGLETON == null) {
            throw new SystemFailureException();
        }
        return SINGLETON;
    }
View Full Code Here

Examples of org.modeshape.common.SystemFailureException

    public static BinaryKey keyFor( byte[] content ) {
        try {
            byte[] hash = SecureHash.getHash(ALGORITHM, content);
            return new BinaryKey(hash);
        } catch (NoSuchAlgorithmException e) {
            throw new SystemFailureException(e);
        }
    }
View Full Code Here

Examples of org.modeshape.common.SystemFailureException

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

Examples of org.modeshape.common.SystemFailureException

    public static BinaryKey keyFor( byte[] sha1 ) {
        try {
            byte[] hash = SecureHash.getHash(Algorithm.SHA_1, sha1);
            return new BinaryKey(hash);
        } catch (NoSuchAlgorithmException e) {
            throw new SystemFailureException(e);
        }
    }
View Full Code Here

Examples of org.modeshape.common.SystemFailureException

                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

Examples of org.modeshape.common.SystemFailureException

            }
            return value;
        } catch (IOException e) {
            throw new BinaryStoreException(e);
        } catch (NoSuchAlgorithmException e) {
            throw new SystemFailureException(e);
        } finally {
            if (tmpFile != null) {
                try {
                    tmpFile.delete();
                } catch (Throwable t) {
View Full Code Here

Examples of org.modeshape.common.SystemFailureException

     * @return the new directory; never null
     */
    private static File newTempDirectory() {
        String tempDirName = System.getProperty(JAVA_IO_TMPDIR);
        if (tempDirName == null) {
            throw new SystemFailureException(JcrI18n.tempDirectorySystemPropertyMustBeSet.text(JAVA_IO_TMPDIR));
        }
        File tempDir = new File(tempDirName);

        // Create a temporary directory in the "java.io.tmpdir" directory ...
        return new File(tempDir, "modeshape-binary-store");
View Full Code Here

Examples of org.modeshape.common.SystemFailureException

                lock.unlock();
            }
        } catch (IOException e) {
            throw new BinaryStoreException(e);
        } catch (NoSuchAlgorithmException e) {
            throw new SystemFailureException(e);
        } finally {
            try {
                IoUtil.closeQuietly(inputStream);
            } finally {
                if (tmpFile != null) tmpFile.delete();
View Full Code Here

Examples of org.modeshape.common.SystemFailureException

                Snapshot updated = current.withoutConnectors(connectorsWithErrors);
                this.snapshot.compareAndSet(current, updated);
                // None of the removed connectors were running, so there's no need to remote unused ones from 'updated'
            }
        } catch (RepositoryException e) {
            throw new SystemFailureException(e);
        } finally {
            if (session != null) {
                session.logout();
            }
        }
View Full Code Here

Examples of org.modeshape.common.SystemFailureException

            Message jgMessage = new Message(null, null, messageData);
            channel.send(jgMessage);
            return true;
        } catch (Exception e) {
            // Something went wrong here
            throw new SystemFailureException(ClusteringI18n.errorSendingMessage.text(clusterName()), e);
        }
    }
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.