Package org.apache.isis.applib

Examples of org.apache.isis.applib.ApplicationException


        }
    }

    @Override
    protected String columnType() {
        throw new ApplicationException("Should never be called");
    }
View Full Code Here


        throw new ApplicationException("Should never be called");
    }

    @Override
    protected Object preparedStatementObject(final ObjectAdapter value) {
        throw new ApplicationException("Should never be called");
    }
View Full Code Here

                    ve.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
                }
                ve.init();
                context = new VelocityContext();
            } catch (Exception e) {
                throw new ApplicationException(e);
            }
        }
    }
View Full Code Here

        StringWriter writer = new StringWriter();
        try {
            Template t = ve.getTemplate(templatePath);
            t.merge(context, writer);
        } catch (Exception e) {
            throw new ApplicationException(e);
        }

        Email email = newTransientInstance(Email.class);
        email.setSubject(subject);
        email.setMessage(writer.toString());
View Full Code Here

        }
        try {
            final Class<?> authenticatorClass = Class.forName(className);
            return (Authenticator) authenticatorClass.getConstructor(IsisConfiguration.class).newInstance(configuration);
        } catch (final ClassNotFoundException e) {
            throw new ApplicationException("Unable to find authenticator class", e);
        } catch (final IllegalArgumentException e) {
            throw new ApplicationException("IllegalArgumentException creating authenticator class", e);
        } catch (final SecurityException e) {
            throw new ApplicationException("SecurityException creating authenticator class", e);
        } catch (final InstantiationException e) {
            throw new ApplicationException("InstantiationException creating authenticator class", e);
        } catch (final IllegalAccessException e) {
            throw new ApplicationException("IllegalAccessException creating authenticator class", e);
        } catch (final InvocationTargetException e) {
            throw new ApplicationException("InvocationTargetException creating authenticator class", e);
        } catch (final NoSuchMethodException e) {
            throw new ApplicationException("NoSuchMethodException creating authenticator class", e);
        }
    }
View Full Code Here

            final String url = params.getString(BASE + "connection");
            final String user = params.getString(BASE + "user");
            final String password = params.getString(BASE + "password");

            if (connection != null) {
                throw new ApplicationException("Connection already established");
            }

            if (driver == null) {
                throw new ApplicationException("No driver specified for database connection");
            }
            if (url == null) {
                throw new ApplicationException("No connection URL specified to database");
            }
            if (user == null) {
                throw new ApplicationException("No user specified for database connection");
            }
            if (password == null) {
                throw new ApplicationException("No password specified for database connection");
            }

            Class.forName(driver);
            LOG.info("Connecting to " + url + " as " + user);
            connection = DriverManager.getConnection(url, user, password);
            if (connection == null) {
                throw new ApplicationException("No connection established to " + url);
            }
        } catch (final SQLException e) {
            throw new ApplicationException("Failed to start", e);
        } catch (final ClassNotFoundException e) {
            throw new ApplicationException("Could not find database driver", e);
        }

    }
View Full Code Here

                    return postProcessLogin(user, password, results);
                }
            }
        } catch (final SQLException e) {
            LOG.error("Error loading user details: " + sql);
            throw new ApplicationException("Error loading user details", e);
        }

        return null;
    }
View Full Code Here

            final int updateCount = statement.executeUpdate();
            statement.close();
            return updateCount;
        } catch (final SQLException e) {
            LOG.error("failed to execute " + sql, e);
            throw new ApplicationException("Error executing update", e);
        } finally {
            clearPreparedValues();
        }

    }
View Full Code Here

            statement = connection.prepareStatement(sql);
            addPreparedValues(statement);
            return (statement.executeQuery());
        } catch (final SQLException e) {
            LOG.error("failed to execte select: " + sql, e);
            throw new ApplicationException("Error executing select", e);
        } finally {
            clearPreparedValues();
        }
    }
View Full Code Here

                set.close();
                return false;
            }
        } catch (final SQLException e) {
            LOG.error("failed to find table: " + tableName, e);
            throw new ApplicationException("Error checking for table: " + tableName, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.applib.ApplicationException

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.