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 booleanadd(java.lang.Object paramObject)booleanaddAll(java.util.Collection paramCollection)voidclear()java.lang.Objectclone()voidcloseBroker()Close the broker that is used to service this proxy.booleancontains(java.lang.Object object)booleancontainsAll(java.util.Collection c)java.lang.Objectcopy(java.lang.Object paramObject)Return an unproxied copy of the given instance.java.lang.Objectelement()booleanequals(java.lang.Object paramObject)BrokergetBroker()Get the broker that is used to service this proxy.BrokerFactorygetBrokerFactory()ChangeTrackergetChangeTracker()Return the change tracker for this proxy, or null if none.intgetDelayedField()Returns the expected field index even if this collection was detached.OpenJPAStateManagergetDelayedOwner()Returns a state manager that can service this proxy even if the collection was detached.java.lang.ClassgetElementType()The collection element type.OpenJPAStateManagergetOwner()Return the owning object.intgetOwnerField()Return the owning field index.OpenJPAStateManagergetOwnerStateManager()Returns the state manager of the owning instance.inthashCode()booleanisDelayLoad()booleanisDetached()Returns whether the proxy is detached.booleanisDirectAccess()Returns whether the caller has direct-call access to the proxied object.booleanisEmpty()java.util.Iteratoriterator()voidload()Load the proxy if it was delay-loaded.ProxyCollectionnewInstance(java.lang.Class paramClass, java.util.Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2)Create a new instance of this proxy type.booleanoffer(java.lang.Object paramObject)java.lang.Objectpeek()java.lang.Objectpoll()java.lang.Objectremove()booleanremove(java.lang.Object paramObject)booleanremoveAll(java.util.Collection paramCollection)booleanretainAll(java.util.Collection paramCollection)protected voidsetChangeTracker(CollectionChangeTracker ct)voidsetDirectAccess(boolean direct)Sets whether the caller has direct-call access to the proxied object.protected voidsetElementType(java.lang.Class<?> elemType)voidsetOwner(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.intsize()java.lang.Object[]toArray()java.lang.Object[]toArray(java.lang.Object[] array)java.lang.Object[]toArray(java.util.function.IntFunction generator)protected java.lang.ObjectwriteReplace()
-
-
-
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:ProxyReset 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:ProxyReturn the owning object.
-
getOwnerField
public int getOwnerField()
Description copied from interface:ProxyReturn the owning field index.- Specified by:
getOwnerFieldin interfaceProxy
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
getChangeTracker
public ChangeTracker getChangeTracker()
Description copied from interface:ProxyReturn the change tracker for this proxy, or null if none.- Specified by:
getChangeTrackerin interfaceProxy
-
setChangeTracker
protected void setChangeTracker(CollectionChangeTracker ct)
-
copy
public java.lang.Object copy(java.lang.Object paramObject)
Description copied from interface:ProxyReturn 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:ProxyCollectionThe collection element type.- Specified by:
getElementTypein 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:ProxyCollectionCreate a new instance of this proxy type.- Specified by:
newInstancein interfaceProxyCollection
-
add
public boolean add(java.lang.Object paramObject)
- Specified by:
addin interfacejava.util.Collection- Specified by:
addin interfacejava.util.Queue- Overrides:
addin classjava.util.PriorityQueue
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection- Overrides:
clearin classjava.util.PriorityQueue
-
iterator
public java.util.Iterator iterator()
- Specified by:
iteratorin interfacejava.util.Collection- Specified by:
iteratorin interfacejava.lang.Iterable- Overrides:
iteratorin classjava.util.PriorityQueue
-
remove
public boolean remove(java.lang.Object paramObject)
- Specified by:
removein interfacejava.util.Collection- Overrides:
removein classjava.util.PriorityQueue
-
poll
public java.lang.Object poll()
- Specified by:
pollin interfacejava.util.Queue- Overrides:
pollin classjava.util.PriorityQueue
-
offer
public boolean offer(java.lang.Object paramObject)
- Specified by:
offerin interfacejava.util.Queue- Overrides:
offerin classjava.util.PriorityQueue
-
addAll
public boolean addAll(java.util.Collection paramCollection)
- Specified by:
addAllin interfacejava.util.Collection- Overrides:
addAllin classjava.util.AbstractQueue
-
remove
public java.lang.Object remove()
- Specified by:
removein interfacejava.util.Queue- Overrides:
removein classjava.util.AbstractQueue
-
removeAll
public boolean removeAll(java.util.Collection paramCollection)
- Specified by:
removeAllin interfacejava.util.Collection- Overrides:
removeAllin classjava.util.PriorityQueue
-
retainAll
public boolean retainAll(java.util.Collection paramCollection)
- Specified by:
retainAllin interfacejava.util.Collection- Overrides:
retainAllin classjava.util.PriorityQueue
-
writeReplace
protected java.lang.Object writeReplace() throws java.io.ObjectStreamException- Throws:
java.io.ObjectStreamException
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection- Overrides:
sizein classjava.util.PriorityQueue
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection- Overrides:
isEmptyin classjava.util.AbstractCollection
-
contains
public boolean contains(java.lang.Object object)
- Specified by:
containsin interfacejava.util.Collection- Overrides:
containsin classjava.util.PriorityQueue
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection- Overrides:
toArrayin classjava.util.PriorityQueue
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] array)
- Specified by:
toArrayin interfacejava.util.Collection- Overrides:
toArrayin classjava.util.PriorityQueue
-
toArray
public java.lang.Object[] toArray(java.util.function.IntFunction generator)
- Specified by:
toArrayin interfacejava.util.Collection
-
containsAll
public boolean containsAll(java.util.Collection c)
- Specified by:
containsAllin interfacejava.util.Collection- Overrides:
containsAllin classjava.util.AbstractCollection
-
element
public java.lang.Object element()
- Specified by:
elementin interfacejava.util.Queue- Overrides:
elementin classjava.util.AbstractQueue
-
peek
public java.lang.Object peek()
- Specified by:
peekin interfacejava.util.Queue- Overrides:
peekin classjava.util.PriorityQueue
-
equals
public boolean equals(java.lang.Object paramObject)
- Specified by:
equalsin interfacejava.util.Collection- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Collection- Overrides:
hashCodein classjava.lang.Object
-
getDelayedField
public int getDelayedField()
Description copied from interface:DelayedProxyReturns the expected field index even if this collection was detached.- Specified by:
getDelayedFieldin interfaceDelayedProxy
-
getDelayedOwner
public OpenJPAStateManager getDelayedOwner()
Description copied from interface:DelayedProxyReturns a state manager that can service this proxy even if the collection was detached.- Specified by:
getDelayedOwnerin interfaceDelayedProxy
-
isDirectAccess
public boolean isDirectAccess()
Description copied from interface:DelayedProxyReturns 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:
isDirectAccessin interfaceDelayedProxy
-
setDirectAccess
public void setDirectAccess(boolean direct)
Description copied from interface:DelayedProxySets 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:
setDirectAccessin interfaceDelayedProxy
-
getBrokerFactory
public BrokerFactory getBrokerFactory()
-
load
public void load()
Description copied from interface:DelayedProxyLoad the proxy if it was delay-loaded.- Specified by:
loadin interfaceDelayedProxy
-
getBroker
public Broker getBroker()
Description copied from interface:DelayedProxyGet the broker that is used to service this proxy.- Specified by:
getBrokerin interfaceDelayedProxy
-
closeBroker
public void closeBroker()
Description copied from interface:DelayedProxyClose the broker that is used to service this proxy.- Specified by:
closeBrokerin interfaceDelayedProxy
-
getOwnerStateManager
public OpenJPAStateManager getOwnerStateManager()
Description copied from interface:DelayedProxyReturns the state manager of the owning instance.- Specified by:
getOwnerStateManagerin interfaceDelayedProxy
-
isDetached
public boolean isDetached()
Description copied from interface:DelayedProxyReturns whether the proxy is detached.- Specified by:
isDetachedin interfaceDelayedProxy
-
isDelayLoad
public boolean isDelayLoad()
-
-