You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Oscar Bou (JIRA)" <ji...@apache.org> on 2015/06/05 15:35:00 UTC

[jira] [Commented] (ISIS-1157) Cache safe Actions results by annotating them

    [ https://issues.apache.org/jira/browse/ISIS-1157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14574486#comment-14574486 ] 

Oscar Bou commented on ISIS-1157:
---------------------------------

Initially proposed implementation guide:
- Extend org.apache.isis.applib.annotation.SemanticsOf enum with the new "SAFE_AND_REQUEST_CACHED" enum value.
- Create "ActionInvocationFacetRequestCached" extending "ActionInvocationFacetAbstract".
   - Implement it by delegating to the "QueryResultsService", avoiding having different implementations.
   - It can be based on "ActionInvocationFacetWrapTransaction".
- Create "ActionInvocationFacetRequestCachedDecorator" returning the facet type "ActionInvocationFacet.class".
   - It can be based on "StandardTransactionFacetDecorator".
- Create "ActionInvocationFacetRequestCachedDecoratorInstaller"
   - It can be based on "TransactionFacetDecoratorInstaller"

> Cache safe Actions results by annotating them
> ---------------------------------------------
>
>                 Key: ISIS-1157
>                 URL: https://issues.apache.org/jira/browse/ISIS-1157
>             Project: Isis
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Oscar Bou
>            Assignee: Oscar Bou
>
> As discussed on the Isis mailing list [1].
> Currently, there's service called QueryResultsCache [2] that allows to cache the results of an Action/method invocation.
> We want to introduce this capability for Safe Actions by simply annotating them.
> Current proposal is to extend the "SemanticsOf" annotation param with a new type: SemanticsOf.SAFE_AND_REQUEST_CACHED
> A usage example would be:
>  
> {code}
>     @Override
>     @Action(semantics = SemanticsOf.SAFE_AND_REQUEST_CACHED)
>     public SortedSet<IESG> relevantSnpGenotypes(final IE inputElement,
>             final Kit kit) {
>         if (kit != null) {
>             return kit.findAllAssociatedSNPGenotypesForInputElement(inputElement, AlgorithmImplementation.this.IESGClass);
>         } else {
>             return Sets.newTreeSet();
>         }
>     }
> {code}
> [1] http://mail-archives.apache.org/mod_mbox/isis-users/201505.mbox/%3C575DA9CB-14E6-4DD0-9565-C03C759BD20E@gesconsultor.com%3E
> [2] https://isis.apache.org/reference/services/query-results-cache.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)