« Return to Thread: Proposed API change
Joe wrote:That looks like a cool feature. I would prefer something like
> Collection cs = ServerContextFactory.get().getScriptAllSession();
> ServerContextFactory.setScriptEnvironment(cs);
> Util.setValue("id", 42);
> ServerContextFactory.unsetScriptEnvironment();
>
> or maybe we'd prefer:
>
> Collection cs = ServerContextFactory.get().getScriptAllSession();
> ServerContextFactory.withEnvironment(cs, new Runnable() {
> public void run() {
> Util.setValue("id", 42);
> }
> });
the former syntax as inner classes and runnables always get a
bit too intrusive and verbose for my taste.
I would like to see possibilities for a "shorter" syntax than
your example, maybe
ServerContextFactory.selectAllScriptSessions();
Util.setValue("id", 42);
so "all sessions" apply to the rest of this call/request and is
then automatically cleared, no "unset" call. If not selecting
script sessions with the first call then the script session
belonging to the current request (if any) would be used by
default.
Best regards
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...
« Return to Thread: Proposed API change
| Free Forum Powered by Nabble | Forum Help |