Package org.apache.uima.aae.jmx

Examples of org.apache.uima.aae.jmx.ServiceInfo


          String replyQueueName = ((ActiveMQDestination) anEndpoint.getDestination())
                  .getPhysicalName().replaceAll(":", "_");
          if (getAnalysisEngineController() instanceof AggregateAnalysisEngineController) {
            String delegateKey = ((AggregateAnalysisEngineController) getAnalysisEngineController())
                    .lookUpDelegateKey(anEndpoint.getEndpoint());
            ServiceInfo serviceInfo = ((AggregateAnalysisEngineController) getAnalysisEngineController())
                    .getDelegateServiceInfo(delegateKey);
            if (serviceInfo != null) {
              serviceInfo.setReplyQueueName(replyQueueName);
              serviceInfo.setServiceKey(delegateKey);
            }
            delegate = lookupDelegate(delegateKey);
            if (delegate.getGetMetaTimeout() > 0) {
              delegate.startGetMetaRequestTimer();
            }
          }
        } else if (!anEndpoint.isRemote()) {
          ServiceInfo serviceInfo = ((AggregateAnalysisEngineController) getAnalysisEngineController())
                  .getServiceInfo();
          if (serviceInfo != null) {
            serviceInfo.setReplyQueueName(controllerInputEndpoint);
          }
        }
      } else {
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINEST)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(
View Full Code Here


          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, getClass().getName(),
                  "disableDelegates", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAEE_disable_endpoint__INFO", new Object[] { getComponentName(), key });
        }
        // Change state of the delegate
        ServiceInfo sf = getDelegateServiceInfo(key);
        if (sf != null) {
          sf.setState(ServiceState.DISABLED.name());
        }
        synchronized (disabledDelegateList) {
          disabledDelegateList.add(key);
        }
View Full Code Here

        delegateEndpoints[i].setController(this);
        String key = lookUpDelegateKey(delegateEndpoints[i].getEndpoint());
        if (key != null && destinationMap.containsKey(key)) {
          Endpoint endpoint = ((Endpoint) destinationMap.get(key));
          if (key != null && endpoint != null) {
            ServiceInfo serviceInfo = endpoint.getServiceInfo();
            PrimitiveServiceInfo pServiceInfo = new PrimitiveServiceInfo(endpoint.isCasMultiplier(), null);
            pServiceInfo.setBrokerURL(serviceInfo.getBrokerURL());
            pServiceInfo.setInputQueueName(serviceInfo.getInputQueueName());
            if (endpoint.getDestination() != null) {
              pServiceInfo.setReplyQueueName(endpoint.getDestination().toString());
            }
            pServiceInfo.setServiceKey(key);
            pServiceInfo.setState(serviceInfo.getState());
            pServiceInfo.setAnalysisEngineInstanceCount(1);

            registerWithAgent(pServiceInfo, super.getManagementInterface().getJmxDomain()
                    + super.jmxContext + ",r" + remoteIndex + "=" + key
                    + " [Remote Uima EE Service],name=" + key + "_" + serviceInfo.getLabel());

            ServicePerformance servicePerformance = new ServicePerformance();
            // servicePerformance.setIdleTime(System.nanoTime());
            servicePerformance.setRemoteDelegate();
View Full Code Here

        boolean collocatedAggregate = false;
        if ( endpoint.getServiceInfo() != null ) {
          endpoint.getServiceInfo().setState(ServiceState.RUNNING.name());
        }
        ResourceMetaData resource = null;
        ServiceInfo remoteDelegateServiceInfo = null;
        if (aTypeSystem.trim().length() > 0) {
          if (endpoint.isRemote()) {
            System.out.println("Remote Service:" + key
                    + " Initialized. Ready To Process Messages From Queue:"
                    + endpoint.getEndpoint());
            if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.CONFIG)) {
              UIMAFramework.getLogger(CLASS_NAME).logrb(Level.CONFIG, CLASS_NAME.getName(),
                      "mergeTypeSystem", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                      "UIMAEE_remote_delegate_ready__CONFIG",
                      new Object[] { getComponentName(), fromDestination });
            }
          }
          if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.CONFIG)) {
            UIMAFramework.getLogger(CLASS_NAME).logrb(Level.CONFIG, CLASS_NAME.getName(),
                    "mergeTypeSystem", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                    "UIMAEE_merge_ts_from_delegate__CONFIG", new Object[] { fromDestination });
          }
          ByteArrayInputStream bis = new ByteArrayInputStream(aTypeSystem.getBytes());
          XMLInputSource in1 = new XMLInputSource(bis, null);

          resource = UIMAFramework.getXMLParser().parseResourceMetaData(in1);
          if (isStopped()) {
            return;
          }
          getCasManagerWrapper().addMetadata((ProcessingResourceMetaData) resource);
          analysisEngineMetaDataMap.put(key, (ProcessingResourceMetaData) resource);

          if (((ProcessingResourceMetaData) resource).getOperationalProperties()
                  .getOutputsNewCASes()) {
            endpoint.setIsCasMultiplier(true);
            remoteCasMultiplierList.add(key);
          }
          if (endpoint.isRemote()) {
            Object o = null;
            remoteDelegateServiceInfo = getDelegateServiceInfo(key);
            if (remoteDelegateServiceInfo != null
                    && (o = ((ProcessingResourceMetaData) resource)
                            .getConfigurationParameterSettings().getParameterValue(
                                    AnalysisEngineController.AEInstanceCount)) != null) {
              ((PrimitiveServiceInfo) remoteDelegateServiceInfo)
                      .setAnalysisEngineInstanceCount(((Integer) o).intValue());
            }
          }
        } else {
          collocatedAggregate = true;
        }

        endpoint.setInitialized(true);
        // If getMeta request not yet sent, send meta request to all remote delegate
        // Special case when all delegates are remote is handled in the setInputChannel

        synchronized (unregisteredDelegateList) {
          // TODO can't find where this list is checked. Is it still used???
          if (requestForMetaSentToRemotes == false && !allDelegatesAreRemote) {
            String unregisteredDelegateKey = null;
            for (int i = 0; i < unregisteredDelegateList.size(); i++) {
              unregisteredDelegateKey = (String) unregisteredDelegateList.get(i);
              if (unregisteredDelegateKey.equals(key)) {
                unregisteredDelegateList.remove(i);
              }
            }
          }
        }

        // 
        if (collocatedAggregate || resource instanceof ProcessingResourceMetaData) {
          if (allTypeSystemsMerged()) {

            for (int i = 0; i < remoteCasMultiplierList.size(); i++) {
              Endpoint endpt = (Endpoint) destinationMap.get((String) remoteCasMultiplierList
                      .get(i));
              if (endpt != null && endpt.isCasMultiplier() && endpt.isRemote()) {
                System.out.println("Setting Shadow Pool of Size:" + endpt.getShadowPoolSize()
                        + " For Cas Multiplier:" + (String) remoteCasMultiplierList.get(i));
                getCasManagerWrapper().initialize(endpt.getShadowPoolSize(),
                        (String) remoteCasMultiplierList.get(i));
                if (remoteDelegateServiceInfo != null) {
                  remoteDelegateServiceInfo.setCASMultiplier();
                }
              }
            }
            if (!isStopped()) {
              try {
View Full Code Here

    anEndpoint.setController(this);
    anEndpoint.setWaitingForResponse(true);
    String key = lookUpDelegateKey(anEndpoint.getEndpoint());
    if (key != null && !delegateStatMap.containsKey(key)) {
      if (key != null) {
        ServiceInfo serviceInfo = anEndpoint.getServiceInfo();
        PrimitiveServiceInfo pServiceInfo = new PrimitiveServiceInfo(serviceInfo.isCASMultiplier(),null);
        pServiceInfo.setBrokerURL(serviceInfo.getBrokerURL());
        pServiceInfo.setInputQueueName(serviceInfo.getInputQueueName());
        pServiceInfo.setState(serviceInfo.getState());
        pServiceInfo.setAnalysisEngineInstanceCount(1);
        ServicePerformance servicePerformance = new ServicePerformance();
        if (anEndpoint.isRemote()) {
          servicePerformance.setRemoteDelegate();
        }
View Full Code Here

    name = jmxManagement.getJmxDomain() + key_value_list + ",name=" + thisComponentName + "_"
            + servicePerformance.getLabel();

    registerWithAgent(servicePerformance, name);
    servicePerformance.setIdleTime(System.nanoTime());
    ServiceInfo serviceInfo = null;
    if (remote) {
      serviceInfo = getInputChannel().getServiceInfo();
    } else {
      serviceInfo = new ServiceInfo(isCasMultiplier(), this);
      serviceInfo.setBrokerURL(getBrokerURL());
      serviceInfo.setInputQueueName(getName());
      //  if a colocated service, set its key as defined in the AE descriptor
      if ( !this.isTopLevelComponent() ) {
        serviceInfo.setServiceKey(delegateKey);
      }
      //serviceInfo.setState(getState().name());
    }
    ServiceInfo pServiceInfo = null;

    if (this instanceof PrimitiveAnalysisEngineController) {
      pServiceInfo = ((PrimitiveAnalysisEngineController) this).getServiceInfo();
      servicePerformance.setProcessThreadCount(((PrimitiveAnalysisEngineController) this)
              .getServiceInfo().getAnalysisEngineInstanceCount());
    } else {
      pServiceInfo = ((AggregateAnalysisEngineController) this).getServiceInfo();
      pServiceInfo.setAggregate(true);
    }
    // If this is a Cas Multiplier, add the key to the JMX MBean.
    // This will help the JMX Monitor to fetch the CM Cas Pool MBean
    if (isCasMultiplier()) {
      pServiceInfo.setServiceKey(getUimaContextAdmin().getQualifiedContextName());
    }

    if (pServiceInfo != null) {
      name = jmxManagement.getJmxDomain() + key_value_list + ",name=" + thisComponentName + "_"
              + serviceInfo.getLabel();
      if (!isTopLevelComponent()) {
        pServiceInfo.setBrokerURL("Embedded Broker");
      } else {
        pServiceInfo.setTopLevel();
      }
      if (isCasMultiplier()) {
        pServiceInfo.setCASMultiplier();
      }
      registerWithAgent(pServiceInfo, name);
    }

    serviceErrors = new ServiceErrors();
View Full Code Here

    timeSnapshotMap.put(aKey, snapshot);

  }

  public void addServiceInfo(ServiceInfo aServiceInfo) {
    ServiceInfo sInfo = null;

    if (this instanceof PrimitiveAnalysisEngineController) {
      sInfo = ((PrimitiveAnalysisEngineController) this).getServiceInfo();
    } else if (this instanceof AggregateAnalysisEngineController) {
      sInfo = ((AggregateAnalysisEngineController) this).getServiceInfo();
    }
    if (sInfo != null) {
      sInfo.setBrokerURL(aServiceInfo.getBrokerURL());
      sInfo.setInputQueueName(aServiceInfo.getInputQueueName());
      sInfo.setState(aServiceInfo.getState());
      sInfo.setDeploymentDescriptorPath(aeDescriptor);
      if (isCasMultiplier()) {
        sInfo.setCASMultiplier();
      }
    } else {
      System.out.println("!!!!!!!!!!!!!!! ServiceInfo instance is NULL");
    }
View Full Code Here

    return map;
  }

  public void setDeployDescriptor(String aDeployDescriptor) {
    deploymentDescriptor = aDeployDescriptor;
    ServiceInfo serviceInfo = null;
    if (this instanceof PrimitiveAnalysisEngineController) {
      serviceInfo = ((PrimitiveAnalysisEngineController) this).getServiceInfo();
    } else {
      serviceInfo = ((AggregateAnalysisEngineController) this).getServiceInfo();
    }
    if (serviceInfo != null) {
      serviceInfo.setDeploymentDescriptorPath(aeDescriptor);
    }

  }
View Full Code Here

    name = jmxManagement.getJmxDomain() + key_value_list + ",name=" + thisComponentName + "_"
            + servicePerformance.getLabel();

    registerWithAgent(servicePerformance, name);
    servicePerformance.setIdleTime(System.nanoTime());
    ServiceInfo serviceInfo = null;
    if (remote) {
      serviceInfo = getInputChannel().getServiceInfo();
    } else {
      serviceInfo = new ServiceInfo(isCasMultiplier(), this);
      serviceInfo.setBrokerURL(getBrokerURL());
      serviceInfo.setInputQueueName(getName());
      //  if a colocated service, set its key as defined in the AE descriptor
      if ( !this.isTopLevelComponent() ) {
        serviceInfo.setServiceKey(delegateKey);
        //  Modify service performance MBean to expose number
        //  of threads processing replies
        Delegate delegate = ((AggregateAnalysisEngineController) parentController)
          .lookupDelegate(delegateKey);
        if ( delegate != null ) {
          servicePerformance.setReplyThreadCount(delegate.getEndpoint().getConcurrentReplyConsumers());
        }
      }
    }
    ServiceInfo pServiceInfo = null;

    if (this instanceof PrimitiveAnalysisEngineController) {
      pServiceInfo = ((PrimitiveAnalysisEngineController) this).getServiceInfo();
      servicePerformance.setProcessThreadCount(((PrimitiveAnalysisEngineController) this)
              .getServiceInfo().getAnalysisEngineInstanceCount());
    } else {
      pServiceInfo = ((AggregateAnalysisEngineController) this).getServiceInfo();
      pServiceInfo.setAggregate(true);
    }

    if (pServiceInfo != null) {
      // If this is a Cas Multiplier, add the key to the JMX MBean.
      // This will help the JMX Monitor to fetch the CM Cas Pool MBean
      if (isCasMultiplier()) {
        pServiceInfo.setServiceKey(getUimaContextAdmin().getQualifiedContextName());
        pServiceInfo.setCmRegisteredName(getUimaContextAdmin().getUniqueName());
      }

     
      name = jmxManagement.getJmxDomain() + key_value_list + ",name=" + thisComponentName + "_"
              + serviceInfo.getLabel();
      if (!isTopLevelComponent()) {
        pServiceInfo.setBrokerURL("Embedded Broker");
      } else {
        pServiceInfo.setTopLevel();
      }
      if (isCasMultiplier()) {
        pServiceInfo.setCASMultiplier();

      }
      registerWithAgent(pServiceInfo, name);
    }
View Full Code Here

  public String toString() {
    return getComponentName();
  }

  public void addServiceInfo(ServiceInfo aServiceInfo) {
    ServiceInfo sInfo = null;

    if (this instanceof PrimitiveAnalysisEngineController) {
      sInfo = ((PrimitiveAnalysisEngineController) this).getServiceInfo();
    } else if (this instanceof AggregateAnalysisEngineController) {
      sInfo = ((AggregateAnalysisEngineController) this).getServiceInfo();
    }
    if (sInfo != null) {
      sInfo.setBrokerURL(aServiceInfo.getBrokerURL());
      sInfo.setInputQueueName(aServiceInfo.getInputQueueName());
      sInfo.setState(aServiceInfo.getState());
      sInfo.setDeploymentDescriptorPath(aeDescriptor);
      if (isCasMultiplier()) {
        sInfo.setCASMultiplier();
      }
    }

  }
View Full Code Here

TOP

Related Classes of org.apache.uima.aae.jmx.ServiceInfo

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.