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

public Class ExecutableList<E extends org.hibernate.engine.spi.ComparableExecutable>

extends Object
implements Serializable, Iterable<E extends ComparableExecutable>, Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable, java.lang.Iterable
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, .Serializable, java.util.ArrayList, .Collections, .HashSet, .Iterator, .List, .Set, org.hibernate.action.spi.Executable, org.hibernate.event.spi.EventSource, org.hibernate.internal.util.collections.CollectionHelper, org.checkerframework.checker.nullness.qual.Nullable

A list of executeble actions. Responsible for sorting the executables, and calculating the affected query spaces.
Authors
Steve Ebersole, Anton Marsden

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ExecutableList.Sorter<ComparableExecutable>

Provides a sorting interface for ExecutableList.

Field Summary

Modifier and TypeField and Description
private final ArrayList<E>
public static final int
private transient @Nullable Set<Serializable>
querySpaces

Used to hold the query spaces (table names, roughly) that all the Executable instances contained in this list define.

private final boolean
private boolean
private final @Nullable ExecutableList.Sorter<E>

Constructor Summary

AccessConstructor and Description
public
ExecutableList()

Creates a new instance with the default settings.

public
ExecutableList(int
The initial capacity for instantiating the internal List
initialCapacity
)

Creates a new instance with the given initial capacity.

public
ExecutableList(boolean requiresSorting)

public
ExecutableList(int initialCapacity, boolean requiresSorting)

public
ExecutableList(ExecutableList.Sorter<E>
The Sorter to use; may be null
sorter
)

Creates a new instance using the given Sorter.

public
ExecutableList(int
The initial capacity for instantiating the internal List
initialCapacity
,
ExecutableList.Sorter<E>
The Sorter to use; may be null
sorter
)

Creates a new instance with the given initial capacity and Sorter.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the object was added to the list
add
(E
the executable to add to the list
executable
)

Add an Executable to this list.

public void
afterDeserialize(EventSource
The session with which to associate the Executables
session
)

Allow the Executables to reassociate themselves with the session after deserialization.

public void
clear()

Clears the list of executions.

public E

Returns:

The element at specified index
get
(int
The index of the element to retrieve
index
)

public Set<Serializable>

Returns:

the querySpaces affected by the actions in this list
getQuerySpaces
()

Lazily constructs the querySpaces affected by the actions in the list.

public boolean

Returns:

true if the list is empty.
isEmpty
()

public Iterator<E>

Returns:

an unmodifiable iterator
iterator
()

Implements java.lang.Iterable.iterator.

Returns an iterator for the list.
public void
readExternal(ObjectInput
The stream from which to read our serial state
in
)

Implements java.io.Externalizable.readExternal.

Read this object state back in from the given stream as part of the deserialization process.
public ComparableExecutable

Returns:

the entry that was removed
remove
(int
The index of the element to remove
index
)

Removes the entry at position index in the list.

public void
removeLastN(int
The number of elements to remove.
n
)

Removes the last n entries from the list.

public int

Returns:

the current size of the list
size
()

public void
sort()

Sorts the list using the natural ordering or using the Sorter if it's not null.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
writeExternal(ObjectOutput
The stream to which to serialize our state
oos
)

Implements java.io.Externalizable.writeExternal.

Write this list out to the given stream as part of serialization
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

executablesback to summary
private final ArrayList<E> executables
INIT_QUEUE_LIST_SIZEback to summary
public static final int INIT_QUEUE_LIST_SIZE
querySpacesback to summary
private transient @Nullable Set<Serializable> querySpaces

Used to hold the query spaces (table names, roughly) that all the Executable instances contained in this list define. This information is ultimately used to invalidate cache regions as it is exposed from getQuerySpaces. This value being null indicates that the query spaces should be calculated.

requiresSortingback to summary
private final boolean requiresSorting
sortedback to summary
private boolean sorted
sorterback to summary
private final @Nullable ExecutableList.Sorter<E> sorter

Constructor Detail

ExecutableListback to summary
public ExecutableList()

Creates a new instance with the default settings.

ExecutableListback to summary
public ExecutableList(int initialCapacity)

Creates a new instance with the given initial capacity.

Parameters
initialCapacity:int

The initial capacity for instantiating the internal List

ExecutableListback to summary
public ExecutableList(boolean requiresSorting)
ExecutableListback to summary
public ExecutableList(int initialCapacity, boolean requiresSorting)
ExecutableListback to summary
public ExecutableList(ExecutableList.Sorter<E> sorter)

Creates a new instance using the given Sorter.

Parameters
sorter:ExecutableList.Sorter<E>

The Sorter to use; may be null

ExecutableListback to summary
public ExecutableList(int initialCapacity, ExecutableList.Sorter<E> sorter)

Creates a new instance with the given initial capacity and Sorter.

Parameters
initialCapacity:int

The initial capacity for instantiating the internal List

sorter:ExecutableList.Sorter<E>

The Sorter to use; may be null

Method Detail

addback to summary
public boolean add(E executable)

Add an Executable to this list.

Parameters
executable:E

the executable to add to the list

Returns:boolean

true if the object was added to the list

afterDeserializeback to summary
public void afterDeserialize(EventSource session)

Allow the Executables to reassociate themselves with the session after deserialization.

Parameters
session:EventSource

The session with which to associate the Executables

clearback to summary
public void clear()

Clears the list of executions.

getback to summary
public E get(int index)
Parameters
index:int

The index of the element to retrieve

Returns:E

The element at specified index

getQuerySpacesback to summary
public Set<Serializable> getQuerySpaces()

Lazily constructs the querySpaces affected by the actions in the list.

Returns:Set<Serializable>

the querySpaces affected by the actions in this list

isEmptyback to summary
public boolean isEmpty()
Returns:boolean

true if the list is empty.

iteratorback to summary
public Iterator<E> iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator for the list. Wraps the list just in case something tries to modify it.

Returns:Iterator<E>

an unmodifiable iterator

Annotations
@Override
readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Read this object state back in from the given stream as part of the deserialization process.

Parameters
in:ObjectInput

The stream from which to read our serial state

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Externalizable.readExternal.

if I/O errors occur

ClassNotFoundException:

Doc from java.io.Externalizable.readExternal.

If the class for an object being restored cannot be found.

removeback to summary
public ComparableExecutable remove(int index)

Removes the entry at position index in the list.

Parameters
index:int

The index of the element to remove

Returns:ComparableExecutable

the entry that was removed

removeLastNback to summary
public void removeLastN(int n)

Removes the last n entries from the list.

Parameters
n:int

The number of elements to remove.

sizeback to summary
public int size()
Returns:int

the current size of the list

sortback to summary
public void sort()

Sorts the list using the natural ordering or using the Sorter if it's not null.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

writeExternalback to summary
public void writeExternal(ObjectOutput oos) throws IOException

Implements java.io.Externalizable.writeExternal.

Write this list out to the given stream as part of serialization

Parameters
oos:ObjectOutput

The stream to which to serialize our state

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Externalizable.writeExternal.

Includes any I/O exceptions that may occur

org.hibernate.engine.spi back to summary

public Interface ExecutableList.Sorter<ComparableExecutable>

Known Direct Implementers
org.hibernate.engine.spi.ActionQueue.InsertActionSorter

Provides a sorting interface for ExecutableList.

Method Summary

Modifier and TypeMethod and Description
public void
sort(List<ComparableExecutable> l)

Sorts the list.

Method Detail

sortback to summary
public void sort(List<ComparableExecutable> l)

Sorts the list.