[SPARK-3543] Write TaskContext in Java and expose it through a static accessor.

if the parameter is defined in java it cannot be named