Code example for ScheduledFuture

Methods: cancel

0
		final ScheduledFuture beeperHandle2 = scheduler.scheduleWithFixedDelay(
				beeper, 2, 5, SECONDS);
		// 30Ãëºó½áÊø¹Ø±ÕÈÎÎñ£¬²¢ÇҹرÕScheduler 
		scheduler.schedule(new Runnable() {
			public void run() { 
				beeperHandle.cancel(true);
				beeperHandle2.cancel(true);
				scheduler.shutdown();
			} 
		}, 30, SECONDS);
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE