Class ServerPagesAppExtensionBundle.AppExtensionBuilder
- Enclosing class:
- ServerPagesAppExtensionBundle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattachAssets(String path) Add additional assets location.attachAssets(String subUrl, String path) Essentially the same asattachAssets(String), but attach classpath assets to application sub url.build()Used to delay actual configuration till runtime phase, when dropwizard configuration will be available (or, in case of complex setup, other bundles will perform all required initializations).Map view rest to sub url.
-
Constructor Details
-
AppExtensionBuilder
-
-
Method Details
-
mapViews
Map view rest to sub url. May be used to map additional rest endpoints with different prefix.Only one mapping is allowed per url (otherwise error will be thrown)! But mappings for larger sub urls are always allowed (partial override).
Normally, application configures root views mapping, but if not, then extension could register root mapping using "/" as url. Direct shortcut not provided because such usage case considered as very rare,
Use delayed configuration if dropwizard configuration object is required
delayedConfiguration(DelayedConfigurationCallback).Pay attention that additional asset locations may be required (
attachAssets(String, String), because only templates relative to view class will be correctly resolved, but direct templates may fail to resolve.- Parameters:
subUrl- sub url to map views toprefix- rest prefix to map as root views- Returns:
- builder instance for chained calls
- See Also:
-
attachAssets
Add additional assets location. Useful for adding new resources or overriding application assets.Use delayed configuration if dropwizard configuration object is required
delayedConfiguration(DelayedConfigurationCallback).- Parameters:
path- assets classpath path- Returns:
- builder instance for chained calls
- See Also:
-
attachAssets
Essentially the same asattachAssets(String), but attach classpath assets to application sub url. As with root assets, multiple packages could be attached to url. Registration order is important: in case if multiple packages contains the same file, file from the latest registered package will be used.Use delayed configuration if dropwizard configuration object is required
delayedConfiguration(DelayedConfigurationCallback).- Parameters:
subUrl- sub url to serve assets frompath- assets classpath paths- Returns:
- builder instance for chained calls
- See Also:
-
delayedConfiguration
public ServerPagesAppExtensionBundle.AppExtensionBuilder delayedConfiguration(DelayedConfigurationCallback callback) Used to delay actual configuration till runtime phase, when dropwizard configuration will be available (or, in case of complex setup, other bundles will perform all required initializations). Called after guicey initialization (when guice injector created and extensions installed).Only one callback may be registered.
WARNING: if extension bundle created with custom class loader, it will not be applied to callback configuration because callback is a low level configuration, and it supports custom class loader with an additional parameter.
- Parameters:
callback- callback for extensions configuration under run phase- Returns:
- builder instance for chained calls
-
build
- Returns:
- bundle instance
-