You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2010/06/09 09:18:10 UTC
[jira] Created: (FELIX-2396) Ability to have callbacks when
accessing session variables
Ability to have callbacks when accessing session variables
----------------------------------------------------------
Key: FELIX-2396
URL: https://issues.apache.org/jira/browse/FELIX-2396
Project: Felix
Issue Type: Improvement
Components: Gogo
Reporter: Guillaume Nodet
This is required for a better integration when the value is computed without any simple way to be aware of the fact that the value has changed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2396) Ability to have callbacks when
accessing session variables
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877020#action_12877020 ]
Guillaume Nodet commented on FELIX-2396:
----------------------------------------
Maybe something very simple such if the object in the session is a java.util.concurrent.Callable object, call it.
Or maybe define our own interface.
Or allow to set a callback that would be called when retrieving a value. That may allow even greater flexibility such as allowing lazy retrieval of values (though that would break the '.variables' value).
> Ability to have callbacks when accessing session variables
> ----------------------------------------------------------
>
> Key: FELIX-2396
> URL: https://issues.apache.org/jira/browse/FELIX-2396
> Project: Felix
> Issue Type: Improvement
> Components: Gogo
> Reporter: Guillaume Nodet
>
> This is required for a better integration when the value is computed without any simple way to be aware of the fact that the value has changed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (FELIX-2396) Ability to have callbacks when
accessing session variables
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Guillaume Nodet updated FELIX-2396:
-----------------------------------
Assignee: Guillaume Nodet
Fix Version/s: gogo-0.6.1
I'll handle this issue using the following behavior.
WHen looking up a variable, a first check will be done as following:
if a variable exists with the same name but prefixed with '#', this one will be used instead and evaluate if it implements the Function interface
The purpose is to not modify the exiting behavior and remain backward compatible. Also if we don't use a prefix, a closure could not be accessed anymore from a variable, as it would always be evaluated.
> Ability to have callbacks when accessing session variables
> ----------------------------------------------------------
>
> Key: FELIX-2396
> URL: https://issues.apache.org/jira/browse/FELIX-2396
> Project: Felix
> Issue Type: Improvement
> Components: Gogo Runtime
> Reporter: Guillaume Nodet
> Assignee: Guillaume Nodet
> Fix For: gogo-0.6.1
>
>
> This is required for a better integration when the value is computed without any simple way to be aware of the fact that the value has changed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2396) Ability to have callbacks when
accessing session variables
Posted by "Derek Baum (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877032#action_12877032 ]
Derek Baum commented on FELIX-2396:
-----------------------------------
or use closures:
Object getAndEvaluate(String name)
{
Object value = session.get(name);
if (value instanceof Function)
{
try {
value = ((Function) value).execute(session, null);
} catch (Throwable e) {
// ignore
}
}
return value;
}
e.g.
prompt = getAndEvaluate("prompt");
will work with a simple
prompt = "g! "
or a closure:
prompt = { (pwd; echo '% ') | tac}
which will change the prompt in line with the current directory.
> Ability to have callbacks when accessing session variables
> ----------------------------------------------------------
>
> Key: FELIX-2396
> URL: https://issues.apache.org/jira/browse/FELIX-2396
> Project: Felix
> Issue Type: Improvement
> Components: Gogo
> Reporter: Guillaume Nodet
>
> This is required for a better integration when the value is computed without any simple way to be aware of the fact that the value has changed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (FELIX-2396) Ability to have callbacks when
accessing session variables
Posted by "Derek Baum (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Derek Baum updated FELIX-2396:
------------------------------
Component/s: Gogo runtime
(was: Gogo)
> Ability to have callbacks when accessing session variables
> ----------------------------------------------------------
>
> Key: FELIX-2396
> URL: https://issues.apache.org/jira/browse/FELIX-2396
> Project: Felix
> Issue Type: Improvement
> Components: Gogo runtime
> Reporter: Guillaume Nodet
>
> This is required for a better integration when the value is computed without any simple way to be aware of the fact that the value has changed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (FELIX-2396) Ability to have callbacks when
accessing session variables
Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Richard S. Hall updated FELIX-2396:
-----------------------------------
Component/s: Gogo
(was: Gogo Runtime)
> Ability to have callbacks when accessing session variables
> ----------------------------------------------------------
>
> Key: FELIX-2396
> URL: https://issues.apache.org/jira/browse/FELIX-2396
> Project: Felix
> Issue Type: Improvement
> Components: Gogo
> Reporter: Guillaume Nodet
>
> This is required for a better integration when the value is computed without any simple way to be aware of the fact that the value has changed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2396) Ability to have callbacks when
accessing session variables
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877035#action_12877035 ]
Guillaume Nodet commented on FELIX-2396:
----------------------------------------
Agreed, that would be even better.
> Ability to have callbacks when accessing session variables
> ----------------------------------------------------------
>
> Key: FELIX-2396
> URL: https://issues.apache.org/jira/browse/FELIX-2396
> Project: Felix
> Issue Type: Improvement
> Components: Gogo
> Reporter: Guillaume Nodet
>
> This is required for a better integration when the value is computed without any simple way to be aware of the fact that the value has changed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (FELIX-2396) Ability to have callbacks when
accessing session variables
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Guillaume Nodet resolved FELIX-2396.
------------------------------------
Resolution: Fixed
Committing to https://svn.apache.org/repos/asf/felix/trunk ...
M gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java
Committed r999782
> Ability to have callbacks when accessing session variables
> ----------------------------------------------------------
>
> Key: FELIX-2396
> URL: https://issues.apache.org/jira/browse/FELIX-2396
> Project: Felix
> Issue Type: Improvement
> Components: Gogo Runtime
> Reporter: Guillaume Nodet
> Assignee: Guillaume Nodet
> Fix For: gogo-0.6.1
>
>
> This is required for a better integration when the value is computed without any simple way to be aware of the fact that the value has changed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.