Adam Heath wrote:
Adrian Crum wrote:
Adam Heath wrote:
Adam Heath wrote:
T result = Controller.runWith(data, new Callable<T>() {
    public T call() throws Exception {
        // code
        return null;
    }
});
I've actually attempted this, and while I think the implementation of
this pattern is simple, actually *using* it in higher-level code ends
up making things rather verbose.

/me goes to think more
I like the idea of encapsulating it all, but it seems to me at first
glance that it will require a lot of code rewriting. I was trying to
"inject" the new design into existing code without altering the existing
code. New code could certainly follow a better pattern.


Why wasn't java.security.AccessController(and friends) used for this?

I don't know. I had a good reason at the time, but I forgot what it was. Since the API is the same, I'm sure we could try changing it.

Reply via email to