Category: Proxy usage

Q

Can I implement multiple callback interfaces in .NET?

A

The answer is no. You can only implement one callback interface in .NET and there are some very good reasons for it. The callback mechanism relies on the fact that there is a Java type that implements the callback interface. This Java type has all the knowledge to delegate callback invocations to a .NET object that is maintained internally as a pointer.

If you implemented multiple callback interfaces in .NET, you would be aggregating several Java implementations types in.NET. Each type would only know how to handle its own callback methods, but not how to handle the callback methods of the other aggregated types.

If you wish to implement multiple callback interfaces, you have to have one Java interface which extends all the interfaces that you wish to use.


Copyright 2006-2011 by Codemesh, Inc., ALL RIGHTS RESERVED

:
frequently asked questions
home products support customers partners newsroom about us contact us