Task4J/src/main/java/com/ani/dsl/job/impl/BatchJob.java
/**
		  *
		  * @exception Exception if any job sends any exception during it's process
		  */
@exception Exception if any job sends any exception during it's process
@exception Exception if any job sends any exception during it ' s process
@Override
		public void execute() throws Exception {
			ListenableFuture<List<IJob>> futAsList = null;
			Map<Integer,ListenableFuture<IJob>>  listenableFutureMap = Maps.newHashMap();
			Collection<ListenableFuture<IJob>> listenableFutureList = Collections.emptyList();
			try{
				listenableFutureMap = runBatchJob();
				listenableFutureList = listenableFutureMap.values();
				futAsList = Futures.allAsList(listenableFutureList);  
				List<IJob> opJobs = futAsList.get();
			}catch(ExecutionException | CancellationException  | InterruptedException e){
				if(logger.isDebugEnabled()){
				    logger.debug("exception type="+e.getClass());
				}	
				for (Integer key : listenableFutureMap.keySet()) {
					ListenableFuture<IJob> lisF = listenableFutureMap.get(key);
					lisF.cancel(true);
					if(lisF.isCancelled()){
						cancelledJobList.add(key);
					}
				}
				executorService.shutdownNow();
				throw e;
			}finally{
				executorService.shutdown();
				if(logger.isDebugEnabled()){
				    logger.debug("cancelledJobList ="+cancelledJobList);
				}
			}	
		}
@ Override public void execute ( ) throws Exception { ListenableFuture < List < IJob > > futAsList = null ; Map < Integer , ListenableFuture < IJob > > listenableFutureMap = Maps . newHashMap ( ) ; Collection < ListenableFuture < IJob > > listenableFutureList = Collections . emptyList ( ) ; try { listenableFutureMap = runBatchJob ( ) ; listenableFutureList = listenableFutureMap . values ( ) ; futAsList = Futures . allAsList ( listenableFutureList ) ; List < IJob > opJobs = futAsList . get ( ) ; } catch ( ExecutionException | CancellationException | InterruptedException e ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "exception type=" + e . getClass ( ) ) ; } for ( Integer key : listenableFutureMap . keySet ( ) ) { ListenableFuture < IJob > lisF = listenableFutureMap . get ( key ) ; lisF . cancel ( true ) ; if ( lisF . isCancelled ( ) ) { cancelledJobList . add ( key ) ; } } executorService . shutdownNow ( ) ; throw e ; } finally { executorService . shutdown ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "cancelledJobList =" + cancelledJobList ) ; } } }
@exception Exception if any job sends any exception during it's process
@exception Exception if any job sends any exception during it ' s process
//futAsList.cancel(true); //for(ListenableFuture<IJob> lisF : listenableFutureList){