Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.net
Class LoadBalancer.Queue

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.LoadBalancer.Queue

Enclosing class:
LoadBalancer

public static class LoadBalancer.Queue
extends Base

A Queue is used to effeciently queue up items for daemon threads to work on.


Field Summary
protected  java.util.List m_list
          A list of items that have been queued.

 

Constructor Summary
LoadBalancer.Queue()
          Construct a queue.

 

Method Summary
 void add(java.lang.Object o)
          Add an object to the end of the queue.
 boolean isEmpty()
          Determine if the queue is empty.
 java.lang.Object remove()
          Wait for and remove an item from the from of the queue.
 java.lang.Object removeNoWait()
          Remove an item from the queue if the queue is not empty.
 int size()
          Determine the number of items in the queue.

 

Field Detail

m_list

protected java.util.List m_list
A list of items that have been queued.

Constructor Detail

LoadBalancer.Queue

public LoadBalancer.Queue()
Construct a queue.

Method Detail

size

public int size()
Determine the number of items in the queue.
Returns:
the number of items in the queue

isEmpty

public boolean isEmpty()
Determine if the queue is empty.
Returns:
true if the queue currently has no items in it

add

public void add(java.lang.Object o)
Add an object to the end of the queue.
Parameters:
o - the item to add to the end of the queue

remove

public java.lang.Object remove()
                        throws java.lang.InterruptedException
Wait for and remove an item from the from of the queue.
Returns:
an item from the queue
Throws:
java.lang.InterruptedException - if the thread is interrupted while waiting for something to be added to the queue

removeNoWait

public java.lang.Object removeNoWait()
Remove an item from the queue if the queue is not empty.
Returns:
an item if the queue is not empty, otherwise null

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.