private class DynamicTablesHelper.Context extends java.lang.Object implements Finalizable
TODO: currently, the cleanup code is based on an incorrect assumption that the context's state is reset more frequently than it actually is, AND, in some cases, we are cleaning up resources prematurely, causing persistence errors when detached objects in an old Hibernate session are reattached to a new one. The temporary workaround for this is a high cache limit, to prevent the cache from expiring elements.
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.Class<? extends DataModelObject>,DynamicTablesHelper.DMOInfo> |
dmoMap
Map of DMO interfaces to DMO information objects
|
private java.util.Map<java.lang.Class<?>,java.util.Set<TempTableBuilder>> |
dmoUsers
Map of DMO interfaces to sets of users of these interfaces
|
private java.util.List<TempTableBuilder> |
finishedBuilders
Temp-table builders which are no longer in use in this context
|
| Modifier | Constructor and Description |
|---|---|
private |
Context()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
cleanup()
Clean up DMO resources no longer needed by temp-table builders in this context.
|
void |
deleted()
No-op.
|
void |
finished()
Clean up local context - drop tables and DMO definitions.
|
private DynamicTablesHelper.DMOInfo |
getDMOInfo(java.lang.Class<? extends DataModelObject> dmoIface)
Get the DMO information object associated with the given DMO interface.
|
void |
iterate()
No-op.
|
private void |
registerBuilder(TempTableBuilder builder)
Register a dynamic temp-table builder in this context.
|
private boolean |
registerDMOInfo(java.lang.Class<? extends DataModelObject> dmoIface,
DynamicTablesHelper.DMOInfo dmoInfo)
Associate a DMO information object with the given DMO interface.
|
void |
retry()
No-op.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitentry, initFailure, weightprivate final java.util.Map<java.lang.Class<?>,java.util.Set<TempTableBuilder>> dmoUsers
private final java.util.Map<java.lang.Class<? extends DataModelObject>,DynamicTablesHelper.DMOInfo> dmoMap
private java.util.List<TempTableBuilder> finishedBuilders
private Context()
public void finished()
finished in interface Finalizablepublic void deleted()
deleted in interface Finalizablepublic void iterate()
iterate in interface Finalizablepublic void retry()
retry in interface Finalizableprivate void cleanup()
private void registerBuilder(TempTableBuilder builder)
builder - Temp-table builder to be registered.private DynamicTablesHelper.DMOInfo getDMOInfo(java.lang.Class<? extends DataModelObject> dmoIface)
dmoIface - DMO interface.private boolean registerDMOInfo(java.lang.Class<? extends DataModelObject> dmoIface, DynamicTablesHelper.DMOInfo dmoInfo)
dmoIface - DMO interface.dmoInfo - DMO information object.true if dmoIface was not already associated with a
different object, else false.