[2.7] adds deprecation notices.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Should I move this deprecation to the `LegacyExecutionContextFactory::createContext()` method instead? This is where `LegacyExecutionContext` are instantiated.