Reputation: 3824
Lets assume I've two variables ;
Future<MyCustomObj1> mytask1 = <something 1>
Future<MyCustomObj2> mytask2 = <something 2 >
I want to cancel both tasks in case of any InterruptException,
so something like
mytask1.cancel(true);
mytask2.cancel(true);
instead of repeating it everywhere, I want to create a generic method which can take the Future task as argument and just call cancel.
public void cancelTasks(<fill here>) {
<fill here>.cancel(true);
}
What should I substitute for <fill here>
?
Upvotes: 0
Views: 38