/*
(non-Javadoc)
@see org.fcrepo.server.management.FedoraAPIMMTOM#ingest(javax.activation.
DataHandler objectXML ,)String format ,)String logMessage )*
331706
@Override
    public String ingest(byte[] objectXML, String format, String logMessage) {
        LOG.debug("start: ingest");
        assertInitialized();
        try {
            // always gens pid, unless pid in stream starts with "test:" "demo:"
            // or other prefix that is configured in the retainPIDs parameter of
            // fedora.fcfg
            MessageContext ctx = context.getMessageContext();
            return m_management.ingest(ReadOnlyContext.getSoapContext(ctx),
                                       new ByteArrayInputStream(objectXML),
                                       logMessage,
                                       format,
                                       "UTF-8",
                                       "new");
        } catch (Throwable th) {
            LOG.error("Error ingesting", th);
            throw CXFUtility.getFault(th);
        } finally {
            LOG.debug("end: ingest");
        }
    }
512030
String formatMessage(int msgLogLevel, String tag, String msg, Throwable exception) {
        if (exception != null) {
            return DateHelper.getUTC(System.currentTimeMillis()) + "/" + getLevelTag(msgLogLevel) + tag + ": " + msg + "\n" + getStackTrace(exception) + "\n";
        } else {
            return DateHelper.getUTC(System.currentTimeMillis()) + "/" + getLevelTag(msgLogLevel) + tag + ": " + msg + "\n";
        }
    }
950031
protected void catching(final String fqcn, final Level level, final Throwable t) {
        if (isEnabled(level, CATCHING_MARKER, (Object) null, null)) {
            logMessageSafely(fqcn, level, CATCHING_MARKER, catchingMsg(t), t);
        }
    }
123852
def _ingest_source(self, source, ps, force=None):
        """"""
        from ambry.bundle.process import call_interval

        try:

            from ambry.orm.exc import NotFoundError

            if not source.is_partition and source.datafile.exists:

                if not source.datafile.is_finalized:
                    source.datafile.remove()
                elif force:
                    source.datafile.remove()
                else:
                    ps.update(
                        message='Source {} already ingested, skipping'.format(source.name),
                        state='skipped')
                    return True

            if source.is_partition:
                # Check if the partition exists
                try:
                    self.library.partition(source.ref)
                except NotFoundError:
                    # Maybe it is an internal reference, in which case we can just delay
                    # until the partition is built
                    ps.update(message="Not Ingesting {}: referenced partition '{}' does not exist"
                              .format(source.name, source.ref), state='skipped')
                    return True

            source.state = source.STATES.INGESTING

            iterable_source, source_pipe = self.source_pipe(source, ps)

            if not source.is_ingestible:
                ps.update(message='Not an ingestiable source: {}'.format(source.name),
                          state='skipped', source=source)
                source.state = source.STATES.NOTINGESTABLE

                return True

            ps.update('Ingesting {} from {}'.format(source.spec.name, source.url or source.generator),
                      item_type='rows', item_count=0)

            @call_interval(5)
            def ingest_progress_f(i):
                (desc, n_records, total, rate) = source.datafile.report_progress()

                ps.update(
                    message='Ingesting {}: rate: {}'.format(source.spec.name, rate), item_count=n_records)

            source.datafile.load_rows(iterable_source,
                                      callback=ingest_progress_f,
                                      limit=500 if self.limited_run else None,
                                      intuit_type=True, run_stats=False)

            if source.datafile.meta['warnings']:
                for w in source.datafile.meta['warnings']:
                    self.error("Ingestion error: {}".format(w))

            ps.update(message='Ingested to {}'.format(source.datafile.syspath))

            ps.update(message='Updating tables and specs for {}'.format(source.name))

            # source.update_table()  # Generate the source tables.
            source.update_spec()  # Update header_lines, start_line, etc.

            if self.limited_run:
                source.end_line = None  # Otherwize, it will be 500

            self.build_source_files.sources.objects_to_record()

            ps.update(message='Ingested {}'.format(source.datafile.path), state='done')
            source.state = source.STATES.INGESTED
            self.commit()

            return True

        except Exception as e:
            import traceback
            from ambry.util import qualified_class_name

            ps.update(
                message='Source {} failed with exception: {}'.format(source.name, e),
                exception_class=qualified_class_name(e),
                exception_trace=str(traceback.format_exc()),
                state='error'
            )

            source.state = source.STATES.INGESTING + '_error'
            self.commit()
            return False
1046851
static void logE(Object targetObj, String msg) {
        Log.e(TAG, toLogStr(targetObj, msg));
    }
1224451
public void xml(String xml) {
    if (LogLevel.DEBUG < logConfiguration.logLevel) {
      return;
    }
    printlnInternal(LogLevel.DEBUG, logConfiguration.xmlFormatter.format(xml));
  }
314471
def ingest(self):
        
        self.log.debug('starting the ``get`` method')

        dictList = self._create_dictionary_of_veron()

        tableName = self.dbTableName
        createStatement = """
    CREATE TABLE `%(tableName)s` (
      `primaryId` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'An internal counter',
      `B_V` float DEFAULT NULL,
      `U_B` float DEFAULT NULL,
      `abs_magnitude` float DEFAULT NULL,
      `dateCreated` datetime DEFAULT  CURRENT_TIMESTAMP,
      `decDeg` double DEFAULT NULL,
      `magnitude` float DEFAULT NULL,
      `raDeg` double DEFAULT NULL,
      `class` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
      `name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
      `redshift` float DEFAULT NULL,
      `not_radio` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
      `magnitude_filter` varchar(10) COLLATE utf8_unicode_ci DEFAULT 'V',
      `htm16ID` bigint(20) DEFAULT NULL,
      `redshift_flag` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
      `spectral_classification` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
      `dateLastModified` datetime DEFAULT CURRENT_TIMESTAMP,
      `updated` varchar(45) DEFAULT '0',
      `htm10ID` bigint(20) DEFAULT NULL,
      `htm13ID` bigint(20) DEFAULT NULL,
      PRIMARY KEY (`primaryId`),
      UNIQUE KEY `radeg_decdeg` (`raDeg`,`decDeg`),
      KEY `idx_htm16ID` (`htm16ID`),
      KEY `idx_htm10ID` (`htm10ID`),
      KEY `idx_htm13ID` (`htm13ID`)
    ) ENGINE=MyISAM AUTO_INCREMENT=168945 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
""" % locals()

        self.add_data_to_database_table(
            dictList=dictList,
            createStatement=createStatement
        )

        self.log.debug('completed the ``get`` method')
        return None
1217851
protected byte[] getLogMessage(final ObjectNode event) {
        try(ByteArrayBuilder buf = new ByteArrayBuilder()){
            mapper.writeValue(buf, event);
            buf.append('\n');
            return buf.toByteArray();
        } catch (IOException e) {
            addError("while serializing log event", e);
            return NADA;
        }
    }
785534
@Override
	public void setContent(final Object content, final String type) throws MessagingException
	{
		charset = EmailExtensions.getCharsetFromContentType(type);
		super.setContent(content, type);
	}
27327
func (k *KafkaSpanSink) Ingest(span *ssf.SSFSpan) error {
	samples := &ssf.Samples{}
	defer metrics.Report(k.traceClient, samples)
	// If we're sampling less than 100%, we should check whether a span should
	// be sampled:
	if k.sampleTag != "" || k.sampleThreshold < uint32(math.MaxUint32) {
		var hashKey uint32
		var sampleTagValue string

		if k.sampleTag == "" {
			// If we haven't set a sampleTag, we'll be hashing based on the traceID

			sampleTagValue = strconv.FormatInt(span.TraceId, 10)
		} else {
			// If we've set a sampleTag, we'll be hashing based off of that tag's value.

			var exists bool
			sampleTagValue, exists = span.Tags[k.sampleTag]
			if !exists {
				// If the span isn't tagged appropriately, we should drop it, regardless
				// of our sample rate.
				k.logger.Debug("Rejected span without appropriate tag")
				samples.Add(ssf.Count(sinks.MetricKeyTotalSpansDropped, 1, map[string]string{"sink": k.Name()}))
				return nil
			}
		}

		// Lifted from https://github.com/stathat/consistent/blob/75142be0209ec69bb014c7a1ac7d1a3c892c6424/consistent.go#L238-L245:
		// if the sample tag value that we're hashing is shorter than 64 bytes, we
		// need to pad it with zeroes for the crc32.ChecksumIEEE function.
		if len(sampleTagValue) < 64 {
			var scratch [64]byte
			copy(scratch[:], sampleTagValue)
			hashKey = crc32.ChecksumIEEE(scratch[:len(sampleTagValue)])
		} else {
			hashKey = crc32.ChecksumIEEE([]byte(sampleTagValue))
		}

		// Reject any spans whose hash keys end up greater than the threshold that
		// we previously computed.
		if hashKey > k.sampleThreshold {
			k.logger.WithField("traceId", span.TraceId).WithField("sampleTag", k.sampleTag).WithField("sampleTagValue", sampleTagValue).WithField("hashKey", hashKey).WithField("sampleThreshold", k.sampleThreshold).Debug("Rejected span based off of sampling rules")
			samples.Add(ssf.Count(sinks.MetricKeyTotalSpansSkipped, 1, map[string]string{"sink": k.Name()}))
			return nil
		}
	}
	var enc sarama.Encoder
	switch k.serializer {
	case "json":
		j, err := json.Marshal(span)
		if err != nil {
			k.logger.Error("Error marshalling span")
			samples.Add(ssf.Count("kafka.span_marshal_error_total", 1, nil))
			return err
		}
		enc = sarama.StringEncoder(j)
	case "protobuf":
		p, err := proto.Marshal(span)
		if err != nil {
			k.logger.Error("Error marshalling span")
			samples.Add(ssf.Count("kafka.span_marshal_error_total", 1, nil))
			return err
		}
		enc = sarama.ByteEncoder(p)
	default:
		return fmt.Errorf("Unknown serialization format for encoding Kafka message: %s", k.serializer)
	}

	message := &sarama.ProducerMessage{
		Topic: k.topic,
		Value: enc,
	}

	select {
	case k.producer.Input() <- message:
		atomic.AddInt64(&k.spansFlushed, 1)
		return nil
	case _ = <-time.After(IngestTimeout):
		return IngestTimeoutError
	}
}
1253709
@Override
    public void processXML() throws InjectionException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "processXML : " + ivNameSpaceConfig.getPersistenceContextRefs());

        // d416151.3 Begins
        List<? extends PersistenceContextRef> pCtxtRefs = ivNameSpaceConfig.getPersistenceContextRefs();
        if (pCtxtRefs != null && pCtxtRefs.size() > 0)
        {
            for (PersistenceContextRef pCtxtRef : pCtxtRefs)
            {
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, " pCtxtRef = " + pCtxtRef);

                // If XML has previously been read and an injection binding with the same
                // jndi name has been created, get the current injection binding and merge
                // the new PersistenceContext Ref into it.
                String jndiName = pCtxtRef.getName();
                InjectionBinding<PersistenceContext> injectionBinding = ivAllAnnotationsCollection.get(jndiName);
                if (injectionBinding != null)
                {
                    ((JPAPCtxtInjectionBinding) injectionBinding).merge(pCtxtRef);
                }
                else
                {
                    injectionBinding = new JPAPCtxtInjectionBinding(pCtxtRef, ivNameSpaceConfig, ivAttributeAccessor); // d662814
                    addInjectionBinding(injectionBinding);
                }

                ((AbstractJPAInjectionBinding<?>) injectionBinding).addRefComponents(jndiName); // F743-30682

                // Process any injection-targets that may be specified.    d429866.1
                // The code takes into account the possibility of duplicate InjectionTargets
                // and will only add if not already present, regardless of whether this is
                // a newly created binding, or a second one being merged.
                List<InjectionTarget> targets = pCtxtRef.getInjectionTargets();
                if (targets != null && !targets.isEmpty())
                {
                    for (InjectionTarget target : targets)
                    {
                        String injectionClassName = target.getInjectionTargetClassName();
                        String injectionName = target.getInjectionTargetName();
                        injectionBinding.addInjectionTarget(EntityManager.class,
                                                            injectionName,
                                                            injectionClassName);
                    }
                }
            }
        }
        // d416151.3 Ends
        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "processXML : " + ivAllAnnotationsCollection.size());
    }
1083661
def _ingest_dict(self, input_dict, schema_dict, path_to_root):

        '''
            
        '''

        valid_dict = {}

    # construct path to root for rules
        rules_path_to_root = re.sub('\[\d+\]', '[0]', path_to_root)

    # iterate over keys in schema dict
        for key, value in schema_dict.items():
            key_path = path_to_root
            if not key_path == '.':
                key_path += '.'
            key_path += key
            rules_key_path = re.sub('\[\d+\]', '[0]', key_path)
            value_match = False
            if key in input_dict.keys():
                value_index = self._datatype_classes.index(value.__class__)
                value_type = self._datatype_names[value_index]
                try:
                    v_index = self._datatype_classes.index(input_dict[key].__class__)
                    v_type = self._datatype_names[v_index]
                    if v_type == value_type:
                        value_match = True
                except:
                    value_match = False
            if value_match:
                if value_type == 'null':
                    valid_dict[key] = input_dict[key]
                elif value_type == 'boolean':
                    valid_dict[key] = self._ingest_boolean(input_dict[key], key_path)
                elif value_type == 'number':
                    valid_dict[key] = self._ingest_number(input_dict[key], key_path)
                elif value_type == 'string':
                    valid_dict[key] = self._ingest_string(input_dict[key], key_path)
                elif value_type == 'map':
                    valid_dict[key] = self._ingest_dict(input_dict[key], schema_dict[key], key_path)
                elif value_type == 'list':
                    valid_dict[key] = self._ingest_list(input_dict[key], schema_dict[key], key_path)
            else:
                value_type = self.keyMap[rules_key_path]['value_datatype']
                if 'default_value' in self.keyMap[rules_key_path]:
                    valid_dict[key] = self.keyMap[rules_key_path]['default_value']
                elif value_type == 'null':
                    valid_dict[key] = None
                elif value_type == 'boolean':
                    valid_dict[key] = False
                elif value_type == 'number':
                    valid_dict[key] = 0.0
                    if 'integer_data' in self.keyMap[rules_key_path].keys():
                        if self.keyMap[rules_key_path]['integer_data']:
                            valid_dict[key] = 0
                elif value_type == 'string':
                    valid_dict[key] = ''
                elif value_type == 'list':
                    valid_dict[key] = []
                elif value_type == 'map':
                    valid_dict[key] = self._ingest_dict({}, schema_dict[key], key_path)

    # add extra fields if set to True
        if self.keyMap[rules_path_to_root]['extra_fields']:
            for key, value in input_dict.items():
                if key not in valid_dict.keys():
                    valid_dict[key] = value

        return valid_dict
764143
public void serialize(XLog log, OutputStream out) throws IOException {
		XLogging.log("start serializing log to MXML", XLogging.Importance.DEBUG);
		long start = System.currentTimeMillis();
		SXDocument doc = new SXDocument(out);
		doc.addComment("This file has been generated with the OpenXES library. It conforms");
		doc.addComment("to the legacy MXML standard for log storage and management.");
		doc.addComment("OpenXES library version: "
				+ XRuntimeUtils.OPENXES_VERSION);
		doc.addComment("OpenXES is available from http://www.xes-standard.org/");
		SXTag root = doc.addNode("WorkflowLog");
		SXTag source = root.addChildNode("Source");
		source.addAttribute("program", "XES MXML serialization");
		source.addAttribute("openxes.version", XRuntimeUtils.OPENXES_VERSION);
		SXTag process = root.addChildNode("Process");
		String id = XConceptExtension.instance().extractName(log);
		process.addAttribute("id", (id == null ? "none" : id));
		process.addAttribute("description", "process with id "
				+ XConceptExtension.instance().extractName(log));
		addModelReference(log, process);
		addAttributes(process, log.getAttributes().values());
		for (XTrace trace : log) {
			SXTag instance = process.addChildNode("ProcessInstance");
			instance.addAttribute("id", XConceptExtension.instance()
					.extractName(trace));
			instance.addAttribute("description", "instance with id "
					+ XConceptExtension.instance().extractName(trace));
			addModelReference(trace, instance);
			addAttributes(instance, trace.getAttributes().values());
			for (XEvent event : trace) {
				SXTag ate = instance.addChildNode("AuditTrailEntry");
				addAttributes(ate, event.getAttributes().values());
				SXTag wfme = ate.addChildNode("WorkflowModelElement");
				addModelReference(event, wfme);
				wfme.addTextNode(XConceptExtension.instance()
						.extractName(event));
				SXTag type = ate.addChildNode("EventType");
				XAttributeLiteral typeAttr = (XAttributeLiteral) event
						.getAttributes()
						.get(XLifecycleExtension.KEY_TRANSITION);
				if (typeAttr != null) {
					addModelReference(typeAttr, type);
					String typeStr = typeAttr.getValue().trim().toLowerCase();
					if (knownTypes.contains(typeStr)) {
						type.addTextNode(typeStr);
					} else {
						type.addAttribute("unknownType", typeAttr.getValue());
						type.addTextNode("unknown");
					}
				} else {
					type.addTextNode("complete");
				}
				XAttributeLiteral originatorAttr = (XAttributeLiteral) event
						.getAttributes().get(
								XOrganizationalExtension.KEY_RESOURCE);
				if (originatorAttr == null) {
					originatorAttr = (XAttributeLiteral) event.getAttributes()
							.get(XOrganizationalExtension.KEY_ROLE);
				}
				if (originatorAttr == null) {
					originatorAttr = (XAttributeLiteral) event.getAttributes()
							.get(XOrganizationalExtension.KEY_GROUP);
				}
				if (originatorAttr != null) {
					SXTag originator = ate.addChildNode("originator");
					addModelReference(originatorAttr, originator);
					originator.addTextNode(originatorAttr.getValue());
				}
				XAttributeTimestamp timestampAttr = (XAttributeTimestamp) event
						.getAttributes().get(XTimeExtension.KEY_TIMESTAMP);
				if (timestampAttr != null) {
					SXTag timestamp = ate.addChildNode("timestamp");
					addModelReference(timestampAttr, timestamp);
					Date date = timestampAttr.getValue();
					timestamp.addTextNode(xsDateTimeConversion.format(date));
				}
			}
		}
		doc.close();
		String duration = " (" + (System.currentTimeMillis() - start)
				+ " msec.)";
		XLogging.log("finished serializing log" + duration,
				XLogging.Importance.DEBUG);
	}
754505
public static void multiFromDirectory(File dir,
                                          String ingestFormat,
                                          FedoraAPIAMTOM targetRepoAPIA,
                                          FedoraAPIMMTOM targetRepoAPIM,
                                          String logMessage,
                                          PrintStream log,
                                          IngestCounter c) throws Exception {
        File[] files = dir.listFiles();
        if (files == null) {
            throw new RuntimeException("Could not read files from directory "
                    + dir.getPath());
        }

        Arrays.sort(files, _FILE_COMPARATOR);
        for (File element : files) {
            if (!element.isHidden() && !element.getName().startsWith(".")) {
                if (element.isDirectory()) {
                    multiFromDirectory(element,
                                       ingestFormat,
                                       targetRepoAPIA,
                                       targetRepoAPIM,
                                       logMessage,
                                       log,
                                       c);
                } else {
                    try {
                        String pid =
                                oneFromFile(element,
                                            ingestFormat,
                                            targetRepoAPIA,
                                            targetRepoAPIM,
                                            logMessage);
                        c.successes++;
                        IngestLogger.logFromFile(log, element, pid);
                    } catch (Exception e) {
                        // failed... just log it and continue
                        c.failures++;
                        IngestLogger.logFailedFromFile(log, element, e);
                    }
                }
            }
        }
    }
445635
func (gs *GRPCSpanSink) Ingest(ssfSpan *ssf.SSFSpan) error {
	if err := protocol.ValidateTrace(ssfSpan); err != nil {
		return err
	}

	ctx := metadata.AppendToOutgoingContext(ocontext.Background(), "x-veneur-trace-id", strconv.FormatInt(ssfSpan.TraceId, 16))
	_, err := gs.ssc.SendSpan(ctx, ssfSpan)

	if err != nil {
		atomic.AddUint32(&gs.dropCount, 1)

		// gRPC guarantees that an error returned from an RPC call will be of
		// type status.Status. In the unexpected event that they're not, this
		// call creates a dummy type, so there's no risk of panic.
		serr := status.Convert(err)
		state := gs.grpcConn.GetState()

		// Log all errors that occur in Ready state - that's weird. Otherwise,
		// Log only one error per underlying connection state transition. This
		// should be a reasonable heuristic to get an indicator that problems
		// are occurring, without resulting in massive log spew while
		// connections are under duress.
		if state == connectivity.Ready || atomic.CompareAndSwapUint32(&gs.loggedSinceTransition, 0, 1) {
			gs.log.WithFields(logrus.Fields{
				logrus.ErrorKey: err,
				"target":        gs.target,
				"name":          gs.name,
				"chanstate":     state.String(),
				"code":          serr.Code(),
				"details":       serr.Details(),
				"message":       serr.Message(),
			}).Error("Error sending span to gRPC sink target")
		}
	} else {
		atomic.AddUint32(&gs.sentCount, 1)
	}

	return err
}
470765
public static void format(LogData logData, SimpleLogHandler receiver) {
    Metadata metadata = logData.getMetadata();
    Throwable thrown = metadata.findValue(LogContext.Key.LOG_CAUSE);
    // Either no metadata, or exactly one "cause" means we don't need to do additional formatting.
    // This is pretty common and will save some work and object allocations.
    boolean hasOnlyKnownMetadata = metadata.size() == 0 || (metadata.size() == 1 && thrown != null);

    TemplateContext ctx = logData.getTemplateContext();
    String message;
    if (ctx == null) {
      // If a literal message (no arguments) is logged and no metadata exists, just use the string.
      // Having no format arguments is fairly common and this avoids allocating StringBuilders and
      // formatter instances in a lot of situations.
      message = safeToString(logData.getLiteralArgument());
      if (!hasOnlyKnownMetadata) {
        // If unknown metadata exists we have to append it to the message (this is not that common
        // because a Throwable "cause" is already handled separately).
        message = appendContext(new StringBuilder(message), metadata);
      }
    } else {
      StringBuilder buffer = formatMessage(logData);
      message = hasOnlyKnownMetadata ? buffer.toString() : appendContext(buffer, metadata);
    }
    receiver.handleFormattedLogMessage(logData.getLevel(), message, thrown);
  }
94504
void processMsgs(LockedMessageEnumeration msgEnumeration, ConsumerSession consumerSession)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "processMsgs", new Object[] { msgEnumeration, consumerSession });      

    // Remember that a callback is running
    asynchConsumerRunning = true;

    try
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "Entering asynchConsumerCallback.consumeMessages",
                     new Object[] {asynchConsumerCallback, msgEnumeration});      

      //Call the consumeMessages method on the registered
      //AsynchConsumerCallback object
      asynchConsumerCallback.consumeMessages(msgEnumeration);

      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "Exiting asynchConsumerCallback.consumeMessages");      
    }
    catch (Throwable e)
    {
      //Catch any exceptions thrown by consumeMessages.
      FFDCFilter.processException(
       e,
       "com.ibm.ws.sib.processor.impl.AsynchConsumer.processMsgs",
       "1:124:1.37",
       this);
       
      //Notify the consumer that this exception occurred.
      if(consumerSession!=null)
      {
        try
        {
          //Notify the consumer that this exception occurred.
          notifyExceptionListeners(e, consumerSession);
        }
        catch(Exception connectionClosed)
        {
          //No FFDC code needed
        }
            
      }
       
     //Trace the exception but otherwise swallow it since it was not
      //a failure in MP code or code upon which the MP is critically
      //dependent.
      if (e instanceof Exception)
        SibTr.exception(tc, (Exception)e);
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "Exception occurred in consumeMessages " + e);
         
      // We're not allowed to swallow this exception - let it work its way back to
      // the threadpool
      if(e instanceof ThreadDeath)
      {     
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
          SibTr.exit(tc, "processMsgs", e); 
        throw (ThreadDeath)e;
      }
        
    }
    finally
    {
      asynchConsumerRunning = false;
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "processMsgs");
  }