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

yes, get must be static. he's only thinking we should move the set to somewhere else