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

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


        if (fieldData == null) {
            final ObjectAdapter adapter =
                getPersistenceSession().recreateAdapter(referenceOid, field.getSpecification());
            if (!adapter.getResolveState().isDestroyed()) {
                adapter.changeState(ResolveState.DESTROYED);
            }
            ((OneToOneAssociation) field).initAssociation(object, adapter);

            LOG.warn("No data found for " + referenceOid + " so field '" + field.getName() + "' not set in object '"
                + object.titleString() + "'");
View Full Code Here


                LOG.debug("clearing collection as versions differ: " + adapter.getVersion() + " "
                    + parentData.getVersion());
            }
            final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
            facet.init(collection, new ObjectAdapter[0]);
            collection.changeState(ResolveState.GHOST);
        }
    }

    private void setUpCollectionFieldForEntireContents(final ObjectAdapter adapter, final ObjectAssociation field,
        final CollectionData collectionContentData, final KnownObjectsRequest knownObjects) {
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

        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;
    }

    @Override
View Full Code Here

    }

    private ObjectAdapter recreateAdapterForExistingService(final Oid oid, final Object service) {
        final ObjectAdapter adapter = getAdapterManager().recreateRootAdapter(oid, service);
        if (adapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
            adapter.changeState(ResolveState.RESOLVING);
            adapter.changeState(ResolveState.RESOLVED);
        }
        return adapter;
    }
View Full Code Here

    private ObjectAdapter recreateAdapterForExistingService(final Oid oid, final Object service) {
        final ObjectAdapter adapter = getAdapterManager().recreateRootAdapter(oid, service);
        if (adapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
            adapter.changeState(ResolveState.RESOLVING);
            adapter.changeState(ResolveState.RESOLVED);
        }
        return adapter;
    }

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

    }

    private ObjectAdapter createOrRecreateAdapter(final Object pojo, final Oid oid) {
        final ObjectAdapter adapter = getAdapterFactory().createAdapter(pojo, oid);
        if (oid == null) {
            adapter.changeState(ResolveState.VALUE);
        } else {
            adapter.changeState(oid.isTransient() ? ResolveState.TRANSIENT : ResolveState.GHOST);
        }
        return adapter;
    }
View Full Code Here

    private ObjectAdapter createOrRecreateAdapter(final Object pojo, final Oid oid) {
        final ObjectAdapter adapter = getAdapterFactory().createAdapter(pojo, oid);
        if (oid == null) {
            adapter.changeState(ResolveState.VALUE);
        } else {
            adapter.changeState(oid.isTransient() ? ResolveState.TRANSIENT : ResolveState.GHOST);
        }
        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.