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

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


    // ///////////////////////////////////////////////////////
    // Helpers: nextState
    // ///////////////////////////////////////////////////////

    private ResolveState nextState(final ResolveState initialState, final boolean complete) {
        ResolveState state = null;
        if (initialState == ResolveState.RESOLVED) {
            state = ResolveState.UPDATING;
        } else if (initialState == ResolveState.GHOST || initialState == ResolveState.PART_RESOLVED) {
            state = complete ? ResolveState.RESOLVING : ResolveState.RESOLVING_PART;
        } else if (initialState == ResolveState.TRANSIENT) {
View Full Code Here


    // resolveImmediately, resolveField
    // ////////////////////////////////////////////////////////////////

    @Override
    public synchronized void resolveImmediately(final ObjectAdapter adapter) {
        final ResolveState resolveState = adapter.getResolveState();
        if (!resolveState.canChangeTo(ResolveState.RESOLVING)) {
            return;
        }
        final Oid oid = adapter.getOid();
        if (LOG.isDebugEnabled()) {
            LOG.debug("resolve object (remotely from server)" + oid);
View Full Code Here

        final ObjectSpecification specification = getSpecificationLoader().loadSpecification(data.getType());

        final ObjectAdapter adapter = getHydrator().recreateAdapter(oid, specification);
        if (data.getFieldContent() != null) {
            adapter.setOptimisticLock(data.getVersion());
            ResolveState state;
            state = data.hasCompleteData() ? ResolveState.RESOLVING : ResolveState.RESOLVING_PART;
            if (LOG.isDebugEnabled()) {
                LOG.debug("restoring existing object (" + state.name() + ") " + adapter);
            }
            setupFields(adapter, data, state, knownObjects);
        }
        return adapter;
    }
View Full Code Here

    private void updateLoadedObject(final ObjectAdapter adapter, final ObjectData adapterData, final KnownObjectsRequest knownObjects) {
        // object known and we have all the latest data; update/resolve the
        // object
        if (adapterData.getFieldContent() != null) {
            adapter.setOptimisticLock(adapterData.getVersion());
            final ResolveState state = nextState(adapter.getResolveState(), adapterData.hasCompleteData());
            if (state != null) {
                LOG.debug("updating existing object (" + state.name() + ") " + adapter);
                setupFields(adapter, adapterData, state, knownObjects);
                getUpdateNotifier().addChangedObject(adapter);
            }
        } else {
            if (adapterData.getVersion() != null && adapterData.getVersion().different(adapter.getVersion())) {
View Full Code Here

    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

                return "Show this node in the right-hand pane";
            }
        });

        final ObjectAdapter object = getView().getContent().getAdapter();
        final ResolveState resolveState = (object).getResolveState();
        if (object instanceof ObjectAdapter && (resolveState.isGhost() || resolveState.isPartlyResolved())) {
            options.add(new UserActionAbstract("Load object") {
                @Override
                public void execute(final Workspace workspace, final View view, final Location at) {
                    resolveContent();
                }
View Full Code Here

    // resolveImmediately, resolveField
    // ////////////////////////////////////////////////////////////////

    @Override
    public synchronized void resolveImmediately(final ObjectAdapter adapter) {
        final ResolveState resolveState = adapter.getResolveState();
        if (!resolveState.canChangeTo(ResolveState.RESOLVING)) {
            return;
        }
        final Oid oid = adapter.getOid();
        if (LOG.isDebugEnabled()) {
            LOG.debug("resolve object (remotely from server)" + oid);
View Full Code Here

        factory = new AdapterFactoryAbstract() {
            @Override
            public ObjectAdapter createAdapter(final Object pojo, final Oid oid) {
                final ObjectSpecification specification = reflector.loadSpecification(pojo.getClass());
                final ResolveState state =
                    oid == null ? ResolveState.VALUE : oid.isTransient() ? ResolveState.TRANSIENT : ResolveState.GHOST;

                final TestProxyAdapter objectAdapter = new TestProxyAdapter();
                objectAdapter.setupResolveState(state);
                objectAdapter.setupObject(pojo);
View Full Code Here

                return "Show this node in the right-hand pane";
            }
        });

        final ObjectAdapter object = getView().getContent().getAdapter();
        final ResolveState resolveState = (object).getResolveState();
        if (object instanceof ObjectAdapter && (resolveState.isGhost() || resolveState.isPartlyResolved())) {
            options.add(new UserActionAbstract("Load object") {
                @Override
                public void execute(final Workspace workspace, final View view, final Location at) {
                    resolveContent();
                }
View Full Code Here

        final ObjectSpecification specification = getSpecificationLoader().loadSpecification(data.getType());

        final ObjectAdapter adapter = getHydrator().recreateAdapter(oid, specification);
        if (data.getFieldContent() != null) {
            adapter.setOptimisticLock(data.getVersion());
            ResolveState state;
            state = data.hasCompleteData() ? ResolveState.RESOLVING : ResolveState.RESOLVING_PART;
            if (LOG.isDebugEnabled()) {
                LOG.debug("restoring existing object (" + state.name() + ") " + adapter);
            }
            setupFields(adapter, data, state, knownObjects);
        }
        return adapter;
    }
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.