I was hoping you could clarify something for me. I haven't done much
heavy work with events in Java, so I'm not sure if I'm understanding
this correctly.=20
1) ManagerEventHandler.handleEvent() deals with ManagerEvents.=20
2) ManagerEvent has a number of subclasses such as ChannelEvent,
CdrEvent, etc.
3) Therefore, handleEvent(ChannelEvent event) should work since
ChannelEvent extends ManagerEvent.
Yet, it doesn't. So that leaves two possible solutions:
A) Overload handleEvent() in ManagerEventHandler to handle each of the
various types of ManagerEvents
B) Do an instanceof on every received ManagerEvent to see what it is
Now, I'm sure that A & B are both quite wrong. Then again, I'm also
pretty sure that 3 is quite right. So what am I missing here?
--=20
Alex Malinovich
Golden Technologies, Inc.
(219) 462-7200 x 216
http://www.golden-tech.com
|