Examples of InputChannel


Examples of caltrop.interpreter.InputChannel

            final String[] vars = inputPattern.getVariables();
            final Expression repExpr = inputPattern.getRepeatExpr();

            if (repExpr == null) {
                for (int j = 0; j < vars.length; j++) {
                    final InputChannel channel = ((InputPort) (inputPortMap
                            .get(inputPattern.getPortname()))).getChannel(0); // FIXME
                    local.bind(vars[j], new SingleTokenReaderThunk(channel, j));
                }
            } else {
                SimpleThunk repExprThunk = new SimpleThunk(repExpr, context,
                        local);
                local.bind(new EnvironmentKey(inputPattern.getPortname()),
                        repExprThunk);

                for (int j = 0; j < vars.length; j++) {
                    final InputChannel channel = ((InputPort) (inputPortMap
                            .get(inputPattern.getPortname()))).getChannel(0); // FIXME
                    local.bind(vars[j], new MultipleTokenReaderThunk(channel,
                            j, vars.length, repExprThunk, context));
                }
            }
View Full Code Here

Examples of caltrop.interpreter.InputChannel

        for (int i = 0; i < inputPatterns.length; i++) {
            final InputPattern inputPattern = inputPatterns[i];

            // FIXME: handle multiports
            final InputChannel channel = ((InputPort) (inputPortMap
                    .get(inputPattern.getPortname()))).getChannel(0);

            if (inputPattern.getRepeatExpr() == null) {
                if (!channel.hasAvailable(inputPattern.getVariables().length)) {
                    // System.out.println("Not enough inputs:" + inputPattern.getVariables().length);
                    return false;
                }
            } else {
                int repeatVal = context.intValue(env.get(new EnvironmentKey(
                        inputPattern.getPortname())));

                if (!channel.hasAvailable(inputPattern.getVariables().length
                        * repeatVal)) {
                    // System.out.println("Not enough repeated inputs:" + inputPattern.getVariables().length * repeatVal);
                    return false;
                }
            }
View Full Code Here

Examples of caltrop.interpreter.InputChannel

        for (int i = 0; i < inputPatterns.length; i++) {
            final InputPattern inputPattern = inputPatterns[i];

            // FIXME: handle multiports
            final InputChannel channel = ((InputPort) (inputPortMap
                    .get(inputPattern.getPortname()))).getChannel(0);

            if (inputPattern.getRepeatExpr() == null) {
                if (!channel.hasAvailable(inputPattern.getVariables().length)) {
                    throw new InterpreterException("Not enough inputs:"
                            + inputPattern.getVariables().length);
                }
            } else {
                int repeatVal = context.intValue(env.get(new EnvironmentKey(
                        inputPattern.getPortname())));

                if (!channel.hasAvailable(inputPattern.getVariables().length
                        * repeatVal)) {
                    throw new InterpreterException(
                            "Not enough repeated inputs:"
                                    + (inputPattern.getVariables().length * repeatVal));
                }
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

    super.stop();
  }

  private void stopListener(String key, Endpoint endpoint) throws Exception {
    // Stop the Listener on endpoint that has been disabled
    InputChannel iC = null;
    String destName = null;
    if (endpoint.getDestination() != null) {
      System.out.println("Controller:" + getComponentName()
              + "-Stopping Listener Thread on Endpoint:" + endpoint.getDestination());
      destName = endpoint.getDestination().toString();
      iC = getInputChannel(destName);
    } else {
      System.out.println("Controller:" + getComponentName()
              + "-Stopping Listener Thread on Endpoint:" + endpoint.getReplyToEndpoint());
      destName = endpoint.getReplyToEndpoint();
      iC = getInputChannel(destName);
    }
    if (iC != null) {
      if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, getClass().getName(), "stopListener",
                UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_stopping_listener__INFO",
                new Object[] { getComponentName(), destName, key });
      }
      iC.destroyListener(destName, key);
    }
  }
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

      outputChannel.removeCasFromOutstandingList(entry, isRequest, endpoint.getDelegateKey());
      if (delegate != null) {
        // Mark this delegate as Failed
        delegate.getEndpoint().setStatus(Endpoint.FAILED);
        // Destroy listener associated with a reply queue for this delegate
        InputChannel ic = controller.getInputChannel(delegate.getEndpoint().getDestination()
                .toString());
        if (ic != null && delegate != null && delegate.getEndpoint() != null) {
          ic.destroyListener(delegate.getEndpoint().getDestination().toString(), endpoint
                  .getDelegateKey());
        }
      }
      // Setup error context and handle failure in the error handler
      ErrorContext errorContext = new ErrorContext();
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

    }
    try {
      if (controller instanceof AggregateAnalysisEngineController) {
        String delegateKey = ((AggregateAnalysisEngineController) controller)
                .lookUpDelegateKey(endpoint.getEndpoint());
        InputChannel iC = null;
        String queueName = null;
        if (endpoint.getDestination() != null) {
          queueName = endpoint.getDestination().toString();
        } else {
          queueName = endpoint.getEndpoint();
        }
        iC = ((AggregateAnalysisEngineController) controller).getInputChannel(queueName);
        if (iC != null) {
          iC.destroyListener(queueName, delegateKey);
        } else {
          if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
               UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                        "handleTempQueueFailure", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                        "UIMAJMS_unable_to_lookup_input_channel__INFO", queueName);
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

            //  Only one thread at a time is allowed here.
            synchronized( masterEndpoint ) {
              if ( masterEndpoint.getStatus() == Endpoint.FAILED ) {
                //  Returns InputChannel if the Reply Listener for the delegate has previously failed.
                //  If the listener hasnt failed the getReplyInputChannel returns null
                InputChannel iC = getAnalysisEngineController().getReplyInputChannel(anEndpoint.getDelegateKey());
                if ( iC != null ) {
                  try {
                    // Create a new Listener, new Temp Queue and associate the listener with the Input Channel
                  // Also resets endpoint status to OK 
                    iC.createListener(anEndpoint.getDelegateKey(), anEndpoint);
                    iC.removeDelegateFromFailedList(masterEndpoint.getDelegateKey());
                  } catch( Exception exx) {
                    throw new AsynchAEException(exx);
                  }
                } else{
                  throw new AsynchAEException("Aggregate:"+getAnalysisEngineController()+" Has not yet recovered a listener for delegate: "+anEndpoint.getDelegateKey());
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

    if (!isTopLevelComponent()) {
      ((BaseAnalysisEngineController) parentController).stop();
    } else if (!isStopped()) {
      stopDelegateTimers();
      getOutputChannel().cancelTimers();
      InputChannel iC = getInputChannel(endpointName);
      if ( iC != null) {
          iC.setTerminating();
      }
      // Stop the inflow of new input CASes
      stopInputChannel(true)// shutdownNow
       if ( iC != null ) {
        iC.terminate();
      }
      stopCasMultipliers();
      stopTransportLayer();
      if (cause != null && aCasReferenceId != null) {
        this.stop(cause, aCasReferenceId, true)// shutdownNow
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

  /**
   * Stops a listener on the main input channel
   *
   */
  protected void stopInputChannel(boolean shutdownNow) {
    InputChannel iC = getInputChannel(endpointName);
    if (iC != null && !iC.isStopped()) {
      try {
        iC.stop(shutdownNow);
      } catch (Exception e) {
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, getClass().getName(), "terminate",
                  UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAEE_unable_to_stop_inputchannel__INFO",
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

      }
    }
  }
  private void setInputChannelForNoRecovery() {
    if ( inputChannelMap.size() > 0 ) {
      InputChannel iC = getInputChannel();
      iC.setTerminating();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.