> On a related point, what if you wanted to implement multiple interfaces
> in one class? From the link given below, this works as long as you know
> you want ITest back -
> ITest iTest = (ITest)
> return iTest;
> But what if you don't know until runtime the context of the call, i.e
> whether the client of the object expects Ifoo or Ibar ? The only way I
> see to do that is write your own introspection framework around the call
> above and cast appropriately in some switch type statement.
The client must know what kind of object it wants, have it pass the
desired interface to the factory for use in the __tojava__() call.