use of java.util.ResourceBundle in project OpenAM by OpenRock.
the class DevicePrintModule method init.
/**
* {@inheritDoc}
*/
@Override
public void init(Subject subject, Map sharedState, Map options) {
userName = (String) sharedState.get(getUserKey());
if (StringUtils.isEmpty(userName)) {
ResourceBundle bundle = amCache.getResBundle(AUTH_MODULE_NAME, getLoginLocale());
DEBUG.warning(bundle.getString("authModuleNotSetUpWithUsername"));
}
AMIdentityRepository amIdentityRepository = getAMIdentityRepository(getRequestOrg());
AMIdentity amIdentity = getIdentity();
HOTPService hotpService = moduleInitialiser.getHOTPService(getLoginLocale(), amCache, userName, amIdentityRepository, options);
devicePrintAuthenticationService = moduleInitialiser.getDevicePrintAuthenticationService(amIdentity, getHttpServletRequest(), hotpService, options);
}
use of java.util.ResourceBundle in project OpenAM by OpenRock.
the class AMResBundleCacher method getBundle.
/**
* Gets resource bundle
*
* @param name of bundle
* @param locale of bundle
* @return resource bundle
*/
public static ResourceBundle getBundle(String name, Locale locale) {
AMResourceBundleCache cache = AMResourceBundleCache.getInstance();
ResourceBundle rb = cache.getResBundle(name, locale);
if (rb == null) {
rb = cache.getResBundle(AMAdminConstants.DEFAULT_RB, locale);
}
return rb;
}
use of java.util.ResourceBundle in project OpenAM by OpenRock.
the class AMResourceBundleCache method getResBundle.
/**
* Gets resource bundle from cache
*
* @param name of bundle
* @param locale of bundle
* @return resource bundle
*/
public ResourceBundle getResBundle(String name, Locale locale) {
ResourceBundle resBundle = null;
Map map = (Map) mapBundles.get(name);
if (map != null) {
resBundle = (ResourceBundle) map.get(locale);
}
if (resBundle == null) {
try {
resBundle = ResourceBundle.getBundle(name, locale);
} catch (MissingResourceException mre) {
resBundle = getResourceFromDS(name, locale);
}
synchronized (mapBundles) {
if (map == null) {
map = new HashMap(5);
mapBundles.put(name, map);
}
map.put(locale, resBundle);
}
}
return resBundle;
}
use of java.util.ResourceBundle in project OpenAM by OpenRock.
the class AMSDKBundle method getBundleFromHash.
private static ResourceBundle getBundleFromHash(String locale) {
ResourceBundle rb = (ResourceBundle) strLocaleBundles.get(locale);
if (rb == null) {
rb = com.sun.identity.shared.locale.Locale.getResourceBundle(BUNDLE_NAME, locale);
if (rb == null) {
rb = profileBundle;
}
strLocaleBundles.put(locale, rb);
}
return rb;
}
use of java.util.ResourceBundle in project OpenAM by OpenRock.
the class AMSDKBundle method getBundleFromHash.
static ResourceBundle getBundleFromHash(java.util.Locale locale) {
ResourceBundle rb = (ResourceBundle) localeBundles.get(locale);
if (rb == null) {
rb = ResourceBundle.getBundle(BUNDLE_NAME, locale);
if (rb == null) {
rb = profileBundle;
}
localeBundles.put(locale, rb);
}
return rb;
}
Aggregations