Package com.tangosol.net
Class LoadBalancer.Queue
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.LoadBalancer.Queue
- Enclosing class:
LoadBalancer
A Queue is used to effeciently queue up items for daemon threads to
work on.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an object to the end of the queue.boolean
isEmpty()
Determine if the queue is empty.remove()
Wait for and remove an item from the from of the queue.Remove an item from the queue if the queue is not empty.int
size()
Determine the number of items in the queue.Methods inherited from class com.tangosol.util.Base
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
-
Field Details
-
m_list
A list of items that have been queued.
-
-
Constructor Details
-
Queue
public Queue()Construct a queue.
-
-
Method Details
-
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
Add an object to the end of the queue.- Parameters:
o
- the item to add to the end of the queue
-
remove
Wait for and remove an item from the from of the queue.- Returns:
- an item from the queue
- Throws:
InterruptedException
- if the thread is interrupted while waiting for something to be added to the queue
-
removeNoWait
Remove an item from the queue if the queue is not empty.- Returns:
- an item if the queue is not empty, otherwise null
-