On Fri, 17 Nov 2006 at 13:49, M. Rangnathan wrote:
> There is no Java trick involved. You implement ExtensionHeader just the same
> way as you implement any interface. However, what you are attempting to do
> will not work.
>
> Yes you will get a ClassCastException and thats because the stack keeps a
> NAME to Class mapping for the Factory and expects an header of NAME
> "Contact" to be of a type that implements javax.sip.header.ContactHeader and
> of type gov.nist.javax.sip.header.Contact
Um, OK. So what you are saying is that Headers are only conformant to
the interface specification if they are obtained from the HeaderFactory?
It doesn't actually say that anywhere in the spec that I could find.
Perhaps it would be obvious to an experienced Java programmer.
I must say that I'm disappointed by the high degree of coupling
demonstrated by this interface and code. As my case demonstrates,
this makes code reuse difficult. I wonder if this stems from a
kind of culture clash between the proprietary world and the open
source world I'm more familiar with.
Anyway, I'll go hack the source.
--David
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.