/* (non-Javadoc)
@see org.parallelj.launching.transport.tcp.command.AbstractTcpCommand#process(org.apache.mina.core.session.IoSession, java.lang.String[])
331740
public final synchronized String process(final IoSession session, final String... args) {
		if (this.message == null) {
			final StringBuffer strb = new StringBuffer();
			// Get all available Commands and get its usage
			final TcpCommand[] cmds = TcpIpCommands.getCommands().values().toArray(new TcpCommand[]{});
			Arrays.sort(cmds);
			for (TcpCommand cmd : cmds) {
				final String help = cmd.getHelp(); 
				if (help!=null && help.length()>0) {
					strb.append(help).append(TcpIpHandlerAdapter.ENDLINE);
				}
//				String usage = cmd.getUsage(); 
//				if (usage!=null && usage.length()>0) {
//					strb.append(usage).append(TcpIpHandlerAdapter.ENDLINE);
//				}
			}
			this.message=strb.toString();
		}
		return this.message;
	}
313517
@Override
    public void process(final HttpServerRequest vertxRequest, final ContainerRequest jerseyRequest, final Handler<Void> done) {

        vertx.runOnContext(aVoid -> {
            Principal p = () -> "test";
            SecurityContext securityContext = new SecurityContext() {
                /**
                 * {@inheritDoc}
                 */
                @Override
                public Principal getUserPrincipal() {
                    return p;
                }

                /**
                 * {@inheritDoc}
                 */
                @Override
                public boolean isUserInRole(String role) {
                    String param = vertxRequest.params().get("role");
                    return role.equalsIgnoreCase(param);
                }

                /**
                 * {@inheritDoc}
                 */
                @Override
                public boolean isSecure() {
                    return false;
                }

                /**
                 * {@inheritDoc}
                 */
                @Override
                public String getAuthenticationScheme() {
                    return null;
                }
            };

            jerseyRequest.setSecurityContext(securityContext);
            done.handle(null);
        });

    }
470889
private void write(IoSession session, IoBuffer data) {
        IoBuffer dest = buffersMap.putIfAbsent(session,
                new IoBufferLazyInitializer(bufferSize));

        write(session, data, dest);
    }
494956
void processCommand(final HttpServerExchange exchange, final RequestData requestData, final MCMPAction action) throws IOException {
        if (exchange.getRequestPath().equals("*") || exchange.getRequestPath().endsWith("/*")) {
            processNodeCommand(exchange, requestData, action);
        } else {
            processAppCommand(exchange, requestData, action);
        }
    }
273676
@Override
	public final void onMessageSent(Session session, Object msg) {
		Command command = (Command) msg;
		((HandlerSocketSession) session).addCommand(command);

	}
1287874
@Override
    protected void process(@NotNull WireIn inWire,
                           @NotNull WireOut outWire,
                           @NotNull SessionDetailsProvider sd) {

        inWire.readDocument(m -> {
            long tid = inWire.read(() -> "tid").int64();
            outWire.writeDocument(true, meta -> meta.write(() -> "tid")
                    .int64(tid));

        }, d -> {
            outWire.writeDocument(false, data -> data.write(() -> "payloadResponse")
                    .text(inWire.read(() -> "payload").text()));
        });
    }
136783
@PostConstruct
    public void process() {
        Collection<BeanDefinition<?>> filterDefinitions = beanContext.getBeanDefinitions(Qualifiers.byStereotype(Filter.class));
        for (BeanDefinition<?> beanDefinition : filterDefinitions) {
            if (HttpClientFilter.class.isAssignableFrom(beanDefinition.getBeanType())) {
                // ignore http client filters
                continue;
            }
            String[] patterns = beanDefinition.getValue(Filter.class, String[].class).orElse(null);
            if (ArrayUtils.isNotEmpty(patterns)) {
                HttpMethod[] methods = beanDefinition.getValue(Filter.class, "methods", HttpMethod[].class).orElse(null);
                String first = patterns[0];
                FilterRoute filterRoute = addFilter(first, () -> beanContext.getBean((Class<HttpFilter>) beanDefinition.getBeanType()));
                if (patterns.length > 1) {
                    for (int i = 1; i < patterns.length; i++) {
                        String pattern = patterns[i];
                        filterRoute.pattern(pattern);
                    }
                }
                if (ArrayUtils.isNotEmpty(methods)) {
                    filterRoute.methods(methods);
                }
            }
        }
    }
196221
@Override
  public void process(CAS tcas) {

    final AnnotationComboIterator comboIterator = new AnnotationComboIterator(tcas,
        this.sentenceType, this.tokenType);

    for (AnnotationIteratorPair annotationIteratorPair : comboIterator) {
      
      final List<AnnotationFS> sentenceTokenAnnotationList = new LinkedList<AnnotationFS>();

      final List<String> sentenceTokenList = new LinkedList<String>();
      final List<String> additionalContextList = new LinkedList<String>();

      for (AnnotationFS tokenAnnotation : annotationIteratorPair.getSubIterator()) {

        sentenceTokenAnnotationList.add(tokenAnnotation);

        sentenceTokenList.add(tokenAnnotation.getFeatureValueAsString(lexemeFeature));
        
        additionalContextList.add(tokenAnnotation.getFeatureValueAsString(additionalContextFeature));
      }
      
      String[] toks = sentenceTokenList.toArray(new String[sentenceTokenList.size()]);
      
      String[][] additionalContext = new String[toks.length][2];
      
      int i = 0;
      for (String ac : additionalContextList) {
        if(ac != null) {
          if(ac.equals("P")) {
            additionalContext[i][1] = ac;
          } else {
            additionalContext[i][0] = ac;
          }
        }
        i++;
      }
      
      final List<String> posTags = Arrays.asList(this.posTagger.tag(toks, additionalContext));

      double posProbabilities[] = null;

      if (this.probabilityFeature != null) {
        posProbabilities = this.posTagger.probs();
      }

      final Iterator<String> posTagIterator = posTags.iterator();
      final Iterator<AnnotationFS> sentenceTokenIterator = sentenceTokenAnnotationList.iterator();

      int index = 0;
      while (posTagIterator.hasNext() && sentenceTokenIterator.hasNext()) {
        final String posTag = posTagIterator.next();
        final AnnotationFS tokenAnnotation = sentenceTokenIterator.next();

        tokenAnnotation.setStringValue(this.posFeature, posTag);

        if (posProbabilities != null) {
          tokenAnnotation.setDoubleValue(this.posFeature, posProbabilities[index]);
        }

        index++;
      }

      // log tokens with pos
      if (this.logger.isLoggable(Level.FINER)) {

        final StringBuilder sentenceWithPos = new StringBuilder();

        sentenceWithPos.append("\"");

        for (final AnnotationFS token : sentenceTokenAnnotationList) {
          sentenceWithPos.append(token.getCoveredText());
          sentenceWithPos.append('\\');
          sentenceWithPos.append(token.getStringValue(this.posFeature));
          sentenceWithPos.append(' ');
        }

        // delete last whitespace
        if (sentenceWithPos.length() > 1) // not 0 because it contains already the " char
          sentenceWithPos.setLength(sentenceWithPos.length() - 1);
        
        sentenceWithPos.append("\"");

        this.logger.log(Level.FINER, sentenceWithPos.toString());
      }
    }
  }
122731
public void process(Queue<String> argq, T state) {
    while (!argq.isEmpty()) {
      String nextArg = argq.peek();
      if (nextArg.startsWith("--")) {
        argq.remove();
        String key = nextArg.substring(2);
        Command<? super T> option = options.get(key);
        if (option != null) {
          option.process(argq, state);
        }
      } else if (nextArg.startsWith("-")) {
        argq.remove();
        for (int i = 1; i < nextArg.length(); i++) {
          char key = nextArg.charAt(i);
          Command<? super T> option = options.get(shortcuts.get(key));
          if (option != null) {
            option.process(argq, state);
          }
        }
      } else {
        Command<? super T> command = commands.get(nextArg);
        if (command != null) {
          argq.remove();
          command.process(argq, state);
          if (enterShell && shellCommand != null) {
            shellCommand.process(argq, state);
          }
          return;
        }
        break;
      }
    }
    if (defaultCommand != null) {
      defaultCommand.process(argq, state);
    }
    if (shellCommand != null) {
      shellCommand.process(argq, state);
    }
  }
456848
def process(string, sock)
      @sockets[sock][:procs].each do |pr|
        @pool.process do
          pr[1].call(*([string]+pr[0]))
        end
      end
    end
58397
@Override
  public void parseProcess(Element processElement, ProcessDefinitionEntity processDefinition) {
    addStartEventListener(processDefinition);
    addEndEventListener(processDefinition);
  }
839361
@Override
  public final void process(final Map<String, Object> pReqVars,
    final IRequestData pRequestData) throws Exception {
    DatabaseInfo databaseInfo = getSrvOrm()
      .retrieveEntityWithConditions(pReqVars, DatabaseInfo.class, "");
    pRequestData.setAttribute("databaseInfo", databaseInfo);
    pRequestData.setAttribute("appVersion", getSrvOrm().getMngSettings()
      .getAppSettings().get("appVersion"));
  }
1034290
public static ArrayList<String> runProcess(String... commands)
      throws InterruptedException, IOException {
    final java.lang.ProcessBuilder processBuilder = new java.lang.ProcessBuilder(commands);
    final ArrayList<String> output = new ArrayList<>();
    final Process process = processBuilder.start();
    process.waitFor();
    final InputStream inputStream = process.getInputStream();
    try {
      final java.io.BufferedReader reader = new java.io.BufferedReader(
          new InputStreamReader(inputStream, StandardCharsets.UTF_8));
      String line;
      while ((line = reader.readLine()) != null) {
        output.add(line);
      }
    } finally {
      inputStream.close();
    }
    return output;
  }
497363
@Override
    public void processEvent(SystemEvent event) throws AbortProcessingException {
        final UIViewRoot source = (UIViewRoot) event.getSource();

        final FacesContext context = FacesContext.getCurrentInstance();
        final WebXmlParameters webXmlParameters = new WebXmlParameters(context.getExternalContext());
        final boolean provideJQuery = webXmlParameters.isProvideJQuery();
        final boolean provideBootstrap = webXmlParameters.isProvideBoostrap();
        final boolean useCompressedResources = webXmlParameters.isUseCompressedResources();
        final boolean disablePrimeFacesJQuery = webXmlParameters.isIntegrationPrimeFacesDisableJQuery();

        final List<UIComponent> resources = new ArrayList<>(source.getComponentResources(context, HEAD));
        // Production mode and compressed
        if (useCompressedResources && context.getApplication().getProjectStage() == ProjectStage.Production) {
            handleCompressedResources(context, provideJQuery, provideBootstrap, resources, source);
        } else {
            handleConfigurableResources(context, provideJQuery, provideBootstrap, resources, source);
        }

        if (disablePrimeFacesJQuery) {
            for (UIComponent resource : resources) {
                final String resourceLibrary = (String) resource.getAttributes().get("library");
                final String resourceName = (String) resource.getAttributes().get("name");
                if ("primefaces".equals(resourceLibrary) && "jquery/jquery.js".equals(resourceName)) {
                    source.removeComponentResource(context, resource);
                }
            }
        }
    }
348252
private void process(T session) {
        // Process Reads
        if (isReadable(session) && !session.isReadSuspended()) {
            read(session);
        }

        // Process writes
        if (isWritable(session) && !session.isWriteSuspended()) {
            scheduleFlush(session);
        }
    }
1011117
void processPing(final HttpServerExchange exchange, final RequestData requestData) throws IOException {

        final String jvmRoute = requestData.getFirst(JVMROUTE);
        final String scheme = requestData.getFirst(SCHEME);
        final String host = requestData.getFirst(HOST);
        final String port = requestData.getFirst(PORT);

        final String OK = "Type=PING-RSP&State=OK&id=" + creationTime;
        final String NOTOK = "Type=PING-RSP&State=NOTOK&id=" + creationTime;

        if (jvmRoute != null) {
            // ping the corresponding node.
            final Node nodeConfig = container.getNode(jvmRoute);
            if (nodeConfig == null) {
                sendResponse(exchange, NOTOK);
                return;
            }
            final NodePingUtil.PingCallback callback = new NodePingUtil.PingCallback() {
                @Override
                public void completed() {
                    try {
                        sendResponse(exchange, OK);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }

                @Override
                public void failed() {
                    try {
                        nodeConfig.markInError();
                        sendResponse(exchange, NOTOK);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            };
            nodeConfig.ping(exchange, callback);
        } else {
            if (scheme == null && host == null && port == null) {
                sendResponse(exchange, OK);
                return;
            } else {
                if (host == null || port == null) {
                    processError(TYPESYNTAX, SMISFLD, exchange);
                    return;
                }
                // Check whether we can reach the host
                checkHostUp(scheme, host, Integer.parseInt(port), exchange, new NodePingUtil.PingCallback() {
                    @Override
                    public void completed() {
                        sendResponse(exchange, OK);
                    }

                    @Override
                    public void failed() {
                        sendResponse(exchange, NOTOK);
                    }
                });
                return;
            }
        }
    }
365339
@Override
  public final void process(final Map<String, Object> pAddParam,
    final IRequestData pRequestData) throws Exception {
    for (ILstnCatalogChanged lstn : this.listeners) {
      lstn.onCatalogChanged();
    }
  }