class CustomDataSourceContextStrategy implements
        ContextManagementStrategy<ClientCustomDataSource, ClientCustomDataSource>,
        GenericTypeMetadataBuilder<ClientCustomDataSource>,
        ContextParametrizedMetadataBuilder<ClientCustomDataSource, PartialMetadataOptions> {

    @Override
    public Object build(ClientCustomDataSource context, Map<String, String[]> options, Map<String, Object> contextData) {
        Object result;
        try {
            // custom data source metadata is supported for those custom data sources, that are implemented in a
            // JDBC like way (via TEIID). So, just delegating and handle exceptions in specific way
            result = jdbcDataSourceMetadataBuilder.build(context, options, contextData);
        } catch (UnsupportedDataSourceException e) {
            throw e;
        } catch (Exception e) {
            throw new ErrorDescriptorException(e, secureExceptionHandler);
        }
        return result;
    }

}