Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*    */ package EDU.oswego.cs.dl.util.concurrent;
 /*    */ 
 /*    */ public class TimedCallable extends ThreadFactoryUser
 /*    */   implements Callable
 /*    */ {
 /*    */   private final Callable function;
 /*    */   private final long millis;
 /*    */ 
 /*    */   public TimedCallable(Callable functionlong millis)
/*    */   {
/* 42 */     this.function = function;
/* 43 */     this.millis = millis;
/*    */   }
/*    */ 
/*    */   public Object call() throws Exception
/*    */   {
/* 48 */     FutureResult result = new FutureResult();
/*    */ 
/* 50 */     Thread thread = getThreadFactory().newThread(result.setter(this.function));
/*    */ 
/* 52 */     thread.start();
/*    */     try
/*    */     {
/* 55 */       return result.timedGet(this.millis);
/*    */     }
/*    */     catch (InterruptedException ex)
/*    */     {
/* 60 */       thread.interrupt();
/* 61 */     }throw ex;
/*    */   }
/*    */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/thirdparty-all.jar
 * Qualified Name:     EDU.oswego.cs.dl.util.concurrent.TimedCallable
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X