Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice Proxies and Aspects in Spring

Just curious if anyone has tried this, either Spring AOP based or AspectJ (more likely) and have any words of wisdom to impart... ?

Comments

  • 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.

    Hope that helps.
    ~Josh.