Package cern.entwined.exception

Examples of cern.entwined.exception.ConflictException


        }

        // Checking for conflicts
        if (this.globallyAccessed) {
            if (!globalState.sourceMap.equals(this.sourceMap)) {
                throw new ConflictException("All the items of this map have been accessed "
                        + "this prohibits commit in the case of concurrent changes");
            }
        }
        for (K key : this.accessed) {
            checkConsistency(globalState.sourceMap, key);
View Full Code Here


        V sourceValue = this.sourceMap.get(key);
        V globalValue = globalMap.get(key);
        if ((sourceValue != globalValue) || // <br>
                ((null == sourceValue || null == globalValue)// <br>
                && (this.sourceMap.containsKey(key) ^ globalMap.containsKey(key)))) {
            throw new ConflictException("Conflicting changes for [" + key + "]");
        }
    }
View Full Code Here

        int sourceSize = this.sourceQueue.size();
        if (this.peekCount != 0) {
            // There were readings, check for the conflicts.
            if (globalState.globalPollCount != this.globalPollCount) {
                // We were reading from the head, and it is different the global state.
                throw new ConflictException("Queue's head was updated");
            }

            boolean pastSource = this.peekCount > sourceSize;
            if (pastSource && globalState.sourceQueue != this.sourceQueue) {
                // We read past the source queue length, into the tail, while the global state had been extended with
                // more elements on the tail. (difference of references in this case means exactly that)
                throw new ConflictException("Reading past source queue with tail concurrently updated");
            }
        }

        if (this.pollCount == 0 && tail.isEmpty()) {
            return globalState;
View Full Code Here

        Utils.checkNull("Transactional reference", globalState);
        if (globalState.accessed) {
            throw new IllegalArgumentException("Global state must be commited before calling this method");
        }
        if (this.accessed && globalState.sourceValue != this.sourceValue) {
            throw new ConflictException("Conflicting update detected");
        }

        if (!this.updated) {
            // Return current global state if value hasn't been changed.
            return globalState;
View Full Code Here

TOP

Related Classes of cern.entwined.exception.ConflictException

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.