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

public Class ExecutableList<E extends org.hibernate.action.spi.Executable & java.lang.Comparable<T> & java.io.Serializable>

extends Object
implements Serializable, Iterable<E extends Executable & Comparable<T> & Serializable>, Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable, java.lang.Iterable
Annotations
@SuppressWarnings:rawtypes
Type Parameters
<E>
Intersection type describing Executable implementations
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, .Serializable, java.util.ArrayList, .Collections, .HashSet, .Iterator, .List, .Set, org.hibernate.action.spi.Executable, org.hibernate.internal.util.collections.CollectionHelper

Specialized encapsulating of the state pertaining to each Executable list.

Manages sorting the executables (lazily)

Manages the querySpaces affected by the executables in the list, and caches this too.

Authors
Steve Ebersole, Anton Marsden

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ExecutableList.Sorter<E extends Executable>

Provides a sorting interface for ExecutableList.

Field Summary

Modifier and TypeField and Description
private final ArrayList<E>
public static final int
private transient 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 ExecutableList.Sorter<E>

Constructor Summary

AccessConstructor and Description
public
ExecutableList()

Creates a new ExecutableList with the default settings.

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

Creates a new ExecutableList with the specified initialCapacity.

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 ExecutableList using the specified 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 ExecutableList with the specified initialCapacity 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(SessionImplementor
The session to which to associate the Executables
session
)

Deprecated as a consequence of SessionImplementor being deprecated.
Allow the Executables to re-associate 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 de-serialization
public E

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 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 ExecutableList.Sorter<E> sorter

Constructor Detail

ExecutableListback to summary
public ExecutableList()

Creates a new ExecutableList with the default settings.

ExecutableListback to summary
public ExecutableList(int initialCapacity)

Creates a new ExecutableList with the specified initialCapacity.

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 ExecutableList using the specified 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 ExecutableList with the specified initialCapacity 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(SessionImplementor session)

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

Allow the Executables to re-associate themselves with the Session after deserialization.

Parameters
session:SessionImplementor

The session to 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 de-serialization

Parameters
in:ObjectInput

The stream from which to read our serial state

Annotations
@Override
@SuppressWarnings:unchecked
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 E remove(int index)

Removes the entry at position index in the list.

Parameters
index:int

The index of the element to remove

Returns:E

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.

Annotations
@SuppressWarnings:unchecked
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<E extends org.hibernate.action.spi.Executable>

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<E> l)

Sorts the list.

Method Detail

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

Sorts the list.