Here you can find the source of parseRejectionPolicy(String rejection_policy)
public static RejectedExecutionHandler parseRejectionPolicy(String rejection_policy)
//package com.java2s; //License from project: LGPL import java.util.concurrent.*; public class Main { public static RejectedExecutionHandler parseRejectionPolicy(String rejection_policy) { if (rejection_policy == null) throw new IllegalArgumentException("rejection policy is null"); if (rejection_policy.equalsIgnoreCase("abort")) return new ThreadPoolExecutor.AbortPolicy(); if (rejection_policy.equalsIgnoreCase("discard")) return new ThreadPoolExecutor.DiscardPolicy(); if (rejection_policy.equalsIgnoreCase("discardoldest")) return new ThreadPoolExecutor.DiscardOldestPolicy(); if (rejection_policy.equalsIgnoreCase("run")) return new ThreadPoolExecutor.CallerRunsPolicy(); throw new IllegalArgumentException("rejection policy \"" + rejection_policy + "\" not known"); }//from w w w .j av a 2 s . co m }