<commit_before>package org.apache.isis.viewer.wicket.viewer;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.isis.applib.services.publish.PublisherServiceLogging;
import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.runtime.system.context.IsisContext;
import org.apache.isis.core.runtime.system.session.IsisSessionFactory;

class TargetRespondListenerToResetQueryResultCache implements AjaxRequestTarget.ITargetRespondListener {

    private static final Logger LOG = LoggerFactory.getLogger(PublisherServiceLogging.class);

    @Override
    public void onTargetRespond(final AjaxRequestTarget target) {

        if(LOG.isDebugEnabled()) {
            LOG.debug("RESPOND PHASE STARTED: resetting transaction scopes");
        }

        resetWithTransactionScopes();
    }

    private void resetWithTransactionScopes() {
        final QueryResultsCache queryResultsCache = getServicesInjector()
                .lookupService(QueryResultsCache.class);
            queryResultsCache.resetForNextTransaction();
    }

    private ServicesInjector getServicesInjector() {
        return getSessionFactory().getServicesInjector();
    }

    private IsisSessionFactory getSessionFactory() {
        return IsisContext.getSessionFactory();
    }
}<commit_msg>ISIS-1655: fixes logger to use<commit_after>package org.apache.isis.viewer.wicket.viewer;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.runtime.system.context.IsisContext;
import org.apache.isis.core.runtime.system.session.IsisSessionFactory;

class TargetRespondListenerToResetQueryResultCache implements AjaxRequestTarget.ITargetRespondListener {

    private static final Logger LOG = LoggerFactory.getLogger(TargetRespondListenerToResetQueryResultCache.class);

    @Override
    public void onTargetRespond(final AjaxRequestTarget target) {

        if(LOG.isDebugEnabled()) {
            LOG.debug("RESPOND PHASE STARTED: resetting cache");
        }

        final QueryResultsCache queryResultsCache = lookupQueryResultsCache();
        queryResultsCache.resetForNextTransaction();
    }

    private QueryResultsCache lookupQueryResultsCache() {
        return getServicesInjector().lookupService(QueryResultsCache.class);
    }

    private ServicesInjector getServicesInjector() {
        return getSessionFactory().getServicesInjector();
    }

    private IsisSessionFactory getSessionFactory() {
        return IsisContext.getSessionFactory();
    }
}
{'fraction_non_alphanumeric': 0.08397751229796205, 'fraction_numerical': 0.0028109627547434997, 'mean_word_length': 4.571428571428571, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3234960', 'n_tokens_mistral': 805, 'n_tokens_neox': 771, 'n_words': 123}