}
public TextMessage produceTextMessage(String aTextMessage) throws AsynchAEException {
synchronized( lock ) {
if ( producerSession == null ) {
throw new AsynchAEException("Controller:"+controller.getComponentName()+" Unable to create JMS Message. Producer Session Not Initialized (Null)");
}
try {
if (aTextMessage == null) {
return producerSession.createTextMessage("");
} else {
return producerSession.createTextMessage(aTextMessage);
}
} catch (javax.jms.IllegalStateException e) {
try {
open();
} catch (ServiceShutdownException ex) {
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
"produceTextMessage", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
"UIMAEE_service_exception_WARNING", controller.getComponentName());
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
"produceTextMessage", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
"UIMAJMS_exception__WARNING", ex);
}
} catch (AsynchAEException ex) {
throw ex;
}
} catch (Exception e) {
throw new AsynchAEException(e);
}
throw new AsynchAEException(new InvalidMessageException("Unable to produce Message Object"));
}
}