Package org.apache.uima.aae.message

Examples of org.apache.uima.aae.message.MessageContext


      latch.await();
      if (controller != null && controller.isStopped()) {
        return; // throw away the message, we are stopping
      }
      if (UimaMessageValidator.isValidMessage(aMessage, controller)) {
        MessageContext msgContext = aMessage.toMessageContext(controller.getName());
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINEST)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, CLASS_NAME.getName(),
                  "onMessage", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAEE_new_msg_recvd__FINEST",
                  new Object[] { controller.getComponentName(), aMessage.toString() });
View Full Code Here


  }

  public void handle(Object anObjectToHandle) throws AsynchAEException {
    super.validate(anObjectToHandle);
    MessageContext messageContext = (MessageContext) anObjectToHandle;

    if (isHandlerForMessage(messageContext, AsynchAEMessage.Response, AsynchAEMessage.Process)
            || isHandlerForMessage(messageContext, AsynchAEMessage.Response, AsynchAEMessage.ACK)
            || isHandlerForMessage(messageContext, AsynchAEMessage.Response,
                    AsynchAEMessage.ServiceInfo)
            || isHandlerForMessage(messageContext, AsynchAEMessage.Response,
                    AsynchAEMessage.CollectionProcessComplete)) {
      int payload = messageContext.getMessageIntProperty(AsynchAEMessage.Payload);
      int command = messageContext.getMessageIntProperty(AsynchAEMessage.Command);
      String delegate = ((Endpoint) messageContext.getEndpoint()).getEndpoint();
      String key = null;
      String fromServer = null;
      if (getController() instanceof AggregateAnalysisEngineController) {
        if (((Endpoint) messageContext.getEndpoint()).isRemote()) {
          if (((MessageContext) anObjectToHandle).propertyExists(AsynchAEMessage.EndpointServer)) {
            fromServer = ((MessageContext) anObjectToHandle)
                    .getMessageStringProperty(AsynchAEMessage.EndpointServer);
          }
          // If old service does not echo back the external broker name then the queue name must be
          // unique.
          // Can't use the ServerURI set by the service as it may be its local name for the broker,
          // e.g. tcp://localhost:61616
        }

        key = ((AggregateAnalysisEngineController) getController()).lookUpDelegateKey(delegate,
                fromServer);
      }
      if (AsynchAEMessage.CASRefID == payload) {

        handleProcessResponseWithCASReference(messageContext);
        if (key != null) {
          resetErrorCounts(key);
        }
      } else if (AsynchAEMessage.XMIPayload == payload || AsynchAEMessage.BinaryPayload == payload) {
        handleProcessResponseFromRemote(messageContext, key);
        if (key != null) {
          resetErrorCounts(key);
        }
      } else if (AsynchAEMessage.Exception == payload) {
        if (key == null) {
          key = ((Endpoint) messageContext.getEndpoint()).getEndpoint();
        }
        handleProcessResponseWithException(messageContext, key);
      } else if (AsynchAEMessage.None == payload
              && AsynchAEMessage.CollectionProcessComplete == command) {
        if (key == null) {
          key = ((Endpoint) messageContext.getEndpoint()).getEndpoint();
        }
        handleCollectionProcessCompleteReply(messageContext, key);
      } else if (AsynchAEMessage.None == payload && AsynchAEMessage.ACK == command) {
        handleACK(messageContext);
      } else if (AsynchAEMessage.None == payload && AsynchAEMessage.Ping == command) {
View Full Code Here

  public void handle(Object anObjectToHandle) // throws AsynchAEException
  {
    try {
      super.validate(anObjectToHandle);

      MessageContext messageContext = (MessageContext) anObjectToHandle;
      if (isHandlerForMessage(messageContext, AsynchAEMessage.Request, AsynchAEMessage.Process)
              || isHandlerForMessage(messageContext, AsynchAEMessage.Request,
                      AsynchAEMessage.CollectionProcessComplete)
              || isHandlerForMessage(messageContext, AsynchAEMessage.Request,
                      AsynchAEMessage.ReleaseCAS)
              || isHandlerForMessage(messageContext, AsynchAEMessage.Request, AsynchAEMessage.Stop)) {
        int payload = messageContext.getMessageIntProperty(AsynchAEMessage.Payload);
        int command = messageContext.getMessageIntProperty(AsynchAEMessage.Command);

        getController().getControllerLatch().waitUntilInitialized();

        // If a Process Request, increment number of CASes processed
        if (messageContext.getMessageIntProperty(AsynchAEMessage.MessageType) == AsynchAEMessage.Request
                && command == AsynchAEMessage.Process
                && !messageContext.propertyExists(AsynchAEMessage.CasSequence)) {
          // Increment number of CASes processed by this service
          getController().getServicePerformance().incrementNumberOfCASesProcessed();
        }
        if (getController().isStopped()) {
          return;
View Full Code Here

            // The controller is stopping
            return;
          }
        }
        OutOfTypeSystemData otsd = getInProcessCache().getOutOfTypeSystemData(aCasReferenceId);
        MessageContext mContext = getInProcessCache()
                .getMessageAccessorByReference(aCasReferenceId);
        CacheEntry newEntry = getInProcessCache().register(casProduced, mContext, otsd);
        // if this Cas Multiplier is not Top Level service, add new Cas Id to the private
        // cache of the parent aggregate controller. The Aggregate needs to know about
        // all CASes it has in play that were generated from the input CAS.
View Full Code Here

  public void handle(Object anObjectToHandle) // throws AsynchAEException
  {
    try {
      super.validate(anObjectToHandle);

      MessageContext messageContext = (MessageContext) anObjectToHandle;
      if (isHandlerForMessage(messageContext, AsynchAEMessage.Request, AsynchAEMessage.Process)
              || isHandlerForMessage(messageContext, AsynchAEMessage.Request,
                      AsynchAEMessage.CollectionProcessComplete)
              || isHandlerForMessage(messageContext, AsynchAEMessage.Request,
                      AsynchAEMessage.ReleaseCAS)
              || isHandlerForMessage(messageContext, AsynchAEMessage.Request, AsynchAEMessage.Stop)) {
        int payload = messageContext.getMessageIntProperty(AsynchAEMessage.Payload);
        int command = messageContext.getMessageIntProperty(AsynchAEMessage.Command);

        getController().getControllerLatch().waitUntilInitialized();

        // If a Process Request, increment number of CASes processed
        if (messageContext.getMessageIntProperty(AsynchAEMessage.MessageType) == AsynchAEMessage.Request
                && command == AsynchAEMessage.Process
                && !messageContext.propertyExists(AsynchAEMessage.CasSequence)) {
          // Increment number of CASes processed by this service
          getController().getServicePerformance().incrementNumberOfCASesProcessed();
        }
        if (getController().isStopped()) {
          return;
View Full Code Here

  }

  public void handle(Object anObjectToHandle) throws AsynchAEException {
    super.validate(anObjectToHandle);
    MessageContext messageContext = (MessageContext) anObjectToHandle;

    if (isHandlerForMessage(messageContext, AsynchAEMessage.Response, AsynchAEMessage.Process)
            || isHandlerForMessage(messageContext, AsynchAEMessage.Response, AsynchAEMessage.ACK)
            || isHandlerForMessage(messageContext, AsynchAEMessage.Response,
                    AsynchAEMessage.ServiceInfo)
            || isHandlerForMessage(messageContext, AsynchAEMessage.Response,
                    AsynchAEMessage.CollectionProcessComplete)) {
      int payload = messageContext.getMessageIntProperty(AsynchAEMessage.Payload);
      int command = messageContext.getMessageIntProperty(AsynchAEMessage.Command);
      String delegate = ((Endpoint) messageContext.getEndpoint()).getEndpoint();
      String key = null;
      String fromServer = null;
      if (getController() instanceof AggregateAnalysisEngineController) {
        if (((Endpoint) messageContext.getEndpoint()).isRemote()) {
          if (((MessageContext) anObjectToHandle).propertyExists(AsynchAEMessage.EndpointServer)) {
            fromServer = ((MessageContext) anObjectToHandle)
                    .getMessageStringProperty(AsynchAEMessage.EndpointServer);
          }
          // If old service does not echo back the external broker name then the queue name must be
          // unique.
          // Can't use the ServerURI set by the service as it may be its local name for the broker,
          // e.g. tcp://localhost:61616
        }

        key = ((AggregateAnalysisEngineController) getController()).lookUpDelegateKey(delegate,
                fromServer);
      }
      if (AsynchAEMessage.CASRefID == payload) {

        handleProcessResponseWithCASReference(messageContext);
        if (key != null) {
          resetErrorCounts(key);
        }
      } else if (AsynchAEMessage.XMIPayload == payload || AsynchAEMessage.BinaryPayload == payload) {
        handleProcessResponseFromRemote(messageContext, key);
        if (key != null) {
          resetErrorCounts(key);
        }
      } else if (AsynchAEMessage.Exception == payload) {
        if (key == null) {
          key = ((Endpoint) messageContext.getEndpoint()).getEndpoint();
        }
        handleProcessResponseWithException(messageContext, key);
      } else if (AsynchAEMessage.None == payload
              && AsynchAEMessage.CollectionProcessComplete == command) {
        if (key == null) {
          key = ((Endpoint) messageContext.getEndpoint()).getEndpoint();
        }
        handleCollectionProcessCompleteReply(messageContext, key);
      } else if (AsynchAEMessage.None == payload && AsynchAEMessage.ACK == command) {
        handleACK(messageContext, key);
      } else if (AsynchAEMessage.None == payload && AsynchAEMessage.Ping == command) {
View Full Code Here

  public void handle(Object anObjectToHandle) // throws AsynchAEException
  {
    try {
      super.validate(anObjectToHandle);

      MessageContext messageContext = (MessageContext) anObjectToHandle;
      if (isHandlerForMessage(messageContext, AsynchAEMessage.Request, AsynchAEMessage.Process)
              || isHandlerForMessage(messageContext, AsynchAEMessage.Request,
                      AsynchAEMessage.CollectionProcessComplete)
              || isHandlerForMessage(messageContext, AsynchAEMessage.Request,
                      AsynchAEMessage.ReleaseCAS)
              || isHandlerForMessage(messageContext, AsynchAEMessage.Request, AsynchAEMessage.Stop)) {
        int payload = messageContext.getMessageIntProperty(AsynchAEMessage.Payload);
        int command = messageContext.getMessageIntProperty(AsynchAEMessage.Command);

        getController().getControllerLatch().waitUntilInitialized();

        // If a Process Request, increment number of CASes processed
        if (messageContext.getMessageIntProperty(AsynchAEMessage.MessageType) == AsynchAEMessage.Request
                && command == AsynchAEMessage.Process
                && !messageContext.propertyExists(AsynchAEMessage.CasSequence)) {
          // Increment number of CASes processed by this service
          getController().getServicePerformance().incrementNumberOfCASesProcessed();
        }
        if (getController().isStopped()) {
          return;
View Full Code Here

      latch.await();
      if (controller != null && controller.isStopped()) {
        return; // throw away the message, we are stopping
      }
      if (UimaMessageValidator.isValidMessage(aMessage, controller)) {
        MessageContext msgContext = aMessage.toMessageContext(controller.getName());
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINEST)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, CLASS_NAME.getName(),
                  "onMessage", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAEE_new_msg_recvd__FINEST",
                  new Object[] { controller.getComponentName(), aMessage.toString() });
View Full Code Here

  }

  public void handle(Object anObjectToHandle) throws AsynchAEException {
    super.validate(anObjectToHandle);
    MessageContext messageContext = (MessageContext) anObjectToHandle;

    if (isHandlerForMessage(messageContext, AsynchAEMessage.Response, AsynchAEMessage.Process)
            || isHandlerForMessage(messageContext, AsynchAEMessage.Response, AsynchAEMessage.ACK)
            || isHandlerForMessage(messageContext, AsynchAEMessage.Response,
                    AsynchAEMessage.ServiceInfo)
            || isHandlerForMessage(messageContext, AsynchAEMessage.Response,
                    AsynchAEMessage.CollectionProcessComplete)) {
      int payload = messageContext.getMessageIntProperty(AsynchAEMessage.Payload);
      int command = messageContext.getMessageIntProperty(AsynchAEMessage.Command);
      String delegate = ((Endpoint) messageContext.getEndpoint()).getEndpoint();
      String key = null;
      String fromServer = null;
      if (getController() instanceof AggregateAnalysisEngineController) {
        if (((Endpoint) messageContext.getEndpoint()).isRemote()) {
          if (((MessageContext) anObjectToHandle).propertyExists(AsynchAEMessage.EndpointServer)) {
            fromServer = ((MessageContext) anObjectToHandle)
                    .getMessageStringProperty(AsynchAEMessage.EndpointServer);
          }
          // If old service does not echo back the external broker name then the queue name must be
          // unique.
          // Can't use the ServerURI set by the service as it may be its local name for the broker,
          // e.g. tcp://localhost:61616
        }

        key = ((AggregateAnalysisEngineController) getController()).lookUpDelegateKey(delegate,
                fromServer);
      }
      if (AsynchAEMessage.CASRefID == payload) {

        handleProcessResponseWithCASReference(messageContext);
        if (key != null) {
          resetErrorCounts(key);
        }
      } else if (AsynchAEMessage.XMIPayload == payload || AsynchAEMessage.BinaryPayload == payload) {
        handleProcessResponseFromRemote(messageContext, key);
        if (key != null) {
          resetErrorCounts(key);
        }
      } else if (AsynchAEMessage.Exception == payload) {
        if (key == null) {
          key = ((Endpoint) messageContext.getEndpoint()).getEndpoint();
        }
        handleProcessResponseWithException(messageContext, key);
      } else if (AsynchAEMessage.None == payload
              && AsynchAEMessage.CollectionProcessComplete == command) {
        if (key == null) {
          key = ((Endpoint) messageContext.getEndpoint()).getEndpoint();
        }
        handleCollectionProcessCompleteReply(messageContext, key);
      } else if (AsynchAEMessage.None == payload && AsynchAEMessage.ACK == command) {
        handleACK(messageContext, key);
      } else if (AsynchAEMessage.None == payload && AsynchAEMessage.Ping == command) {
View Full Code Here

            // The controller is stopping
            return;
          }
        }
        OutOfTypeSystemData otsd = getInProcessCache().getOutOfTypeSystemData(aCasReferenceId);
        MessageContext mContext = getInProcessCache()
                .getMessageAccessorByReference(aCasReferenceId);
        CacheEntry newEntry = getInProcessCache().register(casProduced, mContext, otsd);
        // if this Cas Multiplier is not Top Level service, add new Cas Id to the private
        // cache of the parent aggregate controller. The Aggregate needs to know about
        // all CASes it has in play that were generated from the input CAS.
View Full Code Here

TOP

Related Classes of org.apache.uima.aae.message.MessageContext

Copyright © 2018 www.massapicom. 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.