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

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


     * @see #createCollectionAdapterAndInferResolveState(Object, CollectionOid)
     */
    private ObjectAdapter createRootAdapterAndInferResolveState(final Object pojo, RootOid rootOid) {
        Ensure.ensureThatArg(rootOid, is(not(nullValue())));
        final ObjectAdapter rootAdapter = getObjectAdapterFactory().createAdapter(pojo, rootOid, this);
        rootAdapter.changeState(rootOid.isTransient() ? ResolveState.TRANSIENT : ResolveState.GHOST);
        doPostCreateRootAdapter(rootAdapter);
        return rootAdapter;
    }

    /**
 
View Full Code Here


    }

    private ObjectAdapter createCollectionAdapterAndInferResolveState(final Object pojo, CollectionOid collectionOid) {
        Ensure.ensureThatArg(collectionOid, is(not(nullValue())));
        final ObjectAdapter collectionAdapter = getObjectAdapterFactory().createAdapter(pojo, collectionOid, this);
        collectionAdapter.changeState(collectionOid.isTransient() ? ResolveState.TRANSIENT : ResolveState.GHOST);
        return collectionAdapter;
    }

    private ObjectAdapter createAggregatedAdapter(final Object pojo, AggregatedOid aggregatedOid) {
        Ensure.ensureThatArg(aggregatedOid, is(not(nullValue())));
View Full Code Here

                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

                    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

            for (final PersistenceCommand command : commands) {
                if (command instanceof DestroyObjectCommand) {
                    final ObjectAdapter adapter = command.onObject();
                    adapter.setOptimisticLock(null);
                    adapter.changeState(ResolveState.DESTROYED);
                }
            }
            commands.clear();
        }
    }
View Full Code Here

            ref = getHydrator().recreateAdapter(oid, spec);
            if (data instanceof ObjectData) {
                if (oid.isTransient() || spec.isAggregated()) {
                    final ResolveState resolveState = spec.isAggregated() ? ResolveState.GHOST : ResolveState.TRANSIENT;
                    if (ref.getResolveState().isValidToChangeTo(resolveState)) {
                        ref.changeState(resolveState);
                    }
                    updateObject(ref, data, resolveState);
                }
            }
            return ref;
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.