See, if the following code can help you
Code:
public static void hand(String[] args) (
System.out.System.out.println("starting HAND "); Timer t = new Timer(); cshu(new TimerTask() (
int i = 0;
public void run() (
System.out.System.out.println("No timer exec:" + i + +);
)
), 0, 3000); callMyService(); System.out.System.out.println("end MAIN"); tcn();
)
private static void callMyService() (
System.out.System.out.println("START blocking call");
try (
Thread.currentThread().Sleep(7000); System.out.System.out.println("END blocking call");
) Catch (InterruptedException e) (
System.out.System.out.println("blocking call interrupted");
)
)
)
Bookmarks