Spring Framework SchedulingAwareRunnable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework SchedulingAwareRunnable class.

This code example shows how to use the following methods:isLongLived
 
		public static Runnable buildManagedTask(Runnable task, String identityName) {
			Map<String, String> properties = new HashMap<String, String>(2);
			if (task instanceof SchedulingAwareRunnable) {
				properties.put(ManagedTask.LONGRUNNING_HINT,
						Boolean.toString(((SchedulingAwareRunnable) task).isLongLived()));
			} 
			properties.put(ManagedTask.IDENTITY_NAME, identityName);
			return ManagedExecutors.managedTask(task, properties, null);
		} 
 
		public static <T> Callable<T> buildManagedTask(Callable<T> task, String identityName) {
			Map<String, String> properties = new HashMap<String, String>(1);
			properties.put(ManagedTask.IDENTITY_NAME, identityName);
			return ManagedExecutors.managedTask(task, properties, null);
		} 
	} 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Spring Framework SchedulingAwareRunnable Methods: