Package org.apache.isis.applib

Examples of org.apache.isis.applib.ApplicationException


                        getJdoPersistenceManager().deletePersistentAll(instances);
                        return null;
                    }
                });
            } catch (Exception e) {
                throw new ApplicationException(e);
            }
        }
    }
View Full Code Here


           
            final byte[] utf8Bytes = toZip.getBytes(Charset.forName("UTF-8"));
            zos.write(utf8Bytes);
            zos.flush();
        } catch (IOException e) {
            throw new ApplicationException(e);
        } finally {
            closeSafely(zos);
        }
        return baos.toByteArray();
    }
View Full Code Here

                final byte[] utf8Bytes = IoUtils.readBytes(zis);
                return new String(utf8Bytes, Charset.forName("UTF-8"));
            }
            return null;
        } catch(IOException ex) {
            throw new ApplicationException(ex);
        } finally {
            IoUtils.closeSafely(zis);
        }
    }
View Full Code Here

                getMessageBroker().addWarning(message);
            }

            @Override
            public void raiseError(final String message) {
                throw new ApplicationException(message);
            }

            @Override
            public String getProperty(final String name) {
                return RuntimeContextFromSession.this.getProperty(name);
View Full Code Here

        return new DateTime(getTime(), Defaults.getTimeZone());
    }

    private static void ensureReplaceable() {
        if (!isReplaceable && instance != null) {
            throw new ApplicationException("Clock already set up");
        }
    }
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

        }
        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

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.