Package org.apache.openjpa.util.proxy
Class DelayedPriorityQueueProxy
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- java.util.PriorityQueue
-
- org.apache.openjpa.util.proxy.DelayedPriorityQueueProxy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable
,java.util.Collection
,java.util.Queue
,Proxy
,DelayedProxy
,ProxyCollection
public class DelayedPriorityQueueProxy extends java.util.PriorityQueue implements ProxyCollection, DelayedProxy
PriorityQueue proxy with delay loading capability. Allows non-indexed add and remove operations to occur on an unloaded collection. Operations that require a load will trigger a load.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DelayedPriorityQueueProxy()
DelayedPriorityQueueProxy(int paramInt)
DelayedPriorityQueueProxy(int paramInt, java.util.Comparator paramComparator)
DelayedPriorityQueueProxy(java.util.Collection paramCollection)
DelayedPriorityQueueProxy(java.util.PriorityQueue paramPriorityQueue)
DelayedPriorityQueueProxy(java.util.SortedSet paramSortedSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(java.lang.Object paramObject)
boolean
addAll(java.util.Collection paramCollection)
void
clear()
java.lang.Object
clone()
void
closeBroker()
Close the broker that is used to service this proxy.boolean
contains(java.lang.Object object)
boolean
containsAll(java.util.Collection c)
java.lang.Object
copy(java.lang.Object paramObject)
Return an unproxied copy of the given instance.java.lang.Object
element()
boolean
equals(java.lang.Object paramObject)
Broker
getBroker()
Get the broker that is used to service this proxy.BrokerFactory
getBrokerFactory()
ChangeTracker
getChangeTracker()
Return the change tracker for this proxy, or null if none.int
getDelayedField()
Returns the expected field index even if this collection was detached.OpenJPAStateManager
getDelayedOwner()
Returns a state manager that can service this proxy even if the collection was detached.java.lang.Class
getElementType()
The collection element type.OpenJPAStateManager
getOwner()
Return the owning object.int
getOwnerField()
Return the owning field index.OpenJPAStateManager
getOwnerStateManager()
Returns the state manager of the owning instance.int
hashCode()
boolean
isDelayLoad()
boolean
isDetached()
Returns whether the proxy is detached.boolean
isDirectAccess()
Returns whether the caller has direct-call access to the proxied object.boolean
isEmpty()
java.util.Iterator
iterator()
void
load()
Load the proxy if it was delay-loaded.ProxyCollection
newInstance(java.lang.Class paramClass, java.util.Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2)
Create a new instance of this proxy type.boolean
offer(java.lang.Object paramObject)
java.lang.Object
peek()
java.lang.Object
poll()
java.lang.Object
remove()
boolean
remove(java.lang.Object paramObject)
boolean
removeAll(java.util.Collection paramCollection)
boolean
retainAll(java.util.Collection paramCollection)
protected void
setChangeTracker(CollectionChangeTracker ct)
void
setDirectAccess(boolean direct)
Sets whether the caller has direct-call access to the proxied object.protected void
setElementType(java.lang.Class<?> elemType)
void
setOwner(OpenJPAStateManager paramOpenJPAStateManager, int paramInt)
Reset the state of the proxy, and set the owning instance of the proxy and the name of the field it is assigned to.int
size()
java.lang.Object[]
toArray()
java.lang.Object[]
toArray(java.lang.Object[] array)
java.lang.Object[]
toArray(java.util.function.IntFunction generator)
protected java.lang.Object
writeReplace()
-
-
-
Constructor Detail
-
DelayedPriorityQueueProxy
public DelayedPriorityQueueProxy(int paramInt)
-
DelayedPriorityQueueProxy
public DelayedPriorityQueueProxy(int paramInt, java.util.Comparator paramComparator)
-
DelayedPriorityQueueProxy
public DelayedPriorityQueueProxy(java.util.Collection paramCollection)
-
DelayedPriorityQueueProxy
public DelayedPriorityQueueProxy(java.util.PriorityQueue paramPriorityQueue)
-
DelayedPriorityQueueProxy
public DelayedPriorityQueueProxy(java.util.SortedSet paramSortedSet)
-
DelayedPriorityQueueProxy
public DelayedPriorityQueueProxy()
-
-
Method Detail
-
setOwner
public void setOwner(OpenJPAStateManager paramOpenJPAStateManager, int paramInt)
Description copied from interface:Proxy
Reset the state of the proxy, and set the owning instance of the proxy and the name of the field it is assigned to. Set to null to indicate that the proxy is no longer managed.
-
getOwner
public OpenJPAStateManager getOwner()
Description copied from interface:Proxy
Return the owning object.
-
getOwnerField
public int getOwnerField()
Description copied from interface:Proxy
Return the owning field index.- Specified by:
getOwnerField
in interfaceProxy
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
getChangeTracker
public ChangeTracker getChangeTracker()
Description copied from interface:Proxy
Return the change tracker for this proxy, or null if none.- Specified by:
getChangeTracker
in interfaceProxy
-
setChangeTracker
protected void setChangeTracker(CollectionChangeTracker ct)
-
copy
public java.lang.Object copy(java.lang.Object paramObject)
Description copied from interface:Proxy
Return an unproxied copy of the given instance. This method is used by proxy managers to create backup values for use in rollback.
-
getElementType
public java.lang.Class getElementType()
Description copied from interface:ProxyCollection
The collection element type.- Specified by:
getElementType
in interfaceProxyCollection
-
setElementType
protected void setElementType(java.lang.Class<?> elemType)
-
newInstance
public ProxyCollection newInstance(java.lang.Class paramClass, java.util.Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2)
Description copied from interface:ProxyCollection
Create a new instance of this proxy type.- Specified by:
newInstance
in interfaceProxyCollection
-
add
public boolean add(java.lang.Object paramObject)
- Specified by:
add
in interfacejava.util.Collection
- Specified by:
add
in interfacejava.util.Queue
- Overrides:
add
in classjava.util.PriorityQueue
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection
- Overrides:
clear
in classjava.util.PriorityQueue
-
iterator
public java.util.Iterator iterator()
- Specified by:
iterator
in interfacejava.util.Collection
- Specified by:
iterator
in interfacejava.lang.Iterable
- Overrides:
iterator
in classjava.util.PriorityQueue
-
remove
public boolean remove(java.lang.Object paramObject)
- Specified by:
remove
in interfacejava.util.Collection
- Overrides:
remove
in classjava.util.PriorityQueue
-
poll
public java.lang.Object poll()
- Specified by:
poll
in interfacejava.util.Queue
- Overrides:
poll
in classjava.util.PriorityQueue
-
offer
public boolean offer(java.lang.Object paramObject)
- Specified by:
offer
in interfacejava.util.Queue
- Overrides:
offer
in classjava.util.PriorityQueue
-
addAll
public boolean addAll(java.util.Collection paramCollection)
- Specified by:
addAll
in interfacejava.util.Collection
- Overrides:
addAll
in classjava.util.AbstractQueue
-
remove
public java.lang.Object remove()
- Specified by:
remove
in interfacejava.util.Queue
- Overrides:
remove
in classjava.util.AbstractQueue
-
removeAll
public boolean removeAll(java.util.Collection paramCollection)
- Specified by:
removeAll
in interfacejava.util.Collection
- Overrides:
removeAll
in classjava.util.PriorityQueue
-
retainAll
public boolean retainAll(java.util.Collection paramCollection)
- Specified by:
retainAll
in interfacejava.util.Collection
- Overrides:
retainAll
in classjava.util.PriorityQueue
-
writeReplace
protected java.lang.Object writeReplace() throws java.io.ObjectStreamException
- Throws:
java.io.ObjectStreamException
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection
- Overrides:
size
in classjava.util.PriorityQueue
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection
- Overrides:
isEmpty
in classjava.util.AbstractCollection
-
contains
public boolean contains(java.lang.Object object)
- Specified by:
contains
in interfacejava.util.Collection
- Overrides:
contains
in classjava.util.PriorityQueue
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection
- Overrides:
toArray
in classjava.util.PriorityQueue
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] array)
- Specified by:
toArray
in interfacejava.util.Collection
- Overrides:
toArray
in classjava.util.PriorityQueue
-
toArray
public java.lang.Object[] toArray(java.util.function.IntFunction generator)
- Specified by:
toArray
in interfacejava.util.Collection
-
containsAll
public boolean containsAll(java.util.Collection c)
- Specified by:
containsAll
in interfacejava.util.Collection
- Overrides:
containsAll
in classjava.util.AbstractCollection
-
element
public java.lang.Object element()
- Specified by:
element
in interfacejava.util.Queue
- Overrides:
element
in classjava.util.AbstractQueue
-
peek
public java.lang.Object peek()
- Specified by:
peek
in interfacejava.util.Queue
- Overrides:
peek
in classjava.util.PriorityQueue
-
equals
public boolean equals(java.lang.Object paramObject)
- Specified by:
equals
in interfacejava.util.Collection
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection
- Overrides:
hashCode
in classjava.lang.Object
-
getDelayedField
public int getDelayedField()
Description copied from interface:DelayedProxy
Returns the expected field index even if this collection was detached.- Specified by:
getDelayedField
in interfaceDelayedProxy
-
getDelayedOwner
public OpenJPAStateManager getDelayedOwner()
Description copied from interface:DelayedProxy
Returns a state manager that can service this proxy even if the collection was detached.- Specified by:
getDelayedOwner
in interfaceDelayedProxy
-
isDirectAccess
public boolean isDirectAccess()
Description copied from interface:DelayedProxy
Returns whether the caller has direct-call access to the proxied object. Direct access allows calls to be made on the object without triggering a load or proxy state tracking callbacks.- Specified by:
isDirectAccess
in interfaceDelayedProxy
-
setDirectAccess
public void setDirectAccess(boolean direct)
Description copied from interface:DelayedProxy
Sets whether the caller has direct-call access to the proxied object. Direct access allows calls to be made on the object without triggering a load or proxy state tracking callbacks.- Specified by:
setDirectAccess
in interfaceDelayedProxy
-
getBrokerFactory
public BrokerFactory getBrokerFactory()
-
load
public void load()
Description copied from interface:DelayedProxy
Load the proxy if it was delay-loaded.- Specified by:
load
in interfaceDelayedProxy
-
getBroker
public Broker getBroker()
Description copied from interface:DelayedProxy
Get the broker that is used to service this proxy.- Specified by:
getBroker
in interfaceDelayedProxy
-
closeBroker
public void closeBroker()
Description copied from interface:DelayedProxy
Close the broker that is used to service this proxy.- Specified by:
closeBroker
in interfaceDelayedProxy
-
getOwnerStateManager
public OpenJPAStateManager getOwnerStateManager()
Description copied from interface:DelayedProxy
Returns the state manager of the owning instance.- Specified by:
getOwnerStateManager
in interfaceDelayedProxy
-
isDetached
public boolean isDetached()
Description copied from interface:DelayedProxy
Returns whether the proxy is detached.- Specified by:
isDetached
in interfaceDelayedProxy
-
isDelayLoad
public boolean isDelayLoad()
-
-