<p>Getter for the field <code>retryExecutor</code>.</p>

@return a {@link java.util.concurrent.ScheduledExecutorService} object.
185252
public synchronized ScheduledExecutorService getRetryExecutor() {
    if (retryExecutor == null) {
      retryExecutor = Executors.newScheduledThreadPool(RETRY_THREAD_COUNT,
          ThreadUtil.getThreadFactory(RETRY_THREADPOOL_NAME_PATTERN, true));
    }
    return retryExecutor;
  }
1371404
public <T> T getJsonData(Class<T> clazz, RemoteUrl remoteUrl, int retryTimes, int retrySleepSeconds)
            throws Exception {
        Exception ex = null;
        for (URL url : remoteUrl.getUrls()) {

            // 可重试的下载
            UnreliableInterface unreliableImpl = new RestfulGet<T>(clazz, url);

            try {

                T t = retryStrategy.retry(unreliableImpl, retryTimes, retrySleepSeconds);

                return t;

            } catch (Exception e) {
                ex = e;
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e1) {
                    LOGGER.info("pass");
                }
            }
        }

        throw new Exception("cannot get: " + remoteUrl, ex);
    }
969936
protected ScheduledExecutorService createExecutor(ThreadFactory threadFactory)
    {
        ThreadFactory factory = threadFactory == null
            ? DEFAULT_THREAD_FACTORY
            : threadFactory;

        return Executors.newSingleThreadScheduledExecutor(factory);
    }
421754
@Nonnull
  public static IScheduler getScheduler (final boolean bStartAutomatically)
  {
    try
    {
      // Don't try to use a name - results in NPE
      final IScheduler aScheduler = s_aSchedulerFactory.getScheduler ();
      if (bStartAutomatically && !aScheduler.isStarted ())
        aScheduler.start ();
      return aScheduler;
    }
    catch (final SchedulerException ex)
    {
      throw new IllegalStateException ("Failed to create" +
                                       (bStartAutomatically ? " and start" : "") +
                                       " scheduler!",
                                       ex);
    }
  }
1223314
public CompletableFuture<Void> scheduleForExecution() {
		final ExecutionGraph executionGraph = getVertex().getExecutionGraph();
		final SlotProvider resourceProvider = executionGraph.getSlotProvider();
		final boolean allowQueued = executionGraph.isQueuedSchedulingAllowed();
		return scheduleForExecution(
			resourceProvider,
			allowQueued,
			LocationPreferenceConstraint.ANY,
			Collections.emptySet());
	}
817623
public static ListeningExecutorService getExecutorService() {
        if (Twilio.executorService == null) {
            Twilio.executorService = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool());
        }
        return Twilio.executorService;
    }
846543
public static ExecutorService getQueueingExecutorService(final Queue<Runnable> taskQueue) {
        return new ExecutorService() {
            @Override
            public void execute(Runnable command) {
                taskQueue.offer(command);
            }

            @Override
            public void shutdown() {
                throw new UnsupportedOperationException();
            }

            @Override
            public List<Runnable> shutdownNow() {
                throw new UnsupportedOperationException();
            }

            @Override
            public boolean isShutdown() {
                return false;
            }

            @Override
            public boolean isTerminated() {
                return false;
            }

            @Override
            public boolean awaitTermination(long timeout, TimeUnit unit)
                    throws InterruptedException {
                return true;
            }

            @Override
            public <T> Future<T> submit(Callable<T> task) {
                Preconditions.checkNotNull(task);
                FutureTask<T> retval = new FutureTask<T>(task);
                taskQueue.offer(retval);
                return retval;
            }

            @Override
            public <T> Future<T> submit(Runnable task, T result) {
                Preconditions.checkNotNull(task);
                FutureTask<T> retval = new FutureTask<T>(task, result);
                taskQueue.offer(retval);
                return retval;
            }

            @Override
            public Future<?> submit(Runnable task) {
                Preconditions.checkNotNull(task);
                ListenableFutureTask<Object> retval = ListenableFutureTask.create(task, null);
                taskQueue.offer(retval);
                return retval;
            }

            @Override
            public <T> List<Future<T>> invokeAll(
                    Collection<? extends Callable<T>> tasks)
                    throws InterruptedException {
                throw new UnsupportedOperationException();
            }

            @Override
            public <T> List<Future<T>> invokeAll(
                    Collection<? extends Callable<T>> tasks, long timeout,
                    TimeUnit unit) throws InterruptedException {
                throw new UnsupportedOperationException();
            }

            @Override
            public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
                    throws InterruptedException, ExecutionException {
                throw new UnsupportedOperationException();
            }

            @Override
            public <T> T invokeAny(Collection<? extends Callable<T>> tasks,
                    long timeout, TimeUnit unit) throws InterruptedException,
                    ExecutionException, TimeoutException {
                throw new UnsupportedOperationException();
            }
        };
    }
555772
protected ScheduledFuture<?> startTimer() {
        return getExecutorService().scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
                endOfPeriod();
            }
        }, getPeriod(), getPeriod(), getUnit());
    }
1197324
public static Executors getInstance() {
        if (instance == null) {
            synchronized (Executors.class) {
                if (instance == null) instance = new Executors();
            }
        }
        return instance;
    }
679642
public static DateFormat getInstance() {
        if (instance == null) {
            synchronized (instanceLock) {
                if (instance == null) {
                    instance = new ResqueDateFormatThreadLocal();
                }
            }
        }
        return instance.get();
    }
1285150
public Method getExecutorMethod(MethodMember methodMember) {
		String executorDescriptor;
		String name;

		//What to search for:
		if (methodMember.isConstructor()) {
			name = Constants.mInitializerName;
		}
		else {
			name = methodMember.getName();
		}
		executorDescriptor = getExecutorDescriptor(methodMember);

		//Search for it:
		if (executorClass != null) {
			Method[] executorMethods = executorClass.getDeclaredMethods();
			for (Method executor : executorMethods) {
				if (executor.getName().equals(name) && Type.getMethodDescriptor(executor).equals(executorDescriptor)) {
					return executor;
				}
			}
		}
		return null;
	}
91954
@Override
	public MutableObjectIterator<E> getIterator() throws InterruptedException {
		synchronized (this.iteratorLock) {
			// wait while both the iterator and the exception are not set
			while (this.iterator == null && this.iteratorException == null) {
				this.iteratorLock.wait();
			}
			
			if (this.iteratorException != null) {
				throw new RuntimeException("Error obtaining the sorted input: " + this.iteratorException.getMessage(),
					this.iteratorException);
			}
			else {
				return this.iterator;
			}
		}
	}
1352266
private static ScheduledExecutorService newSingleThreadScheduler() {
        ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
        EXECUTORS.add(scheduledExecutorService);
        return scheduledExecutorService;
    }
725512
public Class getSetClass(SetExecutor setExecutor, Class srcRefClass, Class getResultClass) {
        if (setExecutor instanceof MapSetExecutor) {
            if (getResultClass != null) {
                return getResultClass;// 优先设置为getResult的class对象
            }
        } else if (setExecutor instanceof FastPropertySetExecutor) {
            return getTargetClass(((FastPropertySetExecutor) setExecutor).getMethod().getJavaMethod());
        } else if (setExecutor instanceof PropertySetExecutor) {
            return getTargetClass(((PropertySetExecutor) setExecutor).getMethod());
        } else if (setExecutor instanceof FieldSetExecutor) {
            return ((FieldSetExecutor) setExecutor).getField().getType();
        }

        return null;
        // throw new BeanMappingException("unknow SetExecutor");
    }
923854
public static KriptonTaskExecutor getInstance() {
		if (sInstance != null) {
			return sInstance;
		}
		synchronized (KriptonTaskExecutor.class) {
			if (sInstance == null) {
				sInstance = new KriptonTaskExecutor();
			}
		}
		return sInstance;
	}
1002699
public static ExecutorService newSingleThreadDaemonExecutor() {
        return Executors.newSingleThreadExecutor(r -> {
            Thread t = Executors.defaultThreadFactory().newThread(r);
            t.setDaemon(true);
            return t;
        });
    }
980079
@Override
    public ExecutorService executorService() {
        InternalEventPipeline pipeline = currentPipeline.get();
        if (pipeline != null) {
            return pipeline.executorService();
        }
        return fallback.executorService();
    }