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

Michael Dürig edited comment on OAK-4139 at 11/7/16 10:19 AM:
--------------------------------------------------------------

I would generalise the approach a bit: make {{ObserverAwareStrategy}} a 
{{ConditionalRefreshStrategy}} depending on a predicate (instead of the 
{{SessionContext}} instance). Also generalise the delegate from {{LogOnce}} to 
{{RefreshStrategy}}. I think this would make the class more generally usable 
beyond this immediate problem. 

Furthermore I would get rid of the cast to {{ObserverAwareStrategy}} in 
{{RepositoryImpl}}. Instead pass the predicate right to the constructor and 
have it return false until it is bound to the session context (that is, bind 
the predicate to the session context instead of the session strategy via a 
setter. This hides that mess with those circular dependencies a bit better). 


was (Author: mduerig):
I would generalise the approach a bit: make {{ObserverAwareStrategy}} a 
{{ConditionalRefreshStrategy}} depending on a predicate (instead of the 
{{SessionContext}} instance). Also generalise the delegate from {{LogOnce}} to 
{{RefreshStrategy}}. I think this would make the class more generally usable 
beyond this immediate problem. 

Furthermore I would get rid of the cast to {{ObserverAwareStrategy}} in 
{{RepositoryImpl}}. Instead pass the predicate right to the constructor and 
have it return false until it is bound to the session context. 

> Idle session warnings for observation sessions
> ----------------------------------------------
>
>                 Key: OAK-4139
>                 URL: https://issues.apache.org/jira/browse/OAK-4139
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: jcr
>            Reporter: Michael Dürig
>            Assignee: Chetan Mehrotra
>             Fix For: 1.6
>
>         Attachments: OAK-4139-v1.patch
>
>
> Although sessions that register an observation listener Oak still issues idle 
> session warnings for them ({{RefreshStrategy.LogOnce}}). For such sessions 
> Oak should not log that warning. 



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

Reply via email to