1 15 package org.apache.hivemind.impl; 16 17 import java.util.Locale ; 18 19 import org.apache.hivemind.internal.MessageFinder; 20 import org.apache.hivemind.service.ThreadLocale; 21 import org.apache.hivemind.util.Defense; 22 23 31 public class ModuleMessages extends AbstractMessages 32 { 33 private MessageFinder _messageFinder; 34 35 private ThreadLocale _threadLocale; 36 37 public ModuleMessages(MessageFinder messageFinder, ThreadLocale threadLocale) 38 { 39 Defense.notNull(messageFinder, "messageFinder"); 40 Defense.notNull(threadLocale, "threadLocale"); 41 42 _messageFinder = messageFinder; 43 _threadLocale = threadLocale; 44 } 45 46 protected Locale getLocale() 47 { 48 return _threadLocale.getLocale(); 49 } 50 51 protected String findMessage(String key) 52 { 53 return _messageFinder.getMessage(key, getLocale()); 54 } 55 56 } | Popular Tags |