public class JobSchedulingDataProcessor.SimpleConverterRule
extends org.apache.commons.digester.BeanPropertySetterRule
Since the Jakarta Commons BeanUtils 1.6.x ConvertUtils
class uses static utility
methods, the DateConverter
and TimeZoneConverter
were
overriding any previously registered converters for java.util.Date
and
java.util.TimeZone
.
Jakarta Commons BeanUtils 1.7.x fixes this issue by internally using per-context-classloader
pseudo-singletons (see
http://jakarta.apache.org/commons/beanutils/commons-beanutils-1.7.0/RELEASE-NOTES.txt).
This ensures web applications in the same JVM are using independent converters
based on their classloaders. However, the environment for QUARTZ-153 started Quartz
using the QuartzInitializationServlet
which started JobInitializationPlugin
.
In this case, the web classloader instances would be the same.
To make sure the converters aren't overridden by the JobSchedulingDataProcessor
,
it's easier to just override BeanPropertySetterRule.end()
to convert the
body text to the specified class using the specified converter.
Constructor and Description |
---|
JobSchedulingDataProcessor.SimpleConverterRule(java.lang.String propertyName,
org.apache.commons.beanutils.Converter converter,
java.lang.Class clazz)
Construct rule that sets the given property from the body text.
|
Modifier and Type | Method and Description |
---|---|
void |
end(java.lang.String namespace,
java.lang.String name)
Process the end of this element.
|
body, finish, toString
public JobSchedulingDataProcessor.SimpleConverterRule(java.lang.String propertyName, org.apache.commons.beanutils.Converter converter, java.lang.Class clazz)
Construct rule that sets the given property from the body text.
propertyName
- name of property to setconverter
- converter to useclazz
- class to convert topublic void end(java.lang.String namespace, java.lang.String name) throws java.lang.Exception
end
in class org.apache.commons.digester.BeanPropertySetterRule
namespace
- the namespace URI of the matching element, or an
empty string if the parser is not namespace aware or the element has
no namespacename
- the local name if the parser is namespace aware, or just
the element name otherwisejava.lang.NoSuchMethodException
- if the bean does not
have a writeable property of the specified namejava.lang.Exception