Package net.sf.ehcache.writer.writebehind.operations

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


        // create batches that are separated by operation type
        final Map<SingleOperationType, List<SingleOperation>> separatedItemsPerType =
                new TreeMap<SingleOperationType, List<SingleOperation>>();
        for (int i = 0; i < batchSize; i++) {
            final SingleOperation item = quarantined.get(i);

            if (LOGGER.isLoggable(Level.CONFIG)) {
                LOGGER.config(getThreadName() + " : processItems() : adding " + item + " to next batch");
            }

            List<SingleOperation> itemsPerType = separatedItemsPerType.get(item.getType());
            if (null == itemsPerType) {
                itemsPerType = new ArrayList<SingleOperation>();
                separatedItemsPerType.put(item.getType(), itemsPerType);
            }

            itemsPerType.add(item);
        }
View Full Code Here


    }

    private void processSingleOperation(List<SingleOperation> quarantined) {
        while (!quarantined.isEmpty()) {
            // process the next item
            final SingleOperation item = quarantined.get(0);
            if (LOGGER.isLoggable(Level.CONFIG)) {
                LOGGER.config(getThreadName() + " : processItems() : processing " + item);
            }

            int executionsLeft = retryAttempts + 1;
            while (executionsLeft-- > 0) {
                try {
                    item.performSingleOperation(cacheWriter);
                    break;
                } catch (final RuntimeException e) {
                    if (executionsLeft <= 0) {
                        throw e;
                    } else {
View Full Code Here

TOP

Related Classes of net.sf.ehcache.writer.writebehind.operations.SingleOperation

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.