Uses the AllocatedEvaluator to launch a CLR task.

@param allocatedEvaluator
540114
void onNextCLR(final AllocatedEvaluator allocatedEvaluator) {
    try {
      allocatedEvaluator.setProcess(clrProcessFactory.newEvaluatorProcess());
      final Configuration contextConfiguration = ContextConfiguration.CONF
          .set(ContextConfiguration.IDENTIFIER, "HelloREEFContext")
          .build();

      final Configuration taskConfiguration = getCLRTaskConfiguration("Hello_From_CLR");

      allocatedEvaluator.submitContextAndTask(contextConfiguration, taskConfiguration);
    } catch (final BindException ex) {
      final String message = "Unable to setup Task or Context configuration.";
      LOG.log(Level.SEVERE, message, ex);
      throw new RuntimeException(message, ex);
    }
  }
1227114
public final void evaluate() throws IllegalAccessException, InvocationTargetException {
		if (simple) tr.startCollection();
		fTestMethod.invoke(fTarget, params);
		if (simple) tr.stopCollection();
	}
1140149
private void setCL(final ClassLoader cl) {
        PrivilegedAction<Object> action = new PrivilegedAction<Object>() {
            @Override
            @FFDCIgnore(SecurityException.class)
            public Object run() {
                final Thread t = Thread.currentThread();
                try {
                    t.setContextClassLoader(cl);
                } catch (SecurityException e) {
                    // If this work happens to run on an java.util.concurrent.ForkJoinWorkerThread$InnocuousForkJoinWorkerThread,
                    // setting the ClassLoader may be rejected. If this happens, give a decent error message.
                    if (t instanceof ForkJoinWorkerThread && "InnocuousForkJoinWorkerThreadGroup".equals(t.getThreadGroup().getName())) {
                        throw new SecurityException(Tr.formatMessage(tc, "cannot.apply.classloader.context", t.getName()), e);
                    } else {
                        throw e;
                    }
                }
                return null;
            }
        };
        AccessController.doPrivileged(action);
    }
1365981
public synchronized boolean onRecoverEvaluator(final String evaluatorId) {
    if (getStateOfPreviousEvaluator(evaluatorId).isFailedOrNotExpected()) {
      final String errMsg = "Evaluator with evaluator ID " + evaluatorId + " not expected to be alive.";
      LOG.log(Level.SEVERE, errMsg);
      throw new DriverFatalRuntimeException(errMsg);
    }

    if (getStateOfPreviousEvaluator(evaluatorId) != EvaluatorRestartState.EXPECTED) {
      LOG.log(Level.WARNING, "Evaluator with evaluator ID " + evaluatorId + " added to the set" +
          " of recovered evaluators more than once. Ignoring second add...");
      return false;
    }

    // set the status for this evaluator ID to be reported.
    setEvaluatorReported(evaluatorId);

    if (haveAllExpectedEvaluatorsReported()) {
      onDriverRestartCompleted(false);
    }

    return true;
  }
266859
public void submitContextAndTask(final String evaluatorConfiguration,
                                   final String contextConfiguration,
                                   final String taskConfiguration) {
    this.launchWithConfigurationString(evaluatorConfiguration, contextConfiguration,
        Optional.<String>empty(), Optional.of(taskConfiguration));
  }
1339330
public <T extends Evaluation> T evaluate(DataSetIterator iterator) {
        return (T)evaluate(iterator, null);
    }
106189
@Override
    public Object invoke(Object[] vals) throws InvocationTargetException {
        try {
            return constr.newInstance(vals);
        } catch (InvocationTargetException | IllegalArgumentException e) {
            throw e;
        } catch (IllegalAccessException e) {
            // runtime exception, isValid should prevent this case
            throw new RuntimeException("can't access constructor");
        } catch (InstantiationException e) {
            // runtime excpetion, because the constructor of constructor
            // has to prevent this situation.
            throw new RuntimeException("can't instantiate");
        }
    }
985974
public static void setAllocator(IoBufferAllocator newAllocator) {
    if (newAllocator == null) {
      throw new NullPointerException("allocator");
    }

    IoBufferAllocator oldAllocator = allocator;

    allocator = newAllocator;

    if (null != oldAllocator) {
      oldAllocator.dispose();
    }
  }
638224
private synchronized void retainEvaluator(final ActiveContext context) {
    if (scheduler.hasPendingTasks()) {
      scheduler.submitTask(context);
    } else if (nActiveEval > 1) {
      nActiveEval--;
      context.close();
    } else {
      state = State.READY;
      waitForCommands(context);
    }
  }
393066
protected void registerFactorComparator(final FactorComparator<T> comparator) {
    if (null == comparator ||
        Integer.MAX_VALUE - this.getTotalWeight() < comparator.getWeight()) {
      throw new IllegalArgumentException("unable to register comparator." +
          " The passed comparator is null or has an invalid weight value.");
    }

    // add or replace the Comparator.
    this.factorComparatorList.put(comparator.getFactorName(), comparator);
    logger.debug(String.format("Factor comparator added for '%s'. Weight = '%s'",
        comparator.getFactorName(), comparator.getWeight()));
  }
183795
public final void initApplicationClassLoader(ClassLoader loader)
    {
        if (loader == null)
            throw new IllegalArgumentException("loader is null");
        if (!Kit.testIfCanLoadRhinoClasses(loader))
            throw new IllegalArgumentException(
                "Loader can not resolve Rhino classes");

        if (this.applicationClassLoader != null)
            throw new IllegalStateException(
                "applicationClassLoader can only be set once");
        checkNotSealed();

        this.applicationClassLoader = loader;
    }
905350
public void setSentenceIterator(@NonNull SentenceIterator iterator) {
        //if (tokenizerFactory == null) throw new IllegalStateException("Please call setTokenizerFactory() prior to setSentenceIter() call.");

        if (tokenizerFactory != null) {
            SentenceTransformer transformer = new SentenceTransformer.Builder().iterator(iterator)
                            .tokenizerFactory(tokenizerFactory)
                            .allowMultithreading(configuration == null || configuration.isAllowParallelTokenization())
                            .build();
            this.iterator = new AbstractSequenceIterator.Builder<>(transformer).build();
        } else
            log.error("Please call setTokenizerFactory() prior to setSentenceIter() call.");
    }
385717
public static void registerAccessor(Class<?> documentType, DocumentAccessor accessor) {
		Assert.notNull(documentType, "documentType may not be null");
		Assert.notNull(accessor, "accessor may not be null");
		if (accessors.containsKey(documentType)) {
			DocumentAccessor existing = getAccessor(documentType);
			LOG.warn(String.format("DocumentAccessor for class %s already exists: %s will be overridden by %s", documentType, existing.getClass(), accessor.getClass()));
		}
		putAccessor(documentType, accessor);
		LOG.debug("Registered document accessor: {} for class: {}", accessor.getClass(), documentType);
	}
988069
public void initEvictor() {
        MapEvictionPolicy mapEvictionPolicy = getMapEvictionPolicy();
        if (mapEvictionPolicy == null) {
            evictor = NULL_EVICTOR;
        } else {
            MemoryInfoAccessor memoryInfoAccessor = getMemoryInfoAccessor();
            EvictionChecker evictionChecker = new EvictionChecker(memoryInfoAccessor, mapServiceContext);
            NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
            IPartitionService partitionService = nodeEngine.getPartitionService();
            int batchSize = nodeEngine.getProperties().getInteger(MAP_EVICTION_BATCH_SIZE);
            evictor = new EvictorImpl(mapEvictionPolicy, evictionChecker, partitionService, batchSize);
        }
    }
964011
public <T extends Evaluation> T evaluate(DataSetIterator iterator) {
        return (T)evaluate(iterator, (List<String>)null);
    }
40440
public static <T> T load(
      Class<T> klass,
      Iterable<Class<?>> hardcoded,
      ClassLoader cl,
      PriorityAccessor<T> priorityAccessor) {
    List<T> candidates = loadAll(klass, hardcoded, cl, priorityAccessor);
    if (candidates.isEmpty()) {
      return null;
    }
    return candidates.get(0);
  }
108471
private void invokeInitializersBasedOnPriority(ITestContext context) {
        ServiceLoader<Initializer> serviceLoader = ServiceLoader.load(Initializer.class);
        List<AbstractConfigInitializer> loader = new ArrayList<AbstractConfigInitializer>();
        for (Initializer l : serviceLoader) {
            loader.add((AbstractConfigInitializer) l);
        }
        Collections.sort(loader);
        for (AbstractConfigInitializer temp : loader) {
            temp.initialize(context);
        }
    }