// Write the provider init params to the hostmap.txt file.
// Add the function to the rewrite descriptor providing the location of the hostmap.txt file.
@Override
public void contributeProvider( DeploymentContext context, Provider provider ) {
if( provider.isEnabled() ) {
UrlRewriteRulesDescriptor rules = context.getDescriptor( REWRITE_ROLE_NAME );
if( rules != null ) {
HostmapFunctionDescriptor func = rules.addFunction( HostmapFunctionDescriptor.FUNCTION_NAME );
if( func != null ) {
Asset asset = createAsset( provider );
context.getWebArchive().addAsWebInfResource(
asset, HostmapFunctionProcessor.DESCRIPTOR_DEFAULT_FILE_NAME );
func.config( HostmapFunctionProcessor.DESCRIPTOR_DEFAULT_LOCATION );