public class GridCacheQueueProxy<T> extends Object implements GridCacheQueue<T>, Externalizable
| Constructor and Description |
|---|
GridCacheQueueProxy()
Required by
Externalizable. |
GridCacheQueueProxy(GridCacheContext cctx,
GridCacheQueueAdapter<T> delegate) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T item) |
boolean |
addAll(Collection<? extends T> items) |
boolean |
bounded()
Returns
true if this queue is bounded. |
int |
capacity()
Gets maximum number of elements of the queue.
|
void |
clear() |
void |
clear(int batchSize)
Removes all of the elements from this queue.
|
boolean |
collocated()
Returns
true if this queue can be kept on the one node only. |
boolean |
contains(Object item) |
boolean |
containsAll(Collection<?> items) |
GridCacheQueueAdapter<T> |
delegate() |
int |
drainTo(Collection<? super T> c) |
int |
drainTo(Collection<? super T> c,
int maxElements) |
T |
element() |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
String |
name()
Gets queue name.
|
boolean |
offer(T item) |
boolean |
offer(T item,
long timeout,
TimeUnit unit) |
T |
peek() |
T |
poll() |
T |
poll(long timeout,
TimeUnit unit) |
void |
put(T item) |
void |
readExternal(ObjectInput in) |
protected Object |
readResolve()
Reconstructs object on demarshalling.
|
int |
remainingCapacity() |
T |
remove() |
boolean |
remove(Object item) |
boolean |
removeAll(Collection<?> items) |
boolean |
removed()
Gets status of queue.
|
boolean |
retainAll(Collection<?> items) |
int |
size() |
T |
take() |
Object[] |
toArray() |
<T1> T1[] |
toArray(T1[] a) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public GridCacheQueueProxy()
Externalizable.public GridCacheQueueProxy(GridCacheContext cctx, GridCacheQueueAdapter<T> delegate)
cctx - Cache context.delegate - Delegate queue.public GridCacheQueueAdapter<T> delegate()
public boolean add(T item)
add in interface Collection<T>add in interface BlockingQueue<T>add in interface Queue<T>add in interface GridCacheQueue<T>public boolean offer(T item)
offer in interface BlockingQueue<T>offer in interface Queue<T>offer in interface GridCacheQueue<T>public boolean addAll(Collection<? extends T> items)
addAll in interface Collection<T>addAll in interface GridCacheQueue<T>public boolean contains(Object item)
contains in interface Collection<T>contains in interface BlockingQueue<T>contains in interface GridCacheQueue<T>public boolean containsAll(Collection<?> items)
containsAll in interface Collection<T>containsAll in interface GridCacheQueue<T>public void clear()
clear in interface Collection<T>clear in interface GridCacheQueue<T>public boolean remove(Object item)
remove in interface Collection<T>remove in interface BlockingQueue<T>remove in interface GridCacheQueue<T>public boolean removeAll(Collection<?> items)
removeAll in interface Collection<T>removeAll in interface GridCacheQueue<T>public boolean isEmpty()
isEmpty in interface Collection<T>isEmpty in interface GridCacheQueue<T>public Iterator<T> iterator()
iterator in interface Iterable<T>iterator in interface Collection<T>iterator in interface GridCacheQueue<T>public Object[] toArray()
toArray in interface Collection<T>toArray in interface GridCacheQueue<T>public <T1> T1[] toArray(T1[] a)
toArray in interface Collection<T>toArray in interface GridCacheQueue<T>public boolean retainAll(Collection<?> items)
retainAll in interface Collection<T>retainAll in interface GridCacheQueue<T>public int size()
size in interface Collection<T>size in interface GridCacheQueue<T>public void clear(int batchSize)
clear in interface GridCacheQueue<T>batchSize - Batch size.public int remainingCapacity()
remainingCapacity in interface BlockingQueue<T>public int drainTo(Collection<? super T> c)
drainTo in interface BlockingQueue<T>public int drainTo(Collection<? super T> c, int maxElements)
drainTo in interface BlockingQueue<T>public void put(T item)
put in interface BlockingQueue<T>put in interface GridCacheQueue<T>public boolean offer(T item, long timeout, TimeUnit unit)
offer in interface BlockingQueue<T>offer in interface GridCacheQueue<T>@Nullable public T take()
take in interface BlockingQueue<T>take in interface GridCacheQueue<T>@Nullable public T poll(long timeout, TimeUnit unit)
poll in interface BlockingQueue<T>poll in interface GridCacheQueue<T>public String name()
name in interface GridCacheQueue<T>public int capacity()
throws GridException
capacity in interface GridCacheQueue<T>Integer.MAX_SIZE will return.GridException - If operation failed.public boolean bounded()
throws GridException
true if this queue is bounded.bounded in interface GridCacheQueue<T>true if this queue is bounded.GridException - If operation failed.public boolean collocated()
throws GridException
true if this queue can be kept on the one node only.
Returns false if this queue can be kept on the many nodes.collocated in interface GridCacheQueue<T>true if this queue is in collocated mode false otherwise.GridException - If operation failed.public boolean removed()
removed in interface GridCacheQueue<T>true if queue was removed from cache false otherwise.public int hashCode()
hashCode in interface Collection<T>hashCode in class Objectpublic boolean equals(Object o)
equals in interface Collection<T>equals in class Objectpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionprotected Object readResolve() throws ObjectStreamException
ObjectStreamException - Thrown in case of demarshalling error.Copyright © 2014. All rights reserved.