This didn't seem like it would be a problem, but apparently I'm not quite as clever as
I thought...
I have a client and a server, connected via RMI. The client wishes to pass a "filter"
to the server (see example below). Now, I was thinking/hoping that through the magic
of RMI, my serializable implementation of the server's WidgetFilter interface would be
sent over the wire and used by the server without issue. It seems I was wrong. The
marshalling/classNotFound exceptions I get seem to indicate that the MyWidgetFilter
class definition needs to exist in the server's VM a priori, but I could have sworn
that dynamic class transport was one of RMI's big "cool feature" bullet points.
Any ideas what silliness I've wrought?
Thanks,
Ken
- - - - - - - - - - - - Begin Example - - - - - - - - - - - -
In a method on the client:
{
:
WidgetFilter filter = new MyWidgetFilter();
List widgets = myRemoteServerObj.getWidgets( filter ):
:
}
static class MyWidgetFilter implements WidgetFilter, Serializable {
boolean accept( Widget w ) {
return w.getName() == "Foo";
}
}
}
Over in the server's package, the WidgetFilter interface is defined.
interface WidgetFilter {
boolean accept( Widget w );
}
- - - - - - - - - - - - End Example - - - - - - - - - - - -
_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org