Top Description Inners Fields Constructors Methods
org.hibernate.engine.internal

public Class StatefulPersistenceContext

extends Object
implements PersistenceContext
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.spi.PersistenceContext
Imports
java.io.IOException, .InvalidObjectException, .ObjectInputStream, .ObjectOutputStream, .Serializable, java.util.ArrayList, .Collection, .Collections, .HashMap, .HashSet, .IdentityHashMap, .Iterator, .Map, .Map.Entry, java.util.concurrent.ConcurrentMap, java.util.function.BiConsumer, .Consumer, .Supplier, org.hibernate.AssertionFailure, .Hibernate, .HibernateException, .LockMode, .MappingException, .NonUniqueObjectException, .PersistentObjectException, .TransientObjectException, org.hibernate.action.spi.AfterTransactionCompletionProcess, org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor, .EnhancementAsProxyLazinessInterceptor, .LazyAttributeLoadingInterceptor, org.hibernate.cache.spi.access.NaturalIdDataAccess, .SoftLock, org.hibernate.collection.spi.PersistentCollection, org.hibernate.engine.loading.internal.LoadContexts, org.hibernate.engine.spi.AssociationKey, .BatchFetchQueue, .CachedNaturalIdValueSource, .CollectionEntry, .CollectionKey, .EntityEntry, .EntityKey, .EntityUniqueKey, .ManagedEntity, .PersistenceContext, .PersistentAttributeInterceptable, .PersistentAttributeInterceptor, .SessionFactoryImplementor, .SessionImplementor, .SharedSessionContractImplementor, .Status, org.hibernate.event.spi.EventSource, org.hibernate.internal.CoreMessageLogger, org.hibernate.internal.util.collections.ConcurrentReferenceHashMap, .IdentityMap, org.hibernate.metamodel.spi.MetamodelImplementor, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.entity.EntityPersister, org.hibernate.pretty.MessageHelper, org.hibernate.proxy.HibernateProxy, .LazyInitializer, org.hibernate.stat.internal.StatsHelper, org.hibernate.stat.spi.StatisticsImplementor, org.hibernate.type.CollectionType, org.jboss.logging.Logger

A stateful implementation of the PersistenceContext contract meaning that we maintain this state throughout the life of the persistence context.

IMPL NOTE: There is meant to be a one-to-one correspondence between a org.hibernate.internal.SessionImpl and a PersistentContext. Event listeners and other Session collaborators then use the PersistentContext to drive their processing.

Authors
Steve Ebersole, Sanne Grinovero

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface

Field Summary

Modifier and TypeField and Description
private IdentityHashMap<Object, PersistentCollection>
private BatchFetchQueue
private int
private IdentityMap<PersistentCollection, CollectionEntry>
private HashMap<CollectionKey, PersistentCollection>
private boolean
private HashMap<EntityKey, Object>
private HashMap<EntityUniqueKey, Object>
private EntityEntryContext
private HashMap<EntityKey, Object>
private boolean
private boolean
private static final int
private HashMap<String, HashSet<Serializable>>
private LoadContexts
private int
private static final CoreMessageLogger
private final PersistenceContext.NaturalIdHelper
private NaturalIdXrefDelegate
private ArrayList<PersistentCollection>
private HashSet<AssociationKey>
private HashSet<EntityKey>
private IdentityHashMap<Object, Object>
private ConcurrentReferenceHashMap<EntityKey, Object>
private int
private SharedSessionContractImplementor
private HashMap<CollectionKey, PersistentCollection>

Constructor Summary

AccessConstructor and Description
public
StatefulPersistenceContext(SharedSessionContractImplementor
The session "owning" this context.
session
)

Constructs a PersistentContext, bound to the given session.

Method Summary

Modifier and TypeMethod and Description
public void
addChildParent(Object
The child of the relationship
child
,
Object
The parent of the relationship
parent
)

Implements org.hibernate.engine.spi.PersistenceContext.addChildParent.

Add a child/parent relation to cache for cascading op
private void
addCollection(PersistentCollection
The collection for which we are adding an entry.
coll
,
CollectionEntry
The entry representing the collection.
entry
,
Serializable
The key of the collection's entry.
key
)

Add a collection to the cache, with a given collection entry.

private void
addCollection(PersistentCollection
The collection for which we are adding an entry.
collection
,
CollectionPersister
The collection persister
persister
)

Add a collection to the cache, creating a new collection entry for it

public PersistentCollection
addCollectionByKey(CollectionKey collectionKey, PersistentCollection persistentCollection)

Implements org.hibernate.engine.spi.PersistenceContext.addCollectionByKey.

Adds a collection in the collections-by-key map.
public void
addCollectionHolder(PersistentCollection holder)

Implements org.hibernate.engine.spi.PersistenceContext.addCollectionHolder.

Register a PersistentCollection object for an array.
public void
public void
addEntity(EntityKey
The key under which to add an entity
key
,
Object
The entity instance to add
entity
)

Implements org.hibernate.engine.spi.PersistenceContext.addEntity.

Add a canonical mapping from entity key to entity instance
public void
addEntity(EntityUniqueKey
The unique (non-primary) key under which to add an entity
euk
,
Object
The entity instance
entity
)

Implements org.hibernate.engine.spi.PersistenceContext.addEntity.

Add an entity to the cache by unique key
public EntityEntry
addEntity(final Object entity, final Status status, final Object[] loadedState, final EntityKey entityKey, final Object version, final LockMode lockMode, final boolean existsInDatabase, final EntityPersister persister, final boolean disableVersionIncrement)

Implements org.hibernate.engine.spi.PersistenceContext.addEntity.

Adds an entity to the internal caches.
public EntityEntry
addEntry(final Object entity, final Status status, final Object[] loadedState, final Object rowId, final Serializable id, final Object version, final LockMode lockMode, final boolean existsInDatabase, final EntityPersister persister, final boolean disableVersionIncrement)

Implements org.hibernate.engine.spi.PersistenceContext.addEntry.

Generates an appropriate EntityEntry instance and adds it to the event source's internal caches.
public CollectionEntry
addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id)

Implements org.hibernate.engine.spi.PersistenceContext.addInitializedCollection.

add a collection we just pulled out of the cache (does not need initializing)
public void
addInitializedDetachedCollection(CollectionPersister collectionPersister, PersistentCollection collection)

Implements org.hibernate.engine.spi.PersistenceContext.addInitializedDetachedCollection.

add an (initialized) collection that was created by another session and passed into update() (ie.
public void
addNewCollection(CollectionPersister persister, PersistentCollection
The collection to be associated with the persistence context
collection
)

Implements org.hibernate.engine.spi.PersistenceContext.addNewCollection.

Add a new collection (ie.
public void
addNonLazyCollection(PersistentCollection collection)

Implements org.hibernate.engine.spi.PersistenceContext.addNonLazyCollection.

Register a collection for non-lazy loading at the end of the two-phase load
public void
addNullProperty(EntityKey ownerKey, String propertyName)

Implements org.hibernate.engine.spi.PersistenceContext.addNullProperty.

Record the fact that the association belonging to the keyed entity is null.
public void
addProxy(EntityKey key, Object proxy)

Implements org.hibernate.engine.spi.PersistenceContext.addProxy.

Add a proxy to the session cache
public EntityEntry
addReferenceEntry(final Object entity, final Status status)

public void
addUninitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id)

Implements org.hibernate.engine.spi.PersistenceContext.addUninitializedCollection.

add a collection we just loaded up (still needs initializing)
public void
public void
addUnownedCollection(CollectionKey
The collection key under which to add the collection
key
,
PersistentCollection
The collection to add
collection
)

Implements org.hibernate.engine.spi.PersistenceContext.addUnownedCollection.

Add a collection which has no owner loaded
public void
afterLoad()

Implements org.hibernate.engine.spi.PersistenceContext.afterLoad.

Call this after finishing a two-phase load
public void
public void
beforeLoad()

Implements org.hibernate.engine.spi.PersistenceContext.beforeLoad.

Call this before beginning a two-phase load
public void
public void
checkUniqueness(EntityKey key, Object
The entity reference against which to perform the uniqueness check.
object
)

Implements org.hibernate.engine.spi.PersistenceContext.checkUniqueness.

Attempts to check whether the given key represents an entity already loaded within the current session.
private void
public void
clear()

Implements org.hibernate.engine.spi.PersistenceContext.clear.

Clear the state of the persistence context
public void
clearCollectionsByKey()

Implements org.hibernate.engine.spi.PersistenceContext.clearCollectionsByKey.

Remove all state of the collections-by-key map.
private void
public boolean
containsCollection(PersistentCollection collection)

Implements org.hibernate.engine.spi.PersistenceContext.containsCollection.

Is the given collection associated with this persistence context?
public boolean
containsEntity(EntityKey
The key under which to look for an entity
key
)

Implements org.hibernate.engine.spi.PersistenceContext.containsEntity.

Is there an entity with the given key in the persistence context
public boolean
containsNullifiableEntityKey(Supplier<EntityKey>
a supplier for the EntityKey; this allows to not always needing to create the key; for example if the map is known to be empty there is no need to create one to check.
sek
)

Implements org.hibernate.engine.spi.PersistenceContext.containsNullifiableEntityKey.

Checks if a certain EntityKey was registered as nullifiable on this PersistenceContext.
public boolean
containsProxy(Object entity)

Implements org.hibernate.engine.spi.PersistenceContext.containsProxy.

Is the given proxy associated with this persistence context?
public int
public static StatefulPersistenceContext

Returns:

The deserialized StatefulPersistenceContext
deserialize
(ObjectInputStream
The stream from which the persistence context should be read
ois
,
SessionImplementor
The owning session
session
)

Deprecated as a consequence of SessionImplementor being deprecated.
Used by the owning session to explicitly control deserialization of the persistence context.
public void
public void
forEachCollectionEntry(BiConsumer<PersistentCollection, CollectionEntry>
the lambda to apply on each PersistentCollection,CollectionEntry map entry of the PersistenceContext.
action
,
boolean
set this to false for improved efficiency, but that would make it illegal to make changes to the underlying collectionEntries map.
concurrent
)

Implements org.hibernate.engine.spi.PersistenceContext.forEachCollectionEntry.

Execute some action on each entry of the collectionEntries map, optionally iterating on a defensive copy.
public BatchFetchQueue
public Object[]
getCachedDatabaseSnapshot(EntityKey
The entity key for which to retrieve the cached snapshot
key
)

Implements org.hibernate.engine.spi.PersistenceContext.getCachedDatabaseSnapshot.

Retrieve the cached database snapshot for the requested entity key.
public int
public PersistentCollection
getCollection(CollectionKey collectionKey)

Implements org.hibernate.engine.spi.PersistenceContext.getCollection.

Get the collection instance associated with the CollectionKey
public Map<K, V>

Returns:

the map of managed collection entries.
getCollectionEntries
()

Implements org.hibernate.engine.spi.PersistenceContext.getCollectionEntries.

Deprecated We should not expose this directly: the other accessors that have been created as a replacement have better chances of skipping initializing this map, which is a good performance improvement.
Get the mapping from collection instance to collection entry
public int
getCollectionEntriesSize()

Implements org.hibernate.engine.spi.PersistenceContext.getCollectionEntriesSize.

The size of the internal map storing all collection entries.
public CollectionEntry
getCollectionEntry(PersistentCollection
The persistent collection instance for which to locate the collection entry
coll
)

Implements org.hibernate.engine.spi.PersistenceContext.getCollectionEntry.

Get the collection entry for a persistent collection
public CollectionEntry
getCollectionEntryOrNull(Object collection)

Implements org.hibernate.engine.spi.PersistenceContext.getCollectionEntryOrNull.

Get the collection entry for a collection passed to filter, which might be a collection wrapper, an array, or an unwrapped collection.
public PersistentCollection
getCollectionHolder(Object array)

Implements org.hibernate.engine.spi.PersistenceContext.getCollectionHolder.

Get the PersistentCollection object for an array
public Object
getCollectionOwner(Serializable key, CollectionPersister collectionPersister)

Implements org.hibernate.engine.spi.PersistenceContext.getCollectionOwner.

Get the entity that owns this persistent collection
public Map<K, V>
getCollectionsByKey()

Implements org.hibernate.engine.spi.PersistenceContext.getCollectionsByKey.

Get the mapping from collection key to collection instance
public Object[]
getDatabaseSnapshot(Serializable
The identifier of the entity for which to grab a snapshot
id
,
EntityPersister
The persister of the entity.
persister
)

Implements org.hibernate.engine.spi.PersistenceContext.getDatabaseSnapshot.

Get the current state of the entity as known to the underlying database, or null if there is no corresponding row

Get the current state of the entity as known to the underlying database, or null if there is no corresponding row

public Map<K, V>
getEntitiesByKey()

Implements org.hibernate.engine.spi.PersistenceContext.getEntitiesByKey.

Deprecated this will be removed: it provides too wide access, making it hard to optimise the internals for specific access needs. Consider using #iterateEntities instead.
Get the mapping from key value to entity instance
public Object
getEntity(EntityKey
The key under which to look for an entity
key
)

Implements org.hibernate.engine.spi.PersistenceContext.getEntity.

Get the entity instance associated with the given key
public Object
getEntity(EntityUniqueKey
The unique (non-primary) key under which to look for an entity
euk
)

Implements org.hibernate.engine.spi.PersistenceContext.getEntity.

Get an entity cached by unique key
public Map<K, V>
getEntityEntries()

Implements org.hibernate.engine.spi.PersistenceContext.getEntityEntries.

Get the mapping from entity instance to entity entry
public EntityEntry
getEntry(Object
The entity instance for which to locate the corresponding entry
entity
)

Implements org.hibernate.engine.spi.PersistenceContext.getEntry.

Retrieve the EntityEntry representation of the given entity.
public Object
getIndexInOwner(String entity, String property, Object childEntity, Map<K, V> mergeMap)

Implements org.hibernate.engine.spi.PersistenceContext.getIndexInOwner.

Search the persistence context for an index of the child object, given a collection role
private Object
getIndexInParent(String property, Object childEntity, EntityPersister persister, CollectionPersister collectionPersister, Object potentialParent)

public LoadContexts
getLoadContexts()

Implements org.hibernate.engine.spi.PersistenceContext.getLoadContexts.

Retrieve this persistence context's managed load context.
public Serializable
getLoadedCollectionOwnerIdOrNull(PersistentCollection
The persistent collection
collection
)

Implements org.hibernate.engine.spi.PersistenceContext.getLoadedCollectionOwnerIdOrNull.

Get the ID for the entity that owned this persistent collection when it was loaded
private Serializable

Returns:

the owner ID if available from the collection's loaded key; otherwise, returns null
getLoadedCollectionOwnerIdOrNull
(CollectionEntry
The collection entry
ce
)

Get the ID for the entity that owned this persistent collection when it was loaded

public Object
getLoadedCollectionOwnerOrNull(PersistentCollection
The persistent collection
collection
)

Implements org.hibernate.engine.spi.PersistenceContext.getLoadedCollectionOwnerOrNull.

Get the entity that owned this persistent collection when it was loaded
public PersistenceContext.NaturalIdHelper
getNaturalIdHelper()

Implements org.hibernate.engine.spi.PersistenceContext.getNaturalIdHelper.

Access to the natural-id helper for this persistence context
public Object[]
getNaturalIdSnapshot(Serializable
The identifier of the entity for which to grab a snapshot
id
,
EntityPersister
The persister of the entity.
persister
)

Implements org.hibernate.engine.spi.PersistenceContext.getNaturalIdSnapshot.

Get the values of the natural id fields as known to the underlying database, or null if the entity has no natural id or there is no corresponding row.
private Object[]
private NaturalIdXrefDelegate
public HashSet<E>
getNullifiableEntityKeys()

Implements org.hibernate.engine.spi.PersistenceContext.getNullifiableEntityKeys.

Retrieve the set of EntityKeys representing nullifiable references
public int
private IdentityMap<PersistentCollection, CollectionEntry>
private ConcurrentMap<EntityKey, Object>
public Serializable
getOwnerId(String
The entity name for the entity type which would own the child
entityName
,
String
The name of the property on the owning entity type which would name this child association.
propertyName
,
Object
The child entity instance for which to locate the owner instance id.
childEntity
,
Map<K, V>
A map of non-persistent instances from an on-going merge operation (possibly null).
mergeMap
)

Implements org.hibernate.engine.spi.PersistenceContext.getOwnerId.

Search this persistence context for an associated entity instance which is considered the "owner" of the given childEntity, and return that owner's id value.
private Object
public Object
getProxy(EntityKey key)

Implements org.hibernate.engine.spi.PersistenceContext.getProxy.

Get an existing proxy by key
public SharedSessionContractImplementor
getSession()

Implements org.hibernate.engine.spi.PersistenceContext.getSession.

Get the session to which this persistence context is bound.
public Serializable
getSnapshot(PersistentCollection coll)

Implements org.hibernate.engine.spi.PersistenceContext.getSnapshot.

Get the snapshot of the pre-flush collection state
public boolean
public int
public void
initializeNonLazyCollections()

Implements org.hibernate.engine.spi.PersistenceContext.initializeNonLazyCollections.

Force initialization of all non-lazy collections encountered during the current two-phase load (actually, this is a no-op, unless this is the "outermost" load)
protected void
public boolean
isDefaultReadOnly()

Implements org.hibernate.engine.spi.PersistenceContext.isDefaultReadOnly.

Will entities and proxies that are loaded into this persistence context be made read-only by default?
public boolean
isEntryFor(Object
The entity instance for which to check for an entry
entity
)

Implements org.hibernate.engine.spi.PersistenceContext.isEntryFor.

Is there an EntityEntry registration for this entity instance?
public boolean
isFlushing()

Implements org.hibernate.engine.spi.PersistenceContext.isFlushing.

Is a flush cycle currently in process?
private boolean
isFoundInParent(String property, Object childEntity, EntityPersister persister, CollectionPersister collectionPersister, Object potentialParent)

public boolean
public boolean
public boolean
isPropertyNull(EntityKey ownerKey, String propertyName)

Implements org.hibernate.engine.spi.PersistenceContext.isPropertyNull.

Is the association property belonging to the keyed entity null?
public boolean
isReadOnly(Object
an entity or proxy
entityOrProxy
)

Implements org.hibernate.engine.spi.PersistenceContext.isReadOnly.

Is the entity or proxy read-only?
public boolean
public boolean
private EntityPersister
public Iterator<E>
managedEntitiesIterator()

Implements org.hibernate.engine.spi.PersistenceContext.managedEntitiesIterator.

A read-only iterator on all entities managed by this persistence context
public Object
narrowProxy(Object
The proxy instance to be narrowed.
proxy
,
EntityPersister
The persister for the proxied entity.
persister
,
EntityKey
The internal cache key for the proxied entity.
key
,
Object
(optional) the actual proxied entity instance.
object
)

Implements org.hibernate.engine.spi.PersistenceContext.narrowProxy.

If the existing proxy is insufficiently "narrow" (derived), instantiate a new proxy and overwrite the registration of the old one.
public Object
proxyFor(EntityPersister persister, EntityKey key, Object impl)

Implements org.hibernate.engine.spi.PersistenceContext.proxyFor.

Return the existing proxy associated with the given EntityKey, or the third argument (the entity associated with the key) if no proxy exists.
public Object
proxyFor(Object impl)

Implements org.hibernate.engine.spi.PersistenceContext.proxyFor.

Return the existing proxy associated with the given EntityKey, or the argument (the entity associated with the key) if no proxy exists.
public boolean
reassociateIfUninitializedProxy(Object
The possible proxy to be reassociated.
value
)

Implements org.hibernate.engine.spi.PersistenceContext.reassociateIfUninitializedProxy.

Takes the given object and, if it represents a proxy, reassociates it with this event source.
public void
reassociateProxy(Object value, Serializable id)

Implements org.hibernate.engine.spi.PersistenceContext.reassociateProxy.

If a deleted entity instance is re-saved, and it has a proxy, we need to reset the identifier of the proxy
private void
reassociateProxy(LazyInitializer
The proxy initializer.
li
,
HibernateProxy
The proxy to reassociate.
proxy
)

Associate a proxy that was instantiated by another session with this session

public Map.Entry<Object, EntityEntry>[]
reentrantSafeEntityEntries()

Implements org.hibernate.engine.spi.PersistenceContext.reentrantSafeEntityEntries.

Provides access to the entity/EntityEntry combos associated with the persistence context in a manner that is safe from reentrant access.
public void
registerInsertedKey(EntityPersister
The entity persister
persister
,
Serializable
The id
id
)

Implements org.hibernate.engine.spi.PersistenceContext.registerInsertedKey.

Register keys inserted during the current transaction
public void
public void
removeChildParent(Object
The child to be removed.
child
)

Implements org.hibernate.engine.spi.PersistenceContext.removeChildParent.

Remove child/parent relation from cache
public void
removeCollectionByKey(CollectionKey
the key to clear
collectionKey
)

Implements org.hibernate.engine.spi.PersistenceContext.removeCollectionByKey.

Remove a collection-by-key mapping.
public CollectionEntry
public PersistentCollection
removeCollectionHolder(Object array)

Implements org.hibernate.engine.spi.PersistenceContext.removeCollectionHolder.

Remove the mapping of collection to holder during eviction of the owning entity
public Object
removeEntity(EntityKey
The key whose matching entity should be removed
key
)

Implements org.hibernate.engine.spi.PersistenceContext.removeEntity.

Remove an entity.
public EntityEntry
removeEntry(Object
The entity instance for which to remove the corresponding entry
entity
)

Implements org.hibernate.engine.spi.PersistenceContext.removeEntry.

Remove an entity entry from the session cache
public Object
removeProxy(EntityKey
The key of the entity proxy to be removed
key
)

Implements org.hibernate.engine.spi.PersistenceContext.removeProxy.

Remove a proxy from the session cache.
private Object
public void
public void
serialize(ObjectOutputStream
The stream to which the persistence context should get written
oos
)

Used by the owning session to explicitly control serialization of the persistence context.

public void
setDefaultReadOnly(boolean
true, the default for loaded entities/proxies is read-only; false, the default for loaded entities/proxies is modifiable
defaultReadOnly
)

Implements org.hibernate.engine.spi.PersistenceContext.setDefaultReadOnly.

Change the default for entities and proxies loaded into this persistence context from modifiable to read-only mode, or from modifiable to read-only mode.
private void
setEntityReadOnly(Object entity, boolean readOnly)

public void
setEntryStatus(EntityEntry
The entry for which to set the status
entry
,
Status
The new status
status
)

Implements org.hibernate.engine.spi.PersistenceContext.setEntryStatus.

Set the status of an entry
public void
setFlushing(boolean flushing)

Implements org.hibernate.engine.spi.PersistenceContext.setFlushing.

Called before and after the flush cycle
private void
private void
setProxyReadOnly(HibernateProxy proxy, boolean readOnly)

public void
setReadOnly(Object
an entity or proxy
object
,
boolean
if true, the entity or proxy is made read-only; otherwise, the entity or proxy is made modifiable.
readOnly
)

Implements org.hibernate.engine.spi.PersistenceContext.setReadOnly.

Set an unmodified persistent object to read-only mode, or a read-only object to modifiable mode.
public String
toString()

Overrides java.lang.Object.toString.

Implements org.hibernate.engine.spi.PersistenceContext.toString.

Returns a string representation of the object.
public Object
unproxy(Object maybeProxy)

Implements org.hibernate.engine.spi.PersistenceContext.unproxy.

Get the entity instance underlying the given proxy, throwing an exception if the proxy is uninitialized.
public Object
unproxyAndReassociate(Object
The reference to be unproxied if it currently represents a proxy.
maybeProxy
)

Implements org.hibernate.engine.spi.PersistenceContext.unproxyAndReassociate.

Possibly unproxy the given reference and reassociate it with the current session.
private static void
unsetSession(PersistentAttributeInterceptable persistentAttributeInterceptable, Object ignoredParam)

public PersistentCollection
useUnownedCollection(CollectionKey
The collection key for which to locate a collection collection
key
)

Implements org.hibernate.engine.spi.PersistenceContext.useUnownedCollection.

Take ownership of a previously unowned collection, if one.
public boolean
wasInsertedDuringTransaction(EntityPersister
The entity persister
persister
,
Serializable
The id
id
)

Implements org.hibernate.engine.spi.PersistenceContext.wasInsertedDuringTransaction.

Allows callers to check to see if the identified entity was inserted during the current transaction.
private <E> void
private <K, V> void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait