Class DefaultLocalizationService
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.internal.i18n.impl.DefaultLocalizationService
-
- All Implemented Interfaces:
InvalidationListener,LocalizationService,java.io.Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
@Deprecated(since="ages", forRemoval=true) public class DefaultLocalizationService extends AbstractService implements LocalizationService, InvalidationListenerDeprecated, for removal: This API element is subject to removal in a future version.since agesDefault implementation of the localization service.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classDefaultLocalizationService.DataLocaleDeprecated, for removal: This API element is subject to removal in a future version.DataLocale encapsulates aLocalemapped to a hybrisLanguageitem.-
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
Fields inherited from interface de.hybris.platform.servicelayer.internal.i18n.LocalizationService
BEAN
-
-
Constructor Summary
Constructors Constructor Description DefaultLocalizationService()Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()Deprecated, for removal: This API element is subject to removal in a future version.Invoked by a BeanFactory after it has set all bean properties supplied.java.util.Locale[]getAllLocales(java.util.Locale loc)Deprecated, for removal: This API element is subject to removal in a future version.java.util.LocalegetCurrentDataLocale()Deprecated, for removal: This API element is subject to removal in a future version.java.util.LocalegetCurrentLocale()Deprecated, for removal: This API element is subject to removal in a future version.java.lang.StringgetDataLanguageIsoCode(java.util.Locale locale)Deprecated, for removal: This API element is subject to removal in a future version.java.util.LocalegetDataLocale(java.util.Locale loc)Deprecated, for removal: This API element is subject to removal in a future version.java.util.Locale[]getFallbackLocales(java.util.Locale loc)Deprecated, for removal: This API element is subject to removal in a future version.protected java.util.LocalegetLocaleByLanguage(Language lang)Deprecated, for removal: This API element is subject to removal in a future version.Returns the (cached)Localeby the givenLanguage.java.util.LocalegetLocaleByString(java.lang.String isoCodes)Deprecated, for removal: This API element is subject to removal in a future version.protected java.util.Locale[]getLocaleMatchKey(java.util.Locale requested)Deprecated, for removal: This API element is subject to removal in a future version.PKgetMatchingPkForDataLocale(java.util.Locale locale)Deprecated, for removal: This API element is subject to removal in a future version.Returns proper language PK for matching locale.java.util.Set<java.util.Locale>getSupportedDataLocales()Deprecated, for removal: This API element is subject to removal in a future version.protected java.util.Map<java.util.Locale,DefaultLocalizationService.DataLocale>getSupportedLocales()Deprecated, for removal: This API element is subject to removal in a future version.Each hybrisLanguageis encapsulates into aDefaultLocalizationService.DataLocaleand is put with the correspondingLocaleinto the map.booleanisLocalizationFallbackEnabled()Deprecated, for removal: This API element is subject to removal in a future version.voidkeyInvalidated(java.lang.Object[] key, int invalidationType, InvalidationTarget target, RemoteInvalidationSource remoteSrc)Deprecated, for removal: This API element is subject to removal in a future version.protected DefaultLocalizationService.DataLocalematchDataLocale(java.util.Locale loc, boolean throwError)Deprecated, for removal: This API element is subject to removal in a future version.voidsetCurrentLocale(java.util.Locale loc)Deprecated, for removal: This API element is subject to removal in a future version.voidsetLocalizationFallbackEnabled(boolean enabled)Deprecated, for removal: This API element is subject to removal in a future version.-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
-
-
-
Method Detail
-
getLocaleByString
public java.util.Locale getLocaleByString(java.lang.String isoCodes)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getLocaleByStringin interfaceLocalizationService
-
getLocaleByLanguage
protected java.util.Locale getLocaleByLanguage(Language lang)
Deprecated, for removal: This API element is subject to removal in a future version.Returns the (cached)Localeby the givenLanguage.- Parameters:
lang- the language- Returns:
- the Locale
-
getCurrentLocale
public java.util.Locale getCurrentLocale()
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getCurrentLocalein interfaceLocalizationService- Returns:
- from the current
JaloSessionthe attachedLocale.
-
setCurrentLocale
public void setCurrentLocale(java.util.Locale loc)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
setCurrentLocalein interfaceLocalizationService- Parameters:
loc- the new session locale
-
getCurrentDataLocale
public java.util.Locale getCurrentDataLocale()
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getCurrentDataLocalein interfaceLocalizationService
-
getDataLocale
public java.util.Locale getDataLocale(java.util.Locale loc)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getDataLocalein interfaceLocalizationService- Parameters:
loc- the locale to match
-
getDataLanguageIsoCode
public java.lang.String getDataLanguageIsoCode(java.util.Locale locale)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getDataLanguageIsoCodein interfaceLocalizationService- Parameters:
locale- the locale to get data language code for
-
getAllLocales
public java.util.Locale[] getAllLocales(java.util.Locale loc)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getAllLocalesin interfaceLocalizationService
-
getFallbackLocales
public java.util.Locale[] getFallbackLocales(java.util.Locale loc)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getFallbackLocalesin interfaceLocalizationService
-
getLocaleMatchKey
protected java.util.Locale[] getLocaleMatchKey(java.util.Locale requested)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getMatchingPkForDataLocale
public PK getMatchingPkForDataLocale(java.util.Locale locale)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:LocalizationServiceReturns proper language PK for matching locale.- Specified by:
getMatchingPkForDataLocalein interfaceLocalizationService- Parameters:
locale- the locale to get data language code for- Returns:
- language pk
-
matchDataLocale
protected DefaultLocalizationService.DataLocale matchDataLocale(java.util.Locale loc, boolean throwError)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getSupportedDataLocales
public java.util.Set<java.util.Locale> getSupportedDataLocales()
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getSupportedDataLocalesin interfaceLocalizationService- Returns:
- a Set of
Locales for the current system.
-
getSupportedLocales
protected java.util.Map<java.util.Locale,DefaultLocalizationService.DataLocale> getSupportedLocales()
Deprecated, for removal: This API element is subject to removal in a future version.Each hybrisLanguageis encapsulates into aDefaultLocalizationService.DataLocaleand is put with the correspondingLocaleinto the map. Additionally each of those items are cached.We added to
JaloTypeCacheUnitunit additional unique value for a current user, nevertheless changes of the supported locales list for a one user in scope of different tenants , still might cause problems (see HOR-893). Note also the memory impact - for a every user there will be separate cache of supported locales created.- Returns:
- a map where
Localeare mapped toDefaultLocalizationService.DataLocale
-
isLocalizationFallbackEnabled
public boolean isLocalizationFallbackEnabled()
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
isLocalizationFallbackEnabledin interfaceLocalizationService- Returns:
trueif in the current JaloSession the localization fallback is enabled.
-
setLocalizationFallbackEnabled
public void setLocalizationFallbackEnabled(boolean enabled)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
setLocalizationFallbackEnabledin interfaceLocalizationService- Parameters:
enabled- iftruethe localization fallback will be enabled.
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.ExceptionDeprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractServiceInvoked by a BeanFactory after it has set all bean properties supplied. Overwrite this method for adding/implementing additional code into the service. Important note: Please call alwayssuper.afterPropertiesSet()before or the java serialization won't work.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classAbstractService- Throws:
java.lang.Exception- See Also:
InitializingBean.afterPropertiesSet()
-
keyInvalidated
public void keyInvalidated(java.lang.Object[] key, int invalidationType, InvalidationTarget target, RemoteInvalidationSource remoteSrc)Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
keyInvalidatedin interfaceInvalidationListener
-
-