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

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


     * Adds additional property.
     */
    @Override
    public synchronized void add(final String key, final String value) {
        if (locked) {
            throw new IsisException("Configuration has been locked and cannot be changed");
        }
        configuration.add(key, value);
    }
View Full Code Here


            configuration.add(propertiesReader.getProperties());
            configurationResourcesFound.add(configurationResource);
            return;
        } catch (final IOException ignore) { }
        if (notFoundPolicy == NotFoundPolicy.FAIL_FAST) {
            throw new IsisException("failed to load '" + configurationResource + "'; tried using: " + resourceStreamSource.getName());
        } else {
            configurationResourcesNotFound.add(configurationResource);
            LOG.debug("'" + configurationResource + "' not found, but not needed");
        }
    }
View Full Code Here

            this.rootPlace = appendXml(rootAdapter);

        } catch (final ParserConfigurationException e) {
            LOG.error("unable to build snapshot", e);
            throw new IsisException(e);
        }

        for (final String path : getPathsFor(rootAdapter.getObject())) {
            include(path);
        }
View Full Code Here

            transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
            transformer.transform(domSource, result);
           
            return writer.toString();
        } catch (TransformerConfigurationException e) {
            throw new IsisException(e);
        } catch (TransformerException e) {
            throw new IsisException(e);
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    public <T extends ViewModel> T newViewModelInstance(Class<T> ofClass, String memento) {
        final ObjectSpecification spec = getSpecificationLookup().loadSpecification(ofClass);
        if (!spec.containsFacet(ViewModelFacet.class)) {
            throw new IsisException("Type must be a ViewModel: " + ofClass);
        }
        final ObjectAdapter adapter = doCreateViewModelInstance(spec, memento);
        if(adapter.getOid().isViewModel()) {
            return (T)adapter.getObject();
        } else {
            throw new IsisException("Object instantiated but was not given a ViewModel Oid; please report as a possible defect in Isis: " + ofClass);
        }
    }
View Full Code Here

    @Override
    @SuppressWarnings("unchecked")
    public <T> T newAggregatedInstance(final Object parent, final Class<T> ofClass) {
        final ObjectSpecification spec = getSpecificationLookup().loadSpecification(ofClass);
        if (!spec.isParented()) {
            throw new IsisException("Type must be annotated as @Aggregated: " + ofClass);
        }
        final ObjectAdapter adapter = doCreateAggregatedInstance(spec, parent);
        if (adapter.getOid() instanceof AggregatedOid) {
            return (T) adapter.getObject();
        } else {
            throw new IsisException("Object instantiated but was not given a AggregatedOid (does the configured object store support aggregates?): " + ofClass);
        }
    }
View Full Code Here

            } catch (final NoSuchMethodException ex) {
                try {
                    constructor = extendee.getConstructor();
                    return constructor.newInstance();
                } catch (final NoSuchMethodException e) {
                    throw new IsisException(e);
                }
            }
        } catch (final SecurityException ex) {
            throw new IsisException(ex);
        } catch (final IllegalArgumentException e) {
            throw new IsisException(e);
        } catch (final InstantiationException e) {
            throw new IsisException(e);
        } catch (final IllegalAccessException e) {
            throw new IsisException(e);
        } catch (final InvocationTargetException e) {
            throw new IsisException(e);
        }
    }
View Full Code Here

            convertedArray = (Object[]) Array.newInstance(wrapperClass, len);
            for (int i = 0; i < len; i++) {
                convertedArray[i] = constructor.newInstance(new Object[] { Array.get(extendee, i).toString() });
            }
        } catch (final NoSuchMethodException e) {
            throw new IsisException(e);
        } catch (final ArrayIndexOutOfBoundsException e) {
            throw new IsisException(e);
        } catch (final IllegalArgumentException e) {
            throw new IsisException(e);
        } catch (final InstantiationException e) {
            throw new IsisException(e);
        } catch (final IllegalAccessException e) {
            throw new IsisException(e);
        } catch (final InvocationTargetException e) {
            throw new IsisException(e);
        }
        return convertedArray;
    }
View Full Code Here

    }

    private String getProperty(final String name, final String defaultValue) {
        final String key = referedToAs(name);
        if (key.indexOf("..") >= 0) {
            throw new IsisException("property names should not have '..' within them: " + name);
        }
        String property = properties.getProperty(key, defaultValue);
        property = property != null ? property.trim() : null;
        LOG.debug("get property: '" + key + "' =  '" + property + "'");
        return property;
View Full Code Here

        try {
            for (final ObjectSpecification noSpec : noSpecs) {
                getSpecificationTraverser().traverseReferencedClasses(noSpec, newlyDiscoveredClasses);
            }
        } catch (final ClassNotFoundException ex) {
            throw new IsisException(ex);
        }
        return newlyDiscoveredClasses;
    }
View Full Code Here

TOP

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

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.