Examples of KeyBasedOperation


Examples of net.sf.ehcache.writer.writebehind.operations.KeyBasedOperation

        final List operationsToRemove = new ArrayList();

        // not using an iterator on purpose since the ehcache express types don't support it
        for (int i = 0; i < operations.size(); i++) {
            Object operation = operations.get(i);
            KeyBasedOperation keyBasedOperation = converter.convert(operation);

            if (!mostRecent.containsKey(keyBasedOperation.getKey())) {
                mostRecent.put(keyBasedOperation.getKey(), operation);
            } else {
                Object previousOperation = mostRecent.get(keyBasedOperation.getKey());
                KeyBasedOperation keyBasedPreviousOperation = converter.convert(previousOperation);

                if (keyBasedPreviousOperation.getCreationTime() > keyBasedOperation.getCreationTime()) {
                    operationsToRemove.add(operation);
                } else {
                    operationsToRemove.add(previousOperation);
                    mostRecent.put(keyBasedOperation.getKey(), operation);
                }
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.