// ************************************************************************ // $Id: WaitFreeWriteQueue.java 561 2005-07-11 20:09:17Z mdeters $ // ************************************************************************ // // jRate // // Copyright (C) 2001-2005 by Angelo Corsaro. // // All Rights Reserved. // // Permission to use, copy, modify, and distribute this software and // its documentation for any purpose is hereby granted without fee, // provided that the above copyright notice appear in all copies and // that both that copyright notice and this permission notice appear // in supporting documentation. I don't make any representations // about the suitability of this software for any purpose. It is // provided "as is" without express or implied warranty. // // // ************************************************************************* // // ************************************************************************* package javax.realtime; /** * A queue that provides unsynchronized nonblocking write() and * synchronized blocking read(). * * @author Morgan Deters * @version 1.0 * @since 0.3.8 */ public class WaitFreeWriteQueue { /** * Constructs a new {@link WaitFreeWriteQueue}. * * @param writer the writing thread * @param reader the reading thread * @param maximum the capacity of the queue * @param memory the {@link MemoryArea} in which to allocate the * queue's buffer; if null, then the current memory area is * used */ public WaitFreeWriteQueue(Thread writer, Thread reader, int maximum, MemoryArea memory) throws IllegalArgumentException, InstantiationException, ClassNotFoundException, IllegalAccessException { throw new UnimplementedFeatureError(); } /** * Empties the queue. This method is unsynchronized; if it could * be called at the same time as a read() operation, the callers * need to synchronize. */ public void clear() { throw new UnimplementedFeatureError(); } /** * Checks if the queue is empty. * * @return true if the queue is empty, false otherwise */ public boolean isEmpty() { throw new UnimplementedFeatureError(); } /** * Checks if the queue is full. * * @return true if the queue is full, false otherwise */ public boolean isFull() { throw new UnimplementedFeatureError(); } /** * A synchronized and blocking read operation. * * @return the object removed from the queue */ public Object read() { throw new UnimplementedFeatureError(); } /** * Returns the number of elements in the queue. * * @return the number of elements in the queue */ public int size() { throw new UnimplementedFeatureError(); } /** * Replace the last object with this object. Returns false if the * reader removed the other object as this operation was updating * it. * * @param object the object to write to the queue * @return true upon success, false otherwise * @throws MemoryScopeException if the object is in an * incompatible memory area */ public boolean force(Object object) throws MemoryScopeException { throw new UnimplementedFeatureError(); } /** * An unsynchronized and nonblocking write operation. * * @param object the object to write to the queue * @return true upon success, false otherwise * @throws MemoryScopeException if the object is in an * incompatible memory area */ public boolean write(Object object) throws MemoryScopeException { throw new UnimplementedFeatureError(); } }