org.araneaframework.integration.spring
Class SpringLocalizationFilterService
java.lang.Object
org.araneaframework.core.BaseComponent
org.araneaframework.core.BaseService
org.araneaframework.framework.core.BaseFilterService
org.araneaframework.framework.filter.StandardLocalizationFilterService
org.araneaframework.integration.spring.SpringLocalizationFilterService
- All Implemented Interfaces:
- Serializable, Component, FilterService, LocalizationContext, SpringLocalizationContext, Service
public class SpringLocalizationFilterService
- extends StandardLocalizationFilterService
- implements SpringLocalizationContext
Provides the SpringLocalizationContext and
LocalizationContext implementation that uses the
MessageSource of the Spring framework. It is mainly targeted for
projects that also use the Spring framework IoC container, and want to let
the latter handle message context configuration. This service, however, helps
to use the same message context in Aranea.
This filter service is accessible from the Environment by key
SpringLocalizationContext.class.
To enable this service instead of the
StandardLocalizationFilterService, one must define (to override the
default solution) it in aranea-conf.xml:
<bean id="araneaLocalizationFilter" singleton="false"
class="org.araneaframework.integration.spring.SpringLocalizationFilterService">
<property name="languageName" value="de" />
</bean>
- Author:
- Rein Raudjärv
- See Also:
- Serialized Form
| Methods inherited from class org.araneaframework.core.BaseComponent |
_addComponent, _addComponent, _checkCall, _disableComponent, _enableComponent, _endCall, _endWaitingCall, _getChildren, _getComponent, _getDisabledChildren, _propagate, _relocateComponent, _removeComponent, _setEnvironment, _setScope, _startCall, _startWaitingCall, _strictCheckCall, _strictStartCall, _waitNoCall, disable, enable, getEnvironment, getScope, handleException, isAlive, isDead, isInitialized |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpringLocalizationFilterService
public SpringLocalizationFilterService()
getMessageSource
public MessageSource getMessageSource()
- Description copied from interface:
SpringLocalizationContext
- Provides access to the
MessageSource from the Spring
framework.
- Specified by:
getMessageSource in interface SpringLocalizationContext
- Returns:
- the
MessageSource from the Spring framework.
getMessage
public String getMessage(String code,
Object[] args,
String defaultMessage)
- Description copied from interface:
LocalizationContext
- Localizes the code and uses it to format the message with the passed arguments.
The format of the localized message should be acceptable by
java.text.MessageFormat.
If the localized message cannot be resolved uses defaultMessage instead.
- Specified by:
getMessage in interface LocalizationContext- Overrides:
getMessage in class StandardLocalizationFilterService
getMessage
public String getMessage(String code,
Object[] args)
- Description copied from interface:
LocalizationContext
- Localizes the code and uses it to format the message with the passed arguments.
The format of the localized message should be acceptable by
java.text.MessageFormat.
- Specified by:
getMessage in interface LocalizationContext- Overrides:
getMessage in class StandardLocalizationFilterService
getChildEnvironment
protected Environment getChildEnvironment()
- Description copied from class:
BaseFilterService
- Returns the Environment of this service by default. The child is initilized
with this method. Meant for overriding.
- Overrides:
getChildEnvironment in class StandardLocalizationFilterService
getResourceBundle
public ResourceBundle getResourceBundle(Locale locale)
- Description copied from class:
StandardLocalizationFilterService
- Gets a resource bundle using the specified resource bundle name and current
locale and the ClassLoaders provided by the ClassLoaderUtil.
- Specified by:
getResourceBundle in interface LocalizationContext- Overrides:
getResourceBundle in class StandardLocalizationFilterService
localize
public String localize(String key)
- Description copied from interface:
LocalizationContext
- Localizes a string returning one that corresponds to the current locale.
- Specified by:
localize in interface LocalizationContext- Overrides:
localize in class StandardLocalizationFilterService