if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, CLASS_NAME.getName(), "onMessage",
JmsConstants.JMS_LOG_RESOURCE_BUNDLE, "UIMAJMS_recvd_msg__FINE", new Object[] { eN });
}
JmsMessageContext messageContext = null;
int requestType = 0;
try {
// Wrap JMS Message in MessageContext
messageContext = new JmsMessageContext(aMessage, endpointName);
if (aMessage.getStringProperty(AsynchAEMessage.CasReference) == null) {
casRefId = "CasReferenceId Not In Message";
} else {
casRefId = aMessage.getStringProperty(AsynchAEMessage.CasReference);
}
String command = "";
String messageType ="";
if (validMessage(aMessage)) {
command = decodeIntToString(AsynchAEMessage.Command, aMessage
.getIntProperty(AsynchAEMessage.Command));
// Request or Response
messageType = decodeIntToString(AsynchAEMessage.MessageType, aMessage
.getIntProperty(AsynchAEMessage.MessageType));
// Check if the request message contains a reply destination known to have
// been deleted. This could be the case if the client has been shutdown after
// sending requests. Previous attempt to deliver a reply failed and the client's
// reply endpoint was placed on the DoNotProcess List. For optimization, all
// requests from a dead client will be dropped.
if (aMessage.getIntProperty(AsynchAEMessage.MessageType) == AsynchAEMessage.Request
&& messageContext != null
&& messageContext.getEndpoint() != null
&& messageContext.getEndpoint().getDestination() != null
&& getController().isEndpointOnDontProcessList(
messageContext.getEndpoint().getDestination().toString())) {
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(
Level.INFO,
CLASS_NAME.getName(),
"onMessage",
JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
"UIMAJMS_dropping_msg_client_is_dead__INFO",
new Object[] { controller.getComponentName(),
messageContext.getEndpoint().getDestination(), casRefId });
}
return;
}
if (ackMessageNow(aMessage)) {
aMessage.acknowledge();
}
String msgSentFromIP = null;
if (aMessage.getIntProperty(AsynchAEMessage.MessageType) == AsynchAEMessage.Response
&& aMessage.propertyExists(AsynchAEMessage.ServerIP)) {
msgSentFromIP = aMessage.getStringProperty(AsynchAEMessage.ServerIP);
}
// System.out.println("***********************************************************************************"
// +
// " \n**CONTROLLER::"+controller.getName()+"**** Received New Message From [ "+aMessage.getStringProperty(AsynchAEMessage.MessageFrom)+" ]**************"
// +
// " \n**MSGTYPE::"+messageType+" COMMAND:"+command +
// " Cas Reference Id::"+casRefId+
// " \n******************************************************************************");
String msgFrom = (String) aMessage.getStringProperty(AsynchAEMessage.MessageFrom);
if (controller != null && msgFrom != null) {
if (msgSentFromIP != null) {
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(
Level.FINE,
CLASS_NAME.getName(),
"onMessage",
JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
"UIMAJMS_recvd_new_message_with_ip__FINE",
new Object[] { controller.getComponentName(), msgFrom, msgSentFromIP,
messageType, command, casRefId });
}
} else {
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(
Level.FINE,
CLASS_NAME.getName(),
"onMessage",
JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
"UIMAJMS_recvd_new_message__FINE",
new Object[] { controller.getComponentName(), msgFrom, messageType, command,
casRefId });
}
}
} else {
}
// Delegate processing of the message contained in the MessageContext to the
// chain of handlers
try {
if (isRemoteRequest(aMessage)) {
// Compute the idle time waiting for this request
idleTime = getController().getIdleTime();
// This idle time is reported to the client thus save it in the endpoint
// object. This value will be fetched and added to the outgoing reply.
messageContext.getEndpoint().setIdleTime(idleTime);
}
} catch (Exception e) {
}
// Determine if this message is a request and either GetMeta, CPC, or Process