org.quartz.xml
Class JobSchedulingDataProcessor.SimpleConverterRule
java.lang.Object
org.apache.commons.digester.Rule
org.apache.commons.digester.BeanPropertySetterRule
org.quartz.xml.JobSchedulingDataProcessor.SimpleConverterRule
- Enclosing class:
- JobSchedulingDataProcessor
public class JobSchedulingDataProcessor.SimpleConverterRule
- extends org.apache.commons.digester.BeanPropertySetterRule
This rule is needed to fix QUARTZ-153.
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.
- Author:
- Chris Bonham
| Fields inherited from class org.apache.commons.digester.BeanPropertySetterRule |
bodyText, propertyName |
| Fields inherited from class org.apache.commons.digester.Rule |
digester, namespaceURI |
|
Method Summary |
void |
end(String namespace,
String name)
Process the end of this element. |
| Methods inherited from class org.apache.commons.digester.BeanPropertySetterRule |
body, finish, toString |
| Methods inherited from class org.apache.commons.digester.Rule |
begin, begin, body, end, getDigester, getNamespaceURI, setDigester, setNamespaceURI |
JobSchedulingDataProcessor.SimpleConverterRule
public JobSchedulingDataProcessor.SimpleConverterRule(String propertyName,
org.apache.commons.beanutils.Converter converter,
Class clazz)
Construct rule that sets the given property from the body text.
- Parameters:
propertyName - name of property to setconverter - converter to useclazz - class to convert to
end
public void end(String namespace,
String name)
throws Exception
- Process the end of this element.
- Overrides:
end in class org.apache.commons.digester.BeanPropertySetterRule
- Parameters:
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 otherwise
- Throws:
NoSuchMethodException - if the bean does not
have a writeable property of the specified name
Exception