}
@Override
public void initialize( UrlRewriteEnvironment environment, HostmapFunctionDescriptor descriptor ) throws Exception {
URL url = environment.getResource( DESCRIPTOR_DEFAULT_LOCATION );
hostMapper = new FileBasedHostMapper( url );
clusterName = environment.getAttribute( GatewayServices.GATEWAY_CLUSTER_ATTRIBUTE );
GatewayServices services = environment.getAttribute( GatewayServices.GATEWAY_SERVICES_ATTRIBUTE );
if( clusterName != null && services != null ) {
hostMapperService = services.getService( GatewayServices.HOST_MAPPING_SERVICE );
if( hostMapperService != null ) {