What exactly are you shooting for? Do you want to have all proxies return from "communicator.stringToProxy()" be wrapped? Or are you using a Glacier2 facade? In OMERO, all client interaction happens via a session proxy:
import omero.client;
//...
omero.client c = new omero.client();
SessionFactoryPrx sf = c.createSession(); // Returns a Glacier session subclass
IQueryPrx q = sf.getQueryService();
If the sf instance were wrapped (it's not yet, since we'd need to do the same in Python and C++), then all the services like IQueryPrx could also easily be wrapped.
Without using a facade, you'd need to either wrap the Ice.Communicator instance manually or have AspectJ intercept the call to Ice.Util.initialize() and return a wrapped instance.
If you want similar functionality on the server side, i.e. with the servants, you might want to use the "--tie" flag to slice2java. Here's our configuration for the servants.
Comments
If the sf instance were wrapped (it's not yet, since we'd need to do the same in Python and C++), then all the services like IQueryPrx could also easily be wrapped.
Without using a facade, you'd need to either wrap the Ice.Communicator instance manually or have AspectJ intercept the call to Ice.Util.initialize() and return a wrapped instance.
If you want similar functionality on the server side, i.e. with the servants, you might want to use the "--tie" flag to slice2java. Here's our configuration for the servants.
Hope that helps.
~Josh.