1 /* 2 * Copyright (C) The Apache Software Foundation. All rights reserved. 3 * 4 * This software is published under the terms of the Apache Software License 5 * version 1.1, a copy of which has been included with this distribution in 6 * the LICENSE.txt file. 7 */ 8 package org.apache.avalon.excalibur.event; 9 10 /** 11 * A <code>PreparedEnqueue</code> is an object returned from a 12 * <code>prepareEnqueue</code> method that allows you to either 13 * commit or abort the enqueue operation. 14 * 15 * @author <a HREF="mailto:bloritsch@apache.org">Berin Loritsch</a> 16 */ 17 public interface PreparedEnqueue { 18 19 /** 20 * Commit a previously prepared provisional enqueue operation (from 21 * the <code>prepareEnqueue</code> method). Causes the provisionally 22 * enqueued elements to appear on the queue for future dequeue operations. 23 * Note that once a <code>prepareEnqueue</code> has returned an enqueue 24 * key, the queue cannot reject the entries. 25 */ 26 void commit(); 27 28 /** 29 * Abort a previously prepared provisional enqueue operation (from 30 * the <code>prepareEnqueue</code> method). Causes the queue to discard 31 * the provisionally enqueued elements. 32 */ 33 void abort(); 34 35 } 36