Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-8955

MessageServiceImpl getDefaultLocaleCode Caching

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: Backlog
    • Security Level: Public (Public: Anyone can view)
    • Labels:
    • Epic Link:
    • Rice Module:
      KRAD
    • KRAD Feature Area:
      UIF MVC
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      MessageServiceImpl's getDefaultLocaleCode method is highly used, and I don't think the value changes often. We've cached the output of this method in a local variable, but that's probably not a preferred solution.

      It seems like if some form of caching was implemented, that could save a bunch of work!
      I didn't see that spring + ehcache was enabled for krad, so that's why we didn't use the cacheable annotation instead.

      private String defaultLocaleCode;
      protected String getDefaultLocaleCode() {
      if(defaultLocaleCode != null)
      return defaultLocaleCode;
      String localeCode = CoreFrameworkServiceLocator.getParameterService().getParameterValueAsString(
      KRADConstants.KNS_NAMESPACE, KRADConstants.DetailTypes.ALL_DETAIL_TYPE,
      KRADConstants.ParameterNames.DEFAULT_LOCALE_CODE);

      // if not configured fall back to english US
      if (StringUtils.isBlank(localeCode))

      { localeCode = "en-US"; }

      defaultLocaleCode = localeCode;
      return localeCode;
      }

        Attachments

          Issue Links

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                Unassigned
                Reporter:
                jdomeyer Jeff Domeyer (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: