Package org.apache.uima.aae.controller

Examples of org.apache.uima.aae.controller.Endpoint


        //  This CAS came in from the CAS Multiplier. Treat it differently than the
        //  input CAS. First, in case the Aggregate needs to send this CAS to the
        //  client, retrieve the client destination by looking up the client endpoint
        //  using input CAS reference id. CASes generated by the CAS multiplier will have
        //  the same Cas Reference id.
        Endpoint replyToEndpoint =
          getController().
            getInProcessCache().
              getCacheEntryForCAS(casReferenceId).getMessageOrigin();
       
        // 
        if ( getController() instanceof AggregateAnalysisEngineController )
        {
          newCASProducedBy =
            ((AggregateAnalysisEngineController)getController()).lookUpDelegateKey(replyToEndpoint.getEndpoint());
        }
        //  MessageContext contains endpoint set by the CAS Multiplier service. Overwrite
        //  this with the endpoint of the client who sent the input CAS. In case this
        //  aggregate is configured to send new CASes to the client we know where to send them.
        aMessageContext.getEndpoint().setEndpoint(replyToEndpoint.getEndpoint());
        aMessageContext.getEndpoint().setServerURI(replyToEndpoint.getServerURI());
        inputCasReferenceId = String.valueOf(casReferenceId);
        //  Set this to null so that the new CAS gets its own Cas Reference Id below
        casReferenceId = null;
      }
     
View Full Code Here


      CAS cas = null;
     
      if ( aMessageContext.propertyExists(AsynchAEMessage.CasSequence) )
      {
        isNewCAS = true;
        Endpoint casMultiplierEndpoint = aMessageContext.getEndpoint();

        if ( casMultiplierEndpoint == null )
        {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                      "handleProcessRequestWithCASReference", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_no_endpoint_for_reply__INFO",
                      new Object[] { casReferenceId });
          return;
        }
        // 
        if ( getController() instanceof AggregateAnalysisEngineController )
        {
          getController().getInProcessCache().setCasProducer(casReferenceId, casMultiplierEndpoint.getEndpoint());
          newCASProducedBy =
            ((AggregateAnalysisEngineController)getController()).lookUpDelegateKey(casMultiplierEndpoint.getEndpoint());
          casMultiplierEndpoint.setIsCasMultiplier(true);
          ((AggregateAnalysisEngineController)getController()).
            getServicePerformance(newCASProducedBy).
              incrementNumberOfCASesProcessed();
          CacheEntry subordinateCasCacheEntry = getController().getInProcessCache().getCacheEntryForCAS(casReferenceId);
          subordinateCasCacheEntry.setReplyReceived();

          CacheEntry inputCasCacheEntry = getController().
            getInProcessCache().
              getCacheEntryForCAS(subordinateCasCacheEntry.getInputCasReferenceId());
          if ( inputCasCacheEntry != null )
          {
            synchronized( inputCasCacheEntry )
            {
//              System.out.println("++++++++ Incrementing Delegate:"+casReferenceId+" Count For Input Cas::"+subordinateCasCacheEntry.getInputCasReferenceId());           
              inputCasCacheEntry.incrementSubordinateCasInPlayCount();
            }
          }
        }
        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, CLASS_NAME.getName(),
                    "handleProcessRequestWithCASReference", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_new_cas__FINE",
                    new Object[] { casReferenceId, newCASProducedBy });
        //  MessageContext contains endpoint set by the CAS Multiplier service. Overwrite
        //  this with the endpoint of the client who sent the input CAS. In case this
        //  aggregate is configured to send new CASes to the client we know where to send them.
//        if ( aMessageContext.getEndpoint() != null )
//        {
//          aMessageContext.getEndpoint().setEndpoint(casMultiplierEndpoint.getEndpoint());
//          aMessageContext.getEndpoint().setServerURI(casMultiplierEndpoint.getServerURI());
//        }
        aMessageContext.getEndpoint().setEndpoint(casMultiplierEndpoint.getEndpoint());
        aMessageContext.getEndpoint().setServerURI(casMultiplierEndpoint.getServerURI());

        inputCasReferenceId = aMessageContext.getMessageStringProperty(AsynchAEMessage.InputCasReference);
      }
      else
      {
View Full Code Here

 
 
 
  private void cacheProcessCommandInClientEndpoint()
  {
    Endpoint clientEndpoint = getController().getClientEndpoint();
    if ( clientEndpoint != null )
    {
      clientEndpoint.setCommand(AsynchAEMessage.Process);
    }
  }
View Full Code Here

  }
 
  private void handleCollectionProcessCompleteRequest(MessageContext aMessageContext)
  throws AsynchAEException
  {
    Endpoint replyToEndpoint = aMessageContext.getEndpoint();
    getController().collectionProcessComplete(replyToEndpoint);
  }
View Full Code Here

        //  This handler handles request for metadata. Check if this is the request for metadata. If not, pass it on
        //  to the next handler in the chain.
        if ( AsynchAEMessage.Request == messageType && AsynchAEMessage.GetMeta == command)
        {

          Endpoint endpoint = ((MessageContext)anObjectToHandle).getEndpoint();
          if ( getController().isTopLevelComponent() )
          {
            endpoint.setCommand( AsynchAEMessage.GetMeta);
            getController().cacheClientEndpoint(endpoint);
          }
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, CLASS_NAME.getName(),
                      "handle", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_handling_metadata_request__FINEST",
                      new Object[] { endpoint.getEndpoint() });

          getController().getControllerLatch().waitUntilInitialized();
          //  Check to see if the controller hasnt been aborted while we were waiting on the latch
          if ( !getController().isStopped())
          {
View Full Code Here

      {
        aCasReferenceId = ":CpC";
      }
      if ( aMessageContext != null && aMessageContext.getEndpoint() != null )
      {
        Endpoint endpoint = lookupEndpoint(aMessageContext.getEndpoint().getEndpoint(), aCasReferenceId);

        if (endpoint != null)
        {
          // Received the response within timeout interval so
          // cancel the running timer
          endpoint.cancelTimer();
          if ( removeEndpoint )
          {
            getController().getInProcessCache().removeEndpoint(aMessageContext.getEndpoint().getEndpoint(), aCasReferenceId);
          }
        }
View Full Code Here

  private void handleProcessResponseWithXMI(MessageContext aMessageContext, String aDelegateKey)
  {
    CAS cas = null;
    String casReferenceId = null;
    Endpoint endpointWithTimer = null;
    try
    {
      casReferenceId = aMessageContext.getMessageStringProperty(AsynchAEMessage.CasReference);
      endpointWithTimer = lookupEndpoint(aMessageContext.getEndpoint().getEndpoint(), casReferenceId);
View Full Code Here

          String endpointName = aMessageContext.getEndpoint().getEndpoint();
          String delegateKey =
            ((AggregateAnalysisEngineController)getController()).lookUpDelegateKey(endpointName);
          if ( delegateKey != null )
          {
            Endpoint endpoint =
              ((AggregateAnalysisEngineController)getController()).lookUpEndpoint(delegateKey, false);

            //  Check if the multiplier aborted during processing of this input CAS
            if ( endpoint != null && endpoint.isCasMultiplier() && cacheEntry.isAborted() )
            {
              if ( !getController().getInProcessCache().isEmpty() )
              {
                getController().getInProcessCache().registerCallbackWhenCacheEmpty(getController().getEventListener());
              }
View Full Code Here

    }

  }
  private void incrementDelegateProcessCount(MessageContext aMessageContext)
  {
    Endpoint endpoint = aMessageContext.getEndpoint();
    if ( endpoint != null && getController() instanceof AggregateAnalysisEngineController)
    {
      try
      {
        String delegateKey = ((AggregateAnalysisEngineController)getController()).lookUpDelegateKey(endpoint.getEndpoint());
        LongNumericStatistic stat = getController().getMonitor().getLongNumericStatistic(delegateKey, Monitor.ProcessCount);
        stat.increment();
      }
      catch( Exception e) {}
    }
View Full Code Here

          String endpointKey ="";

          while( it2.hasNext())
          {
            endpointKey = (String)it2.next();
            Endpoint end = (Endpoint)em.get(endpointKey);
          }
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.aae.controller.Endpoint

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.