QueueSession session = null;
try
{
System.out.println("*** AccountsCancelInterceptor intercepting " + ctx.getMethod().getName());
System.out.println("*** AccountsConfirmInterceptor - notifying accounts dept");
session = getConnection().createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Message msg = session.createTextMessage("Cancelling order " + ctx.getParameters()[0]);
QueueSender sender = session.createSender(queue);
sender.send(msg);
return ctx.proceed();
}
catch(Exception e)
{
throw new RuntimeException(e);
}
finally
{
try{session.close();}catch(Exception e) {}
System.out.println("*** AccountsCancelInterceptor exiting");
}