Sambhav
You dont need a listener for this.
You should be able to solve this using a timer.
You can do something like this.
1. Create a custom listener which can be used to annotate your test to indicate that a particular test needs this capability of scheduling token refresh
2. Create a custom listener that parses the custom annotation and if found it schedules a task that refreshes the token.
If the annotation route sounds complicated you can build the same thing by creating a base class ( which only your token refresh test cases will extend ) and which implements IHookable interface. Within this implementation you can add the logic
of creating and starting a timer which you can stop after the test finishes and before you exit the run() method.
Hope that helps