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

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


        final Object pojo = objectSpec.createObject();
        final ObjectAdapter adapter = getAdapterManager().adapterFor(pojo, parentAdapter);
        // returned adapter's ResolveState will either be TRANSIENT or GHOST
        objectSpec.initialize(adapter);
        if (adapter.isGhost()) {
            adapter.changeState(ResolveState.RESOLVING);
            adapter.changeState(ResolveState.RESOLVED);
        }
        return adapter;
    }
View Full Code Here


        final ObjectAdapter adapter = getAdapterManager().adapterFor(pojo, parentAdapter);
        // returned adapter's ResolveState will either be TRANSIENT or GHOST
        objectSpec.initialize(adapter);
        if (adapter.isGhost()) {
            adapter.changeState(ResolveState.RESOLVING);
            adapter.changeState(ResolveState.RESOLVED);
        }
        return adapter;
    }

    // ///////////////////////////////////////////////////////////////////////////
View Full Code Here

     * {@link #getAdapterFor(Object) mapped}, and for immutable value types
     * referenced.
     */
    private ObjectAdapter createStandaloneAdapterAndSetResolveState(final Object pojo) {
        final ObjectAdapter adapter = getObjectAdapterFactory().createAdapter(pojo, null, this);
        adapter.changeState(ResolveState.VALUE);
        return adapter;
    }

    /**
     * Creates (but does not {@link #mapAndInjectServices(ObjectAdapter) map}) a new
View Full Code Here

     * @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

        final Data fieldData = dataManager.loadData(referencedOid);

        final ObjectAdapter referencedAdapter = getAdapterManager().adapterFor(referencedOid);
        if (fieldData == null) {
            if (!referencedAdapter.isDestroyed()) {
                referencedAdapter.changeState(ResolveState.DESTROYED);
            }
            LOG.warn("No data found for " + referencedOid + " so field '" + field.getName() + "' not set in object '" + object.titleString() + "'");
        }
        ((OneToOneAssociation) field).initAssociation(object, referencedAdapter);
View Full Code Here

        final Object pojo = objectSpec.createObject();
        final ObjectAdapter adapter = getAdapterManager().adapterFor(pojo, parentAdapter);
        // returned adapter's ResolveState will either be TRANSIENT or GHOST
        objectSpec.initialize(adapter);
        if (adapter.isGhost()) {
            adapter.changeState(ResolveState.RESOLVING);
            adapter.changeState(ResolveState.RESOLVED);
        }
        return adapter;
    }
View Full Code Here

        final ObjectAdapter adapter = getAdapterManager().adapterFor(pojo, parentAdapter);
        // returned adapter's ResolveState will either be TRANSIENT or GHOST
        objectSpec.initialize(adapter);
        if (adapter.isGhost()) {
            adapter.changeState(ResolveState.RESOLVING);
            adapter.changeState(ResolveState.RESOLVED);
        }
        return adapter;
    }

    // ///////////////////////////////////////////////////////////////////////////
View Full Code Here

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

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

                ObjectAdapter adapter = getAdapterManager().getAdapterFor(pojo);
                if(adapter == null) {
                    return;
                }
                if(!adapter.isDestroyed()) {
                    adapter.changeState(ResolveState.DESTROYED);
                }


                // previously we called the removed callback (if any).
                // however, this is almost certainly incorrect, because DN will not allow us
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.