Package org.apache.isis.core.commons.exceptions

Examples of org.apache.isis.core.commons.exceptions.IsisApplicationException


        final Throwable targetException = e.getTargetException();
        if (targetException instanceof RecoverableException) {
            // an application exception from the domain code is re-thrown as an
            // IsisException with same semantics
            // TODO: should probably be using ApplicationException here
            throw new IsisApplicationException(targetException);
        }
        if (targetException instanceof RuntimeException) {
            throw (RuntimeException) targetException;
        } else {
            throw new MetaModelException(targetException);
View Full Code Here


        return new SubscriberExceptionHandler(){
            @Override
            public void handleException(Throwable exception, SubscriberExceptionContext context) {
                if(exception instanceof RecoverableException ||
                   exception instanceof NonRecoverableException) {
                    getTransactionManager().getTransaction().setAbortCause(new IsisApplicationException(exception));
                } else {
                    // simply ignore
                }
            }
        };
View Full Code Here

    public static void throwWithinIsisException(final InvocationTargetException e, final String error) {
        final Throwable targetException = e.getTargetException();
        if (targetException instanceof RecoverableException) {
            // an application exception from the domain code is re-thrown as an
            // IsisException with same semantics
            throw new IsisApplicationException(targetException);
        }
        if (targetException instanceof RuntimeException) {
            throw (RuntimeException) targetException;
        } else {
            throw new MetaModelException(targetException);
View Full Code Here

        return new SubscriberExceptionHandler(){
            @Override
            public void handleException(Throwable exception, SubscriberExceptionContext context) {
                if(exception instanceof RecoverableException ||
                   exception instanceof NonRecoverableException) {
                    getTransactionManager().getTransaction().setAbortCause(new IsisApplicationException(exception));
                } else {
                    // simply ignore
                }
            }
        };
View Full Code Here

            return new LocalDate(millisSinceEpoch);
        } else if (o instanceof Date) {
            final Date asDate = (Date) value.getObject();
            return new LocalDate(asDate.getMillisSinceEpoch());
        } else {
            throw new IsisApplicationException("Unimplemented JdbcDateMapper instance type: "
                + value.getClass().toString());
        }
    }
View Full Code Here

            } else if (checkIfIsClass(correspondingClass, Long.class, long.class)) {
                resultObject = results.getLong(columnName);
            } else if (checkIfIsClass(correspondingClass, Boolean.class, boolean.class)) {
                resultObject = results.getBoolean(columnName);
            } else {
                throw new IsisApplicationException("Unhandled type: " + correspondingClass.getCanonicalName());
            }
        }

        restoredValue = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(resultObject);
View Full Code Here

    public static void invocationException(final String error, final InvocationTargetException e) {
        final Throwable targetException = e.getTargetException();
        if (targetException instanceof ApplicationException) {
            // an application exception from the domain code is re-thrown as an
            // IsisException with same semantics
            throw new IsisApplicationException(targetException);
        }
        if (targetException instanceof RuntimeException) {
            throw (RuntimeException) targetException;
        } else {
            throw new MetaModelException(targetException);
View Full Code Here

            return new LocalDate(millisSinceEpoch);
        } else if (o instanceof Date) {
            final Date asDate = (Date) value.getObject();
            return new LocalDate(asDate.getMillisSinceEpoch());
        } else {
            throw new IsisApplicationException("Unimplemented JdbcDateMapper instance type: " + value.getClass().toString());
        }
    }
View Full Code Here

            } else if (checkIfIsClass(correspondingClass, Long.class, long.class)) {
                resultObject = results.getLong(columnName);
            } else if (checkIfIsClass(correspondingClass, Boolean.class, boolean.class)) {
                resultObject = results.getBoolean(columnName);
            } else {
                throw new IsisApplicationException("Unhandled type: " + correspondingClass.getCanonicalName());
            }
        }

        restoredValue = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(resultObject);
View Full Code Here

    public static void invocationException(final String error, final InvocationTargetException e) {
        final Throwable targetException = e.getTargetException();
        if (targetException instanceof ApplicationException) {
            // an application exception from the domain code is re-thrown as an
            // IsisException with same semantics
            throw new IsisApplicationException(targetException);
        }
        if (targetException instanceof RuntimeException) {
            throw (RuntimeException) targetException;
        } else {
            throw new MetaModelException(targetException);
View Full Code Here

TOP

Related Classes of org.apache.isis.core.commons.exceptions.IsisApplicationException

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.