public void run() {
jmsTemplate.send(new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
byte[] buf = createBytesMessage(5120);
BytesMessage message = session.createBytesMessage();
message.writeBytes(buf);
message.setLongProperty("_publish_time", System.currentTimeMillis());
return message;
}
});
}
I have this code snippet, what I can make out is its using anonymous class. But I am confused upon how the createMessage() method will be called when the run() is invoked by thread?
Also somewhere I read there is nothing like "anonymous class" but instead its "anonymous inner class". Why its like that?