Package org.apache.isis.core.metamodel.adapter

Examples of org.apache.isis.core.metamodel.adapter.ObjectAdapter.changeState()


                for (final PersistenceCommand command : commandsPrior) {
                    if (command instanceof DestroyObjectCommand) {
                        final ObjectAdapter adapter = command.onAdapter();
                        adapter.setVersion(null);
                        if(!adapter.isDestroyed()) {
                            adapter.changeState(ResolveState.DESTROYED);
                        }
                    }
                }
                commands.removeAll(commandsPrior);
            } catch(final RuntimeException ex) {
View Full Code Here


    }

    private ObjectAdapter restoreAggregatedObject(final StateReader aggregateReader, final AggregatedOid aggregatedOid, final DataEncryption dataEncrypter) {
        final ObjectAdapter fieldObject = getAdapter(aggregatedOid);
        final ResolveState resolveState = ResolveState.RESOLVING;
        fieldObject.changeState(resolveState);
        readFields(aggregateReader, fieldObject, dataEncrypter);
        fieldObject.changeState(resolveState.getEndState());

        return fieldObject;
    }
View Full Code Here

    private ObjectAdapter restoreAggregatedObject(final StateReader aggregateReader, final AggregatedOid aggregatedOid, final DataEncryption dataEncrypter) {
        final ObjectAdapter fieldObject = getAdapter(aggregatedOid);
        final ResolveState resolveState = ResolveState.RESOLVING;
        fieldObject.changeState(resolveState);
        readFields(aggregateReader, fieldObject, dataEncrypter);
        fieldObject.changeState(resolveState.getEndState());

        return fieldObject;
    }

    private void readValue(final StateReader reader, final DataEncryption dataEncrypter, final OneToOneAssociation association, final ObjectAdapter object) {
View Full Code Here

        }

        @Override
        public void execute(final Workspace workspace, final View view, final Location at) {
            final ObjectAdapter object = view.getContent().getAdapter();
            object.changeState(ResolveState.GHOST);
        }
    }

    // REVIEW: should provide this rendering context, rather than hardcoding.
    // the net effect currently is that class members annotated with
View Full Code Here

                return ConsentAbstract.allowIf(collection == null || !(collection.isTransient()) || collection.isGhost());
            }

            @Override
            public void execute(final Workspace workspace, final View view, final Location at) {
                collection.changeState(ResolveState.GHOST);
            }
        });

    }
View Full Code Here

                    PersistorUtil.startResolving(originalAdapter);
                    PersistorUtil.toEndState(originalAdapter);
                }
                originalAdapter.setVersion(datastoreVersion);
                if(pojo.jdoIsDeleted()) {
                    originalAdapter.changeState(ResolveState.DESTROYED);
                }

                ensureFrameworksInAgreement(pojo);
            }
        }, calledFrom);
View Full Code Here

        withLogging(pojo, new Runnable() {
            @Override
            public void run() {
                ObjectAdapter adapter = getAdapterManager().getAdapterFor(pojo);
                if(!adapter.isDestroyed()) {
                    adapter.changeState(ResolveState.DESTROYED);
                }
               
                ensureFrameworksInAgreement(pojo);
            }
        }, calledFrom);
View Full Code Here

            if (adapter.getOid().isTransient()) {
                adapterManager.remapAsPersistent(adapter);
            }

            if (adapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
                adapter.changeState(ResolveState.RESOLVING);
                adapter.changeState(ResolveState.RESOLVED);
            }
            if (existingOid == null) {
                final Oid persistentOid = adapter.getOid();
                registerService(serviceId, persistentOid);
View Full Code Here

                adapterManager.remapAsPersistent(adapter);
            }

            if (adapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
                adapter.changeState(ResolveState.RESOLVING);
                adapter.changeState(ResolveState.RESOLVED);
            }
            if (existingOid == null) {
                final Oid persistentOid = adapter.getOid();
                registerService(serviceId, persistentOid);
            }
View Full Code Here

            LOG.debug("creating aggregated instance of " + specification);
        }
        final Object pojo = specification.createAggregatedObject(parent, CreationMode.INITIALIZE);
        final ObjectAdapter adapter = getAdapterManager().adapterFor(pojo);
        if (adapter.getResolveState().isGhost()) {
            adapter.changeState(ResolveState.RESOLVING);
        }
        if (adapter.getResolveState().isValidToChangeTo(ResolveState.RESOLVED)) {
            adapter.changeState(ResolveState.RESOLVED);
        }
        return adapter;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.