public class BlockingQueueHandler extends Handler implements BlockingQueue<LogRecord>
| Constructor and Description |
|---|
BlockingQueueHandler()
Creates a BlockingQueueHandler that can store 1 LogRecord
|
BlockingQueueHandler(int size)
Creates a BlockingQueueHandler that can store a set amount of LogRecords
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(LogRecord e) |
boolean |
addAll(Collection<? extends LogRecord> c) |
void |
clear() |
void |
close() |
boolean |
contains(LogRecord lr) |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
int |
drainTo(Collection<? super LogRecord> c) |
int |
drainTo(Collection<? super LogRecord> c,
int maxElements) |
LogRecord |
element() |
void |
flush()
Empties the queue of all elements
|
boolean |
isEmpty() |
Iterator<LogRecord> |
iterator() |
boolean |
offer(LogRecord e) |
boolean |
offer(LogRecord e,
long timeout,
TimeUnit unit) |
LogRecord |
peek() |
LogRecord |
poll() |
LogRecord |
poll(long timeout,
TimeUnit unit) |
void |
publish(LogRecord record) |
void |
put(LogRecord e) |
int |
remainingCapacity() |
LogRecord |
remove() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
LogRecord |
take() |
LogRecord[] |
toArray() |
<T> T[] |
toArray(T[] a) |
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCode, parallelStream, removeIf, spliterator, streampublic BlockingQueueHandler()
public BlockingQueueHandler(int size)
size - the maximum number of LogRecords that can be storedpublic void close()
throws SecurityException
close in class HandlerSecurityExceptionpublic boolean add(LogRecord e)
add in interface Collection<LogRecord>add in interface BlockingQueue<LogRecord>add in interface Queue<LogRecord>public boolean offer(LogRecord e)
public void put(LogRecord e) throws InterruptedException
put in interface BlockingQueue<LogRecord>InterruptedExceptionpublic boolean offer(LogRecord e, long timeout, TimeUnit unit) throws InterruptedException
offer in interface BlockingQueue<LogRecord>InterruptedExceptionpublic LogRecord take() throws InterruptedException
take in interface BlockingQueue<LogRecord>InterruptedExceptionpublic LogRecord poll(long timeout, TimeUnit unit) throws InterruptedException
poll in interface BlockingQueue<LogRecord>InterruptedExceptionpublic int remainingCapacity()
remainingCapacity in interface BlockingQueue<LogRecord>public boolean remove(Object o)
remove in interface Collection<LogRecord>remove in interface BlockingQueue<LogRecord>public boolean contains(Object o)
contains in interface Collection<LogRecord>contains in interface BlockingQueue<LogRecord>public boolean contains(LogRecord lr)
public int drainTo(Collection<? super LogRecord> c)
drainTo in interface BlockingQueue<LogRecord>public int drainTo(Collection<? super LogRecord> c, int maxElements)
drainTo in interface BlockingQueue<LogRecord>public int size()
size in interface Collection<LogRecord>public boolean isEmpty()
isEmpty in interface Collection<LogRecord>public LogRecord[] toArray()
toArray in interface Collection<LogRecord>public <T> T[] toArray(T[] a)
toArray in interface Collection<LogRecord>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<LogRecord>public boolean addAll(Collection<? extends LogRecord> c)
addAll in interface Collection<LogRecord>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<LogRecord>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<LogRecord>public void clear()
clear in interface Collection<LogRecord>Copyright © 2019. All rights reserved.