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

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


        final List<Object> singletonServices = Lists.newArrayList(Iterables.filter(
                        getServices(),
                        Predicates.not(RequestScopedService.Predicates.instanceOf())));
        if (singletonServices.size() == 0 && mode == Mode.STRICT) {
            throw new IsisException("No known (singleton) services");
        }
        for (final Object service : singletonServices) {
            profile.getPerspective().addToServices(service);
        }
        LOG.debug("creating exploration UserProfile for " + userName);
View Full Code Here


                    ActionInvocationMemento aim = backgroundService.asActionInvocationMemento(method, targetObject, args);

                    if(aim != null) {
                        command.setMemento(aim.asMementoString());
                    } else {
                        throw new IsisException(
                            "Unable to build memento for action " +
                            owningAction.getIdentifier().toClassAndNameIdentityString());
                    }
                }

                // copy over the command execution 'context' (if available)
                final CommandFacet commandFacet = getFacetHolder().getFacet(CommandFacet.class);
                if(commandFacet != null && !commandFacet.isDisabled()) {
                    command.setExecuteIn(commandFacet.executeIn());
                    command.setPersistence(commandFacet.persistence());
                } else {
                    // if no facet, assume do want to execute right now, but only persist (eventually) if hinted.
                    command.setExecuteIn(ExecuteIn.FOREGROUND);
                    command.setPersistence(Persistence.IF_HINTED);
                }
            }
           
           
            if( command != null &&
                command.getExecutor() == Executor.USER &&
                command.getExecuteIn() == ExecuteIn.BACKGROUND) {
               
                // persist command so can be this command can be in the 'background'
                final CommandService commandService = getServicesInjector().lookupService(CommandService.class);
                if(commandService.persistIfPossible(command)) {
                    // force persistence, then return the command itself.
                    final ObjectAdapter resultAdapter = getAdapterManager().adapterFor(command);
                    return InvocationResult.forActionThatReturned(resultAdapter);
                } else {
                    throw new IsisException(
                            "Unable to schedule action '"
                            + owningAction.getIdentifier().toClassAndNameIdentityString() + "' to run in background: "
                            + "CommandService does not support persistent commands " );
                }
            } else {
View Full Code Here

        }
       
        try {
            return getObjectInstantiator().instantiate(getCorrespondingClass());
        } catch (final ObjectInstantiationException e) {
            throw new IsisException("Failed to create instance of type " + getFullIdentifier(), e);
        }
    }
View Full Code Here

                return array;
            }
            // TODO what happens if the grab fails?
            return new int[lines][width];
        } catch (final InterruptedException e) {
            throw new IsisException(e);
        }
    }
View Full Code Here

        try {
            final File file = file(true);
            out = new FileWriter(file);
            persistor.save(objects, out);
        } catch (final IOException e) {
            throw new IsisException(e);
        } finally {
            if (out != null) {
                try {
                    out.close();
                } catch (final IOException e) {
                    throw new IsisException(e);
                }
            }
        }
    }
View Full Code Here

            reader = new FileReader(file);
            objects = persistor.loadData(reader);
        } catch (final FileNotFoundException e) {
            return;
        } catch (final IOException e) {
            throw new IsisException(e);
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (final IOException e) {
                    throw new IsisException(e);
                }
            }
        }
    }
View Full Code Here

                } catch (final InstanceCreationException e) {
                    throw e;
                }
            }
        } catch (final IOException e) {
            throw new IsisException(e);
        } finally {
            close(reader);
        }

        final List<ComponentDetails> installerVersionList = new ArrayList<ComponentDetails>();
View Full Code Here

    @Override
    public IsisViewerInstaller viewerInstaller(final String name) {
        final IsisViewerInstaller installer = getInstaller(IsisViewerInstaller.class, name);
        if (installer == null) {
            throw new IsisException("No viewer installer of type " + name);
        }
        return installer;
    }
View Full Code Here

        final Object oid = adapter.getOid();
        if (oid != null && !oid.equals(data.getOid())) {
            throw new IllegalArgumentException("This memento can only be used to update the ObjectAdapter with the Oid " + data.getOid() + " but is " + oid);
        }
        if (!(data instanceof ObjectData)) {
            throw new IsisException("Expected an ObjectData but got " + data.getClass());
        }
       
        updateFieldsAndResolveState(adapter, data);
       
        if (LOG.isDebugEnabled()) {
View Full Code Here

            updateFields(objectAdapter, data);
           
        } else {
            final ObjectData od = (ObjectData) data;
            if (od.containsField()) {
                throw new IsisException("Resolve state (for " + objectAdapter + ") inconsistent with fact that data exists for fields");
            }
        }
    }
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.