*
* @deprecated Not sure why we have this duplicate method here. Need to investigate...
*/
public Object onReceive(Object data) throws Exception
{
MuleEventContext context = RequestContext.getEventContext();
String contents = data.toString();
String msg = StringMessageUtils.getBoilerPlate("Message Received in service: "
+ context.getFlowConstruct().getName() + ". Content is: "
+ StringMessageUtils.truncate(contents, 100, true), '*', 80);
logger.info(msg);
if (eventCallback != null)
{
eventCallback.eventReceived(context, this);
}
Object replyMessage;
if (returnMessage != null)
{
replyMessage = returnMessage;
}
else
{
replyMessage = contents + " Received";
}
context.getMuleContext().fireNotification(
new FunctionalTestNotification(context, replyMessage, FunctionalTestNotification.EVENT_RECEIVED));
if (throwException)
{
if(returnMessage!=null && returnMessage instanceof Exception)