private void sendVMMessage(int messageType, Endpoint endpoint, CacheEntry cacheEntry)
throws Exception {
// If the CAS was produced by this aggregate send the request message to the client
// Otherwise send the response message.
UimaTransport transport = getTransport(endpoint.getEndpoint());
UimaMessage message = transport.produceMessage(AsynchAEMessage.Process, messageType, getName());
if (cacheEntry.getCasProducerAggregateName() != null
&& cacheEntry.getCasProducerAggregateName().equals(getComponentName())) {
message.addLongProperty(AsynchAEMessage.CasSequence, cacheEntry.getCasSequence());
}
message.addStringProperty(AsynchAEMessage.CasReference, cacheEntry.getCasReferenceId());
if (cacheEntry.getInputCasReferenceId() != null) {
message.addStringProperty(AsynchAEMessage.InputCasReference, cacheEntry
.getInputCasReferenceId());
}
ServicePerformance casStats = getCasStatistics(cacheEntry.getCasReferenceId());
message.addLongProperty(AsynchAEMessage.TimeToSerializeCAS, casStats
.getRawCasSerializationTime());
message.addLongProperty(AsynchAEMessage.TimeToDeserializeCAS, casStats
.getRawCasDeserializationTime());
message.addLongProperty(AsynchAEMessage.TimeInProcessCAS, casStats.getRawAnalysisTime());
long iT = getIdleTimeBetweenProcessCalls(AsynchAEMessage.Process);
message.addLongProperty(AsynchAEMessage.IdleTime, iT);
// Send reply back to the client. Use internal (non-jms) transport
transport.getUimaMessageDispatcher(endpoint.getEndpoint()).dispatch(message);
dropStats(cacheEntry.getCasReferenceId(), getName());
}