Class BasicDependencyManager

java.lang.Object
org.apache.derby.impl.sql.depend.BasicDependencyManager
All Implemented Interfaces:
DependencyManager

public class BasicDependencyManager extends Object implements DependencyManager
The dependency manager tracks needs that dependents have of providers.

A dependency can be either persistent or non-persistent. Persistent dependencies are stored in the data dictionary, and non-persistent dependencies are stored within the dependency manager itself (in memory).

Synchronization: The need for synchronization is different depending on whether the dependency is an in-memory dependency or a stored dependency. When accessing and modifying in-memory dependencies, Java synchronization must be used (specifically, we synchronize on this). When accessing and modifying stored dependencies, which are stored in the data dictionary, we expect that the locking protocols will provide the synchronization needed. Note that stored dependencies should not be accessed while holding the monitor of this, as this may result in deadlocks. So far the need for synchronization across both in-memory and stored dependencies hasn't occurred.

  • Field Details

    • dd

      private final DataDictionary dd
      DataDictionary for this database.
    • dependents

      private final Map<UUID,List<Dependency>> dependents
      Map of in-memory dependencies for Dependents. In-memory means that one or both of the Dependent or Provider are non-persistent (isPersistent() returns false). Key is the UUID of the Dependent (from getObjectID()). Value is a List containing Dependency objects, each of whihc links the same Dependent to a Provider. Dependency objects in the List are unique.
    • providers

      private final Map<UUID,List<Dependency>> providers
      Map of in-memory dependencies for Providers. In-memory means that one or both of the Dependent or Provider are non-persistent (isPersistent() returns false). Key is the UUID of the Provider (from getObjectID()). Value is a List containing Dependency objects, each of which links the same Provider to a Dependent. Dependency objects in the List are unique.
    • EMPTY_PROVIDER_INFO

      private static final ProviderInfo[] EMPTY_PROVIDER_INFO
  • Constructor Details

    • BasicDependencyManager

      public BasicDependencyManager(DataDictionary dd)
  • Method Details