Examples of InputChannel


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 {
          System.out.println(">>> Listener Unable To LookUp InputChannel For Queue:" + queueName);
        }
      }
    } catch (Exception e) {
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

   * @throws Exception
   */
  private void createListener(String delegateKey) throws Exception {
    if (controller instanceof AggregateAnalysisEngineController) {
      // Fetch an InputChannel that handles messages for a given delegate
      InputChannel iC = controller.getReplyInputChannel(delegateKey);
      // Create a new Listener, new Temp Queue and associate the listener with the Input Channel
      iC.createListener(delegateKey, null);
    }
  }
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

   * Stops a listener on the main input channel
   *
   */
  protected void stopInputChannel()
  {
    InputChannel iC = getInputChannel(endpointName);
    if( iC != null && !iC.isStopped())
    {
      try
      {
        System.out.println("Controller:"+getComponentName()+" Stopping Input Channel:"+iC.getInputQueueName());
        iC.stop();
      }
      catch( Exception e)
      {
        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, getClass().getName(), "terminate", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_unable_to_stop_inputchannel__INFO", new Object[] { getComponentName(), endpointName });
      }
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

   * is configured with.
   *
   */
  protected void stopInputChannels()
  {
    InputChannel iC = null;
    try
    {
      if ( inputChannel != null )
      {
        inputChannel.stop();
      }
    }
    catch( Exception e) { e.printStackTrace();}
   
    Iterator it = inputChannelMap.keySet().iterator();
    int i=1;
    while( it.hasNext() )
    {
      try
      {   
        String key = (String)it.next();
        if ( key != null && key.trim().length() > 0)
        {
          iC = (InputChannel)inputChannelMap.get(key);
          if ( iC != null )
          {
            iC.stop();
          }
        }
        i++;
      }
      catch( Exception e)
      {
        if ( iC != null )
        {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, getClass().getName(), "stopInputChannels", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_unable_to_stop_inputchannel__INFO", new Object[] { getComponentName(), iC.getInputQueueName() });
        }
        else
        {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(), "stopInputChannels", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_exception__WARNING", new Object[] { e });
        }
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

    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

Examples of org.apache.uima.aae.InputChannel

      iC.setTerminating();
    }
  }
  protected void stopReceivingCASes(boolean stopAllListeners)  {
   
      InputChannel iC = null;
      setInputChannelForNoRecovery();
      Iterator<String> it = inputChannelMap.keySet().iterator();
      while (it.hasNext()) {
        try {
          String key = it.next();
          if (key != null && key.trim().length() > 0) {
            iC = (InputChannel) inputChannelMap.get(key);
            if (iC != null ) {
              if ( stopAllListeners ) {
                iC.disconnectListenersFromQueue();
              } else if ( iC.getInputQueueName() != null && !iC.getInputQueueName().startsWith("temp-queue")) {
                iC.disconnectListenersFromQueue();
              }
            }
          }
        } catch (Exception e) {
          if (iC != null) {
            if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
              UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, getClass().getName(),
                      "stopReceivingCASes", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                      "UIMAEE_unable_to_stop_inputchannel__INFO",
                      new Object[] { getComponentName(), iC.getInputQueueName() });
            }
          } else {
            if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
              UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                      "stopReceivingCASes", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
View Full Code Here

Examples of org.apache.uima.aae.InputChannel

        }
      }
   
  }
  protected void stopInputChannels( int channelsToStop, boolean shutdownNow) {   //, boolean norecovery) {
      InputChannel iC = null;
      setInputChannelForNoRecovery();
      Iterator it = inputChannelMap.keySet().iterator();
      int i = 1;
      while (it.hasNext()) {
        try {
          String key = (String) it.next();
          if (key != null && key.trim().length() > 0) {
            iC = (InputChannel) inputChannelMap.get(key);
            if (iC != null) {
              if (channelsToStop == InputChannel.InputChannels && iC.getServiceInfo() != null
                      && iC.getServiceInfo().getInputQueueName().startsWith("top_level_input_queue")) {
                // This closes both listeners on the input queue: Process Listener and GetMeta
                // Listener
                iC.stop(channelsToStop,shutdownNow);
                return; // Just closed input channels. Keep the others open
              }
              iC.stop(channelsToStop,shutdownNow);
            }
          }
          i++;
        } catch (Exception e) {
          if (iC != null) {
            if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
              UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, getClass().getName(),
                      "stopInputChannels", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                      "UIMAEE_unable_to_stop_inputchannel__INFO",
                      new Object[] { getComponentName(), iC.getInputQueueName() });
            }
          } else {
            if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
              UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                      "stopInputChannels", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
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.