Package org.apache.tapestry5.internal.services

# Interface ComponentDependencyRegistry

All Known Implementing Classes:
  `ComponentDependencyRegistryImpl`

public interface ComponentDependencyRegistry
Internal service that registers direct dependencies between components (including components, pages and base classes). Even though methods receive `ComponentPageElement` parameters, dependencies are tracked using their fully qualified classs names.

Since:
  5.8.3

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static enum`
  `ComponentDependencyRegistry.DependencyType`
  Enum class defining the types of dependency components, pages and mixins can have among them.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `FILENAME`
  Default file where the dependency information is stored between webapp runs.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  Clears all dependency information.
  `void`
  `clear(String className)`
  Clears all dependency information for a given component.
  `void`
  `clear(ComponentPageElement componentPageElement)`
  Clears all dependency information for a given component.
  `boolean`
  `contains(String className)`
  Tells whether this registry already contans a given class name.
  `void`
  `disableInvalidations()`
  Tells this service to ignore invalidations in this thread.
  `void`
  `enableInvalidations()`
  Tells this service to stop ignoring invalidations in this thread.
  `Set<String>`
  `getAllNonPageDependencies(String className)`
  Returns all dependencies of a given class, direct and indirect.
  `Set<String>`
  `getClassNames()`
  Returns the set of all class names in the registry.
  `Set<String>`
  `getDependencies(String className, ComponentDependencyRegistry.DependencyType type)`
  Returns the fully qualified names of the direct dependencies of a given component and a given dependency type.
  `Set<String>`
  `getDependents(String className)`
  Returns the fully qualified names of the direct dependencies of a given component.
  `Set<String>`
  `getRootClasses()`
  Returns the set of all root classes (i.e.
  `boolean`
  `isStoredDependencyInformationPresent()`
  Returns whether stored dependency information is present.
  `void`
  `listen(InvalidationEventHub invalidationEventHub)`
  Signs up this registry to invalidation events from a given hub.
  `void`
  `register(Class<?> clasz)`
  Register all the dependencies of a given class.
  `void`
  `register(Class<?> clasz, ClassLoader classLoader)`
  Register all the dependencies of a given class and uses a given classloader to load other classes if needed.
  `void`
  `register(ComponentPageElement componentPageElement)`
  Register all the dependencies of a given component.
  `void`
  `register(PlasticField plasticField, MutableComponentModel componentModel)`
  Register a dependency of a component class with another through annotations such as `InjectPage`, `InjectComponent` and `Component`.
  `void`
  `writeFile()`
  Writes the current component dependency data to a file so it can be reused in a new run later.

- ## Field Details

  - ### FILENAME

    static final String FILENAME
    Default file where the dependency information is stored between webapp runs.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### register

    void register(Class<?> clasz)
    Register all the dependencies of a given class.

  - ### register

    void register(Class<?> clasz, ClassLoader classLoader)
    Register all the dependencies of a given class and uses a given classloader to load other classes if needed.
    Since:
      5.8.7

  - ### register

    void register(ComponentPageElement componentPageElement)
    Register all the dependencies of a given component.

  - ### register

    void register(PlasticField plasticField, MutableComponentModel componentModel)
    Register a dependency of a component class with another through annotations such as `InjectPage`, `InjectComponent` and `Component`.

  - ### clear

    void clear(String className)
    Clears all dependency information for a given component.

  - ### clear

    void clear(ComponentPageElement componentPageElement)
    Clears all dependency information for a given component.

  - ### clear

    void clear()
    Clears all dependency information.

  - ### getDependents

    Set<String> getDependents(String className)
    Returns the fully qualified names of the direct dependencies of a given component.

  - ### getDependencies

    Set<String> getDependencies(String className, ComponentDependencyRegistry.DependencyType type)
    Returns the fully qualified names of the direct dependencies of a given component and a given dependency type.
    See Also:
      - `ComponentDependencyRegistry.DependencyType`

  - ### getAllNonPageDependencies

    Set<String> getAllNonPageDependencies(String className)
    Returns all dependencies of a given class, direct and indirect.
    Parameters:
      `className` - a class name.

  - ### listen

    void listen(InvalidationEventHub invalidationEventHub)
    Signs up this registry to invalidation events from a given hub.

  - ### writeFile

    void writeFile()
    Writes the current component dependency data to a file so it can be reused in a new run later.
    See Also:
      - `FILENAME`

  - ### contains

    boolean contains(String className)
    Tells whether this registry already contans a given class name.

  - ### getClassNames

    Set<String> getClassNames()
    Returns the set of all class names in the registry.

  - ### getRootClasses

    Set<String> getRootClasses()
    Returns the set of all root classes (i.e. ones with no dependencies).

  - ### isStoredDependencyInformationPresent

    boolean isStoredDependencyInformationPresent()
    Returns whether stored dependency information is present.

  - ### disableInvalidations

    void disableInvalidations()
    Tells this service to ignore invalidations in this thread.

  - ### enableInvalidations

    void enableInvalidations()
    Tells this service to stop ignoring invalidations in this thread.