EHC ❯ instance of in JMSCachePeer not working
-
Bug
-
Status: Open
-
3 Minor
-
Resolution:
-
ehcache-jmsreplication
-
-
-
Reporter: sourceforgetracker
-
September 21, 2009
-
0
-
Watchers: 0
-
January 12, 2010
-
Attachments
Description
Hi
The “instance of” used in the source code of ehcache jms replication provided by ehcahe is not working.
File Name is JMSCachePeer
private void handleObjectMessage(Message message) throws JMSException, RemoteException { ObjectMessage objectMessage = (ObjectMessage) message; Object object = objectMessage.getObject();
//If a non-cache publisher sends an Element
if (object instanceof Element) {
/** some code **/
} else if (object instanceof JMSEventMessage) {
/** some code **/
} else {
/** some code **/
}
Even though the object is of type JMSEventMessage, the control does not go in the second if. rather it goes in the last else.
The object.getClass().getName() and JMSEventMessage.class.getName() both give the same result which is net.sf.ehcache.distribution.jms.JMSEventMessage.
Even then i am getting a classcastexception when i do this:
JMSEventMessage jmsEventMessage = (JMSEventMessage) object;
If anyone has any input then please share.
Thanks in advance..
Regards, Nimit Grover.
Sourceforge Ticket ID: 2839041 - Opened By: nimitgrover - 17 Aug 2009 15:09 UTC
Comments
Fiona OShea 2010-01-06
James Carr 2010-01-12
In order to understand the codebase better I wrote some pure unit tests around JmsCachePeer… and it seems to prove this bug does not exist.
Assigning these issues to Greg, so that he can decide what to do with them.