Package jade.core.sam

Examples of jade.core.sam.SAMHelper


  private void initializeSAM() {
    //#J2ME_EXCLUDE_BEGIN
    try {
      Service sam = myContainer.getServiceFinder().findService(SAMHelper.SERVICE_NAME);
      if (sam != null) {
        SAMHelper samHelper = (SAMHelper) sam.getHelper(null);
        samActive = true;
       
        // DELIVERY TIME
        deliveryTimeMeasurementRate = DELIVERY_TIME_MEASUREMENT_RATE_DEFAULT;
        try {
          deliveryTimeMeasurementRate = Integer.parseInt(myProfile.getParameter(DELIVERY_TIME_MEASUREMENT_RATE, null));
        }
        catch (Exception e) {
          // Keep default
        }
        if (deliveryTimeMeasurementRate > 0) {
          deliveryTimeMeasureProvider = new AverageMeasureProviderImpl();
          samHelper.addEntityMeasureProvider("Message-Delivery-Time", deliveryTimeMeasureProvider);
        }
       
        // MESSAGE COUNT
        boolean enablePostedMessageCount = "true".equalsIgnoreCase(myProfile.getParameter(ENABLE_POSTED_MESSAGE_COUNT, "false"));
        if (enablePostedMessageCount) {
          samHelper.addCounterValueProvider("Posted-Message-Count", new CounterValueProvider() {
            public long getValue() {
              return postedMessageCounter;
            }
            public boolean isDifferential() {
              return false;
View Full Code Here

TOP

Related Classes of jade.core.sam.SAMHelper

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.