Package com.philip.journal.core.exception

Examples of com.philip.journal.core.exception.JournalException


                throw (Exception) ite.getTargetException();
            } catch (final ClassCastException cce) {
                throw (RuntimeException) ite.getTargetException();
            }
        } catch (final Exception e) { // NOPMD by r39 on 4/5/11 9:10 AM
            throw new JournalException("Proxy method call exception", e);
        }
    }
View Full Code Here


            throw new IllegalArgumentException(Error.IAE_INVALID_PROP + " "
                    + property); // NOPMD by r39
        } catch (final InvocationTargetException e) {
            throw new RuntimeException(e.getCause()); // NOPMD by r39
        } catch (final Exception e) {
            throw new JournalException(Error.GEN_ERROR, e); // NOPMD by r39
        }
    }
View Full Code Here

        final String callingClass = Thread.currentThread().getStackTrace()[IDX_HBN_CALL].getClassName();
        if (callingClass.indexOf("org.hibernate.property.BasicPropertyAccessor$BasicSetter") > -1
                || callingClass.indexOf("org.hibernate.tuple.entity.AbstractEntityTuplizer") > -1) {
            this.username = pusername;
        } else {
            throw new JournalException("Illegal access to protected object", null);
        }
    }
View Full Code Here

        param.put("username", username);
        User user = null;
        try {
            user = readObject(param);
        } catch (final Exception e) {
            throw new JournalException(e.getMessage(), e);
        }
        return user;
    }
View Full Code Here

            final String pkeyField = (String) klass.getMethod(
                    "getPrimaryKeyField", new Class[0]).invoke(object,
                    new Object[0]);
            return readObject(pkeyField, entityId);
        } catch (final Exception e) {
            throw new JournalException(
                    "This is not supported for this type of target.  Use readByProperty.",
                    e);
        }
    }
View Full Code Here

                BeanUtils.setProperty(object,
                        AbstractAuditableBean.UPDATE_DATE, now);
                BeanUtils.setProperty(object,
                        AbstractAuditableBean.UPDATE_TIME, now);
            } catch (final Exception e) {
                throw new JournalException("System Error", e);
            }
        }
        super.save(object);
    }
View Full Code Here

    protected Object proxyMehodCall(final Class<?>[] paramType, final Object[] args)
    {
        try {
            return super.proxyMehodCall(paramType, args);
        } catch (final DataIntegrityViolationException div) {
            throw new JournalException(div.getCause().getCause().getMessage(), div);
        } catch (final Exception e) {
            throw new JournalException(e.getMessage(), e);
        }
    }
View Full Code Here

    @Override
    public void delete(final long entryId)
    {
        final Entry entry = super.readObject(Entry.ID, entryId);
        if (entry == null) {
            throw new JournalException("Delete failed for entryId [" + entryId + "]", "The object with the entryId ["
                    + entryId + "] was not found in the datastore.", "Cannot find [" + entryId + "]");
        }
        super.delete(entry);
    }
View Full Code Here

                final Element branchElement = (Element) nodes.item(i);
                getXmlHelper().extractBranchFromDocument(branchElement, ROOT_ID);
            }

        } catch (final Exception exception) {
            throw new JournalException(exception.getMessage(), exception);
        }
    }
View Full Code Here

        final DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder;
        try {
            docBuilder = dbfac.newDocumentBuilder();
        } catch (final ParserConfigurationException e) {
            throw new JournalException(e.getMessage(), e);
        }
        final Document doc = docBuilder.newDocument();

        final Branch rootBranch = getDaoFacade().getBranchDAO().read(ROOT_ID);
        final Element rootElement = doc.createElement(TAG_JOURNAL);
        doc.appendChild(rootElement);
        getXmlHelper().convertNodeToXml(doc, rootElement, rootBranch);

        try {
            synchronized (lock) {
                final TransformerFactory locTransFactory = getTransformFactory();
                locTransFactory.setAttribute(INDENT_NO, INDENT_SIZE);
                final Transformer trans = locTransFactory.newTransformer();
                trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, NO);
                trans.setOutputProperty(OutputKeys.INDENT, YES);
                trans.transform(new DOMSource(doc), new StreamResult(new OutputStreamWriter(targetStream, "UTF-8")));
            }
        } catch (final TransformerException e) {
            throw new JournalException(e.getMessage(), e);
        } catch (final UnsupportedEncodingException e) {
            throw new JournalException(e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of com.philip.journal.core.exception.JournalException

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.