/* (non-Javadoc)
@see org.apereo.portal.portlet.rendering.worker.IPortletWorkerFactory#getActionWorker()
177485
@Override
    public IPortletActionExecutionWorker createActionWorker(
            HttpServletRequest request,
            HttpServletResponse response,
            IPortletWindowId portletWindowId) {
        final IPortletWindow portletWindow =
                this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
        return new PortletActionExecutionWorker(
                portletThreadPool,
                executionInterceptors,
                portletRenderer,
                request,
                response,
                portletWindow);
    }
1073277
@Override
    public PortletDelegationDispatcher getRequestDispatcher(
            PortletRequest portletRequest, IPortletWindowId portletWindowId) {
        final HttpServletRequest request =
                this.portalRequestUtils.getPortletHttpRequest(portletRequest);
        final IPerson person = this.personManager.getPerson(request);

        final IPortletWindow portletWindow =
                this.portletWindowRegistry.getPortletWindow(request, portletWindowId);

        final IPortletWindowId delegationParentId = portletWindow.getDelegationParentId();
        if (delegationParentId == null) {
            throw new IllegalArgumentException(
                    "Portlet window '"
                            + portletWindow
                            + "' is not a delegate window and cannot be delgated to.");
        }

        return new PortletDelegationDispatcherImpl(
                portletWindow,
                person.getID(),
                this.portalRequestUtils,
                this.personManager,
                this.portletRenderer,
                this.portalUrlProvider,
                this.portletDelegationManager);
    }
113890
public TaskBuilder<Result> action(final Callable<Result> action) {
        if (action instanceof TaskCallable) {
            this.action = (TaskCallable<Result>) action;
        } else {
            this.action = new WrappedCallable<Result>(action);
        }
        return this;
    }
254000
@CheckForNull
    public static WorkItem getWorkItem(Object element) {
        if (element instanceof IResource) {
            IResource resource = (IResource) element;
            if (resource.getType() == IResource.FILE && !Util.isJavaArtifact(resource) || !resource.isAccessible()) {
                // Ignore non java files or deleted/closed files/projects
                return null;
            }
            return new WorkItem((IResource) element);
        }
        if (element instanceof IJavaElement) {
            return new WorkItem((IJavaElement) element);
        }

        if (element instanceof IAdaptable) {
            Object adapter = ((IAdaptable) element).getAdapter(IResource.class);
            if (adapter instanceof IResource) {
                IResource resource = (IResource) adapter;
                if (resource.getType() == IResource.FILE && !Util.isJavaArtifact(resource) || !resource.isAccessible()) {
                    // Ignore non java files or deleted/closed files/projects
                    return null;
                }
                return new WorkItem(resource);
            }
            adapter = ((IAdaptable) element).getAdapter(IPackageFragment.class);
            if (adapter instanceof IPackageFragment) {
                return new WorkItem((IPackageFragment) adapter);
            }
            adapter = ((IAdaptable) element).getAdapter(IType.class);
            if (adapter instanceof IType) {
                return new WorkItem((IType) adapter);
            }
        }
        return null;
    }
747727
public static Action getAndCheckAction(EntityDataModel entityDataModel, String actionName) {
        int namespaceLastIndex = actionName.lastIndexOf('.');
        String namespace = actionName.substring(0, namespaceLastIndex);
        String simpleActionName = actionName.substring(namespaceLastIndex + 1);
        Schema schema = entityDataModel.getSchema(namespace);
        if (schema == null) {
            throw new ODataSystemException("Could not find schema in entity data model with namespace: " +
                    namespace);
        }
        Action action = schema.getAction(simpleActionName);
        if (action == null) {
            throw new ODataSystemException("Action not found in entity data model: " + actionName);
        }
        return action;
    }
1130493
function getWorkerData(worker) {
  /* istanbul ignore if */
  if (!worker) {
    throw new TypeError("Trying to get private data for null worker?!");
  }

  var data = worker[clusterphone.workerDataAccessor];
  if (!data) {
    worker[clusterphone.workerDataAccessor] = data = {};
  }

  return data;
}
1212054
@Override
    public Object invoke(Object controller, String action) throws Throwable {
        if(action == null) action = this.defaultActionName;
        ActionInvoker handle = actions.get(action);
        if(handle == null) throw new IllegalArgumentException("Invalid action name: " + action);
        return handle.invoke(controller);
    }
376519
@Override
    public void doPortletAction(
            IPortletWindowId portletWindowId,
            HttpServletRequest request,
            HttpServletResponse response) {
        final long timeout = getPortletActionTimeout(portletWindowId, request);

        final IPortletExecutionWorker<Long> portletActionExecutionWorker =
                this.portletWorkerFactory.createActionWorker(request, response, portletWindowId);
        portletActionExecutionWorker.submit();

        try {
            portletActionExecutionWorker.get(timeout);
        } catch (Exception e) {
            // put the exception into the error map for the session
            final Map<IPortletWindowId, Exception> portletFailureMap = getPortletErrorMap(request);
            portletFailureMap.put(portletWindowId, e);
        }

        // If the worker is still running add it to the hung-workers queue
        if (!portletActionExecutionWorker.isComplete()) {
            cancelWorker(request, portletActionExecutionWorker);
        }

        // Is this portlet permitted to emit events?  (Or is it disablePortletEvents=true?)
        final IPortletWindow portletWindow =
                portletWindowRegistry.getPortletWindow(request, portletWindowId);
        IPortletDefinition portletDefinition =
                portletWindow.getPortletEntity().getPortletDefinition();
        IPortletDefinitionParameter disablePortletEvents =
                portletDefinition.getParameter(DISABLE_PORTLET_EVENTS_PARAMETER);
        if (disablePortletEvents != null && Boolean.parseBoolean(disablePortletEvents.getValue())) {
            logger.info(
                    "Ignoring portlet events for portlet '{}' because they have been disabled.",
                    portletDefinition.getFName());
        } else {
            // Proceed with events...
            final PortletEventQueue portletEventQueue =
                    this.eventCoordinationService.getPortletEventQueue(request);
            this.doPortletEvents(portletEventQueue, request, response);
        }
    }
1302147
@Override
    public V get() throws InterruptedException, ExecutionException {
        V v = super.get();
        this.mergeWorkerTracyTheadContext();
        return v;
    }
1011693
public Action getAction(String actionName, String nodeID) {
		return serviceRegistry.getAction(actionName, nodeID);
	}
835864
private GetWorkerReportOptions getOptions(CommandLine cl) throws IOException {
    if (cl.getOptions().length > 1) {
      System.out.println(getUsage());
      throw new InvalidArgumentException("Too many arguments passed in.");
    }
    GetWorkerReportOptions workerOptions = GetWorkerReportOptions.defaults();

    Set<WorkerInfoField> fieldRange = new HashSet<>(Arrays.asList(WorkerInfoField.ADDRESS,
        WorkerInfoField.WORKER_CAPACITY_BYTES, WorkerInfoField.WORKER_CAPACITY_BYTES_ON_TIERS,
        WorkerInfoField.LAST_CONTACT_SEC, WorkerInfoField.WORKER_USED_BYTES,
        WorkerInfoField.WORKER_USED_BYTES_ON_TIERS));
    workerOptions.setFieldRange(fieldRange);

    if (cl.hasOption(ReportCommand.LIVE_OPTION_NAME)) {
      workerOptions.setWorkerRange(WorkerRange.LIVE);
    } else if (cl.hasOption(ReportCommand.LOST_OPTION_NAME)) {
      workerOptions.setWorkerRange(WorkerRange.LOST);
    } else if (cl.hasOption(ReportCommand.SPECIFIED_OPTION_NAME)) {
      workerOptions.setWorkerRange(WorkerRange.SPECIFIED);
      String addressString = cl.getOptionValue(ReportCommand.SPECIFIED_OPTION_NAME);
      String[] addressArray = addressString.split(",");
      // Addresses in GetWorkerReportOptions is only used when WorkerRange is SPECIFIED
      workerOptions.setAddresses(new HashSet<>(Arrays.asList(addressArray)));
    }
    return workerOptions;
  }
388981
@Nullable
  private MasterWorkerInfo findUnregisteredWorker(WorkerNetAddress workerNetAddress) {
    for (IndexedSet<MasterWorkerInfo> workers: Arrays.asList(mTempWorkers, mLostWorkers)) {
      MasterWorkerInfo worker = workers.getFirstByField(ADDRESS_INDEX, workerNetAddress);
      if (worker != null) {
        return worker;
      }
    }
    return null;
  }
358658
public alluxio.grpc.WorkerNetAddress getWorkerAddress() {
    return workerAddress_ == null ? alluxio.grpc.WorkerNetAddress.getDefaultInstance() : workerAddress_;
  }
947006
@Service
    public Task getPendingTaskForWorkflow(String workflowId, String taskReferenceName) {
        return executionService.getPendingTaskForWorkflow(taskReferenceName, workflowId);
    }
938609
public static Handler getActionHandler(Class<?> sourceClass, Class<?> targetClass) {
        if (isDisable) {
            throw ConverterDisabledException.of("@EnableConverter annotation not enabled");
        }

        Condition condition = Condition.newInstance(sourceClass, targetClass);
        Handler handler = ACTION_MAP.get(condition);

        if (Objects.isNull(handler)) {
            throw NoConverterException.of("The conversion method of matching \"" + condition + "\" was not found");
        }
        return handler;
    }
489025
public Object getAction() throws ODataException {
        Option<String> actionNameOption = ODataUriUtil.getActionCallName(odataUri);
        if (actionNameOption.isDefined()) {
            LOG.debug("The operation is supposed to be an action");
            String actionName = actionNameOption.get();
            return parseAction(actionName);
        }

        Option<String> actionImportNameOption = ODataUriUtil.getActionImportCallName(odataUri);
        if (actionImportNameOption.isDefined()) {
            LOG.debug("The operation is supposed to be an action import");
            String actionImportName = actionImportNameOption.get();
            return parseActionImport(actionImportName);
        }

        throw new ODataUnmarshallingException("Not able to parse action / action import");
    }
1059795
@Override
  public synchronized OutputCommitter getOutputCommitter(TaskAttemptContext context)
      throws IOException {
    // Cache the committer.
    if (committer == null) {
      committer = createCommitter(context);
    }
    return committer;
  }