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

But then how would someone access it  ? I hope he wants to retain atleast the get method inside TaskContext as static.