Class ModuleManagerImpl
java.lang.Object
org.apache.tapestry5.internal.services.javascript.ModuleManagerImpl
- All Implemented Interfaces:
ModuleManager
-
Constructor Summary
ConstructorsConstructorDescriptionModuleManagerImpl(ResponseCompressionAnalyzer compressionAnalyzer, AssetSource assetSource, Map<String, JavaScriptModuleConfiguration> configuration, Messages globalMessages, StreamableResourceSource streamableResourceSource, boolean compactJSON, boolean productionMode, String modulePathPrefix, PathConstructor pathConstructor) -
Method Summary
Modifier and TypeMethodDescriptionfindResourceForModule(String moduleName) Given a module name (which may be a path of names separated by slashes), locates the correspondingResource.voidsetupInvalidation(ResourceChangeTracker tracker) voidwriteConfiguration(Element body, List<ModuleConfigurationCallback> callbacks) Invoked by the internalDocumentLinkerservice to write the configuration for the module system into the page.voidwriteInitialization(Element body, List<String> libraryURLs, List<?> inits) Invoked by the internalDocumentLinkerservice to write the initializations (as perJavaScriptSupport.require(String)into the page; this occurs after the module infrastructure has been written into the page, along with the core libraries.
-
Constructor Details
-
ModuleManagerImpl
public ModuleManagerImpl(ResponseCompressionAnalyzer compressionAnalyzer, AssetSource assetSource, Map<String, JavaScriptModuleConfiguration> configuration, Messages globalMessages, StreamableResourceSource streamableResourceSource, @Symbol("tapestry.compact-json") boolean compactJSON, @Symbol("tapestry.production-mode") boolean productionMode, @Symbol("tapestry.module-path-prefix") String modulePathPrefix, PathConstructor pathConstructor)
-
-
Method Details
-
setupInvalidation
-
writeConfiguration
Description copied from interface:ModuleManagerInvoked by the internalDocumentLinkerservice to write the configuration for the module system into the page.- Specified by:
writeConfigurationin interfaceModuleManager- Parameters:
body-<body>element of the page, to which new<script>element(s) will be added.callbacks- a list ofModuleConfigurationCallbacks, which is used to customize the configuration before it is written.
-
writeInitialization
Description copied from interface:ModuleManagerInvoked by the internalDocumentLinkerservice to write the initializations (as perJavaScriptSupport.require(String)into the page; this occurs after the module infrastructure has been written into the page, along with the core libraries.- Specified by:
writeInitializationin interfaceModuleManager- Parameters:
body-<body>element of the page, to which new<script>element(s) will be added.libraryURLs- additional libraries that should be dynamically loaded before evaluating the initsinits- specify initialization on the page, based on loading modules, extacting functions from modules, and invoking those functions
-
findResourceForModule
Description copied from interface:ModuleManagerGiven a module name (which may be a path of names separated by slashes), locates the correspondingResource. First checks for contributed shim modules, then searches for possible matches among the defined library names. As a special case, the folder name "app" is mapped to the application's package.- Specified by:
findResourceForModulein interfaceModuleManager- Parameters:
moduleName- name of module to locate- Returns:
- corresponding resource, or null if not found
-