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

Examples of org.apache.isis.core.metamodel.adapter.ResolveState


    public void captureTitleHintIfPossible(final ObjectAdapter adapter) {
        if (adapter == null) {
            return;
        }
        final ResolveState resolveState = adapter.getResolveState();
        if (resolveState.isValue() || resolveState.isResolved()) {
            this.titleHint = adapter.titleString();
        }
    }
View Full Code Here


            final StateReader reader,
            final KeyCreator keyCreator,
            final VersionCreator versionCreator,
            final Map<String, DataEncryption> dataEncrypters,
            final ObjectAdapter object) {
    final ResolveState resolveState = ResolveState.RESOLVING;
        object.changeState(resolveState);
        Version version = null;
        final String versionString = reader.readVersion();
        if (!versionString.equals("")) {
            final String user = reader.readUser();
            final String time = reader.readTime();
            version = versionCreator.version(versionString, user, time);
        }
        String encryptionType = reader.readEncrytionType();
        readFields(reader, object, keyCreator, dataEncrypters.get(encryptionType));
        object.setOptimisticLock(version);
        object.changeState(resolveState.getEndState());
    }
View Full Code Here

            final DataEncryption dataEncrypter) {
        final String objectType = aggregateReader.readObjectType();
        final ObjectSpecification specification = IsisContext.getSpecificationLoader().loadSpecification(objectType);
        final ObjectAdapter fieldObject = getAdapter(specification, oid);
        if (fieldObject.getResolveState().isGhost()) {
            final ResolveState resolveState = ResolveState.RESOLVING;
            fieldObject.changeState(resolveState);
            readFields(aggregateReader, fieldObject, keyCreator, dataEncrypter);
            fieldObject.changeState(resolveState.getEndState());
        }
        return fieldObject;
    }
View Full Code Here

        if (state == null) {
            return null;
        }
        final ObjectSpecification spec = getSpecificationLoader().loadSpecification(state.getClassName());
        ObjectAdapter object;
        ResolveState targetState;
        if (getOid().isTransient()) {
            object = getHydrator().recreateAdapter(getOid(), spec);
            targetState = ResolveState.SERIALIZING_TRANSIENT;
        } else {
            object = getHydrator().recreateAdapter(getOid(), spec);
View Full Code Here

            }
            ObjectAdapter ref;
            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);
                }
View Full Code Here

        // synchronize on the current session because getting race
        // conditions, I think between different UI threads when running
        // with DnD viewer + in-memory object store +
        // cglib bytecode enhancement
        synchronized (getAuthenticationSession()) {
            final ResolveState resolveState = adapter.getResolveState();
            if (!resolveState.canChangeTo(ResolveState.RESOLVING)) {
                return;
            }
            Assert.assertFalse("only resolve object that is not yet resolved", adapter, resolveState.isResolved());
            Assert.assertTrue("only resolve object that is persistent", adapter, adapter.isPersistent());
            resolveImmediatelyFromPersistenceLayer(adapter);
            if (LOG.isDebugEnabled()) {
                // don't log object - its toString() may use the unresolved field, or unresolved collection
                LOG.debug("resolved: " + adapter.getSpecification().getShortIdentifier() + " " + resolveState.code()
                    + " " + adapter.getOid());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.adapter.ResolveState

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.