avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/profile AbstractProfilePoint.java CSVProfiler.java
Date Thu, 13 Dec 2001 22:17:50 GMT
bloritsch    01/12/13 14:17:50

  Modified:    src/scratchpad/org/apache/avalon/excalibur/profile
                        AbstractProfilePoint.java
  Added:       src/scratchpad/org/apache/avalon/excalibur/event Queue.java
                        QueueElement.java Sink.java Source.java
  Removed:     src/scratchpad/org/apache/avalon/excalibur/profile
                        CSVProfiler.java
  Log:
  fixed typos, and added initial queue support
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/Queue.java
  
  Index: Queue.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.excalibur.event;
  
  /**
   * A Source implements the side of an event queue where QueueElements are
   * dequeued operations only.
   *
   * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
   */
  public interface Queue extends Source, Sink
  {
  }
  
  
  1.1                  jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/QueueElement.java
  
  Index: QueueElement.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.excalibur.event;
  
  /**
   * A Source implements the side of an event queue where QueueElements are
   * dequeued operations only.
   *
   * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
   */
  public interface QueueElement
  {
  }
  
  
  1.1                  jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/Sink.java
  
  Index: Sink.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.excalibur.event;
  
  /**
   * A Sink implements the end of a finite-length event queue where QueueElements
   * are enqueued. These operations can throw a SinkException if the sink is
   * closed or becomes full, allowing event queues to support thresholding and
   * backpressure.
   *
   * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
   */
  public interface Sink {
  
    /**
     * Enqueues the given element onto the queue.
     *
     * @param element  The <code>QueueElementIF</code> to enqueue
     * @exception SinkFullException Indicates that the sink is temporarily full.
     * @exception SinkClosedException Indicates that the sink is
     *   no longer being serviced.
     */
    public void enqueue(QueueElement element)
        throws Exception;
  
    /**
     * Given an array of elements, atomically enqueues all of the elements
     * in the array. This guarantees that no other thread can interleave its
     * own elements with those being inserted from this array. The
     * implementation must enqueue all of the elements or none of them;
     * if a SinkFullException or SinkClosedException is thrown, none of
     * the elements will have been enqueued.
     *
     * @param elements The element array to enqueue
     * @exception SinkFullException Indicates that the sink is temporarily full.
     * @exception SinkClosedException Indicates that the sink is
     *   no longer being serviced.
     *
     */
    public void enqueue(QueueElement[] elements)
        throws Exception;
  
    /**
     * Returns the number of elements waiting in this queue.
     */
    public int size();
  
  
    /**
     * Returns the length threshold of the sink. This is for informational
     * purposes only; an implementation may allow more (or fewer) new
     * entries to be enqueued than maxSize() - size(). This may be the
     * case, for example, if the sink implements some form of dynamic
     * thresholding, and does not always accurately report maxSize().
     *
     * @return -1 if the sink has no length threshold.
     */
    public int maxSize();
  
    /**
     * Returns true if this sink has reached its threshold; false otherwise.
     * Like maxSize(), this is also informational, and isFull() returning
     * false does not guarantee that future enqueue operations will succeed.
     * Clearly, isFull() returning true does not guarantee that they will
     * fail, since the queue may be serviced in the meantime.
     */
    public boolean isFull();
  
    /**
     * Returns the number of QueueElements it can currently accept.  This is
     * typically the difference between <code>size()</code> and
     * <code>maxSize()</code>.  It will return -1 if the queue is unbounded.
     */
    public int canAccept();
  
  }
  
  
  1.1                  jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/Source.java
  
  Index: Source.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.excalibur.event;
  
  /**
   * A Source implements the side of an event queue where QueueElements are
   * dequeued operations only.
   *
   * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
   */
  public interface Source {
  
    /**
     * Dequeues the next element, or returns <code>null</code> if there is
     * nothing left on the queue.
     *
     * @return the next <code>QueueElement</code> on the queue
     */
    public QueueElement dequeue();
  
    /**
     * Dequeues all available elements, or returns <code>null</code> if there
is
     * nothing left on the queue.
     *
     * @return all pending <code>QueueElement</code>s on the queue
     */
    public QueueElement[] dequeueAll();
  
    /**
     * Dequeues at most <code>num</code> available elements, or returns
     * <code>null</code> if there is nothing left on the queue.
     *
     * @return At most <code>num</code> <code>QueueElement</code>s
on the queue
     */
    public QueueElement[] dequeue(int num);
  
    /**
     * Returns the number of elements waiting in this queue.
     */
    public int size();
  
  }
  
  
  1.3       +1 -1      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/profile/AbstractProfilePoint.java
  
  Index: AbstractProfilePoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/profile/AbstractProfilePoint.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractProfilePoint.java	2001/12/13 20:37:13	1.2
  +++ AbstractProfilePoint.java	2001/12/13 22:17:50	1.3
  @@ -14,7 +14,7 @@
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    */
  -public class AbstractProfilePoint implements ProfilePoint
  +public abstract class AbstractProfilePoint implements ProfilePoint
   {
       private final String m_name;
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message