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 receiveComponentPageElement
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 class
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 java.lang.String
FILENAME
Default file where the dependency information is stored between webapp runs.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Clears all dependency information.void
clear(java.lang.String className)
Clears all dependency information for a given component.void
clear(ComponentPageElement componentPageElement)
Clears all dependency information for a given component.boolean
contains(java.lang.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.java.util.Set<java.lang.String>
getAllNonPageDependencies(java.lang.String className)
Returns all dependencies of a given class, direct and indirect.java.util.Set<java.lang.String>
getClassNames()
Returns the set of all class names in the registry.java.util.Set<java.lang.String>
getDependencies(java.lang.String className, ComponentDependencyRegistry.DependencyType type)
Returns the fully qualified names of the direct dependencies of a given component and a given dependency type.java.util.Set<java.lang.String>
getDependents(java.lang.String className)
Returns the fully qualified names of the direct dependencies of a given component.java.util.Set<java.lang.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(java.lang.Class<?> clasz)
Register all the dependencies of a given class.void
register(java.lang.Class<?> clasz, java.lang.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 asInjectPage
,InjectComponent
andComponent
.void
writeFile()
Writes the current component dependency data to a file so it can be reused in a new run later.
-
-
-
Field Detail
-
FILENAME
static final java.lang.String FILENAME
Default file where the dependency information is stored between webapp runs.- See Also:
- Constant Field Values
-
-
Method Detail
-
register
void register(java.lang.Class<?> clasz)
Register all the dependencies of a given class.
-
register
void register(java.lang.Class<?> clasz, java.lang.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 asInjectPage
,InjectComponent
andComponent
.
-
clear
void clear(java.lang.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
java.util.Set<java.lang.String> getDependents(java.lang.String className)
Returns the fully qualified names of the direct dependencies of a given component.
-
getDependencies
java.util.Set<java.lang.String> getDependencies(java.lang.String className, ComponentDependencyRegistry.DependencyType type)
Returns the fully qualified names of the direct dependencies of a given component and a given dependency type.
-
getAllNonPageDependencies
java.util.Set<java.lang.String> getAllNonPageDependencies(java.lang.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(java.lang.String className)
Tells whether this registry already contans a given class name.
-
getClassNames
java.util.Set<java.lang.String> getClassNames()
Returns the set of all class names in the registry.
-
getRootClasses
java.util.Set<java.lang.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.
-
-