org.quartz.xml
Class JobSchedulingDataProcessor.SimpleConverterRule

java.lang.Object
  extended byorg.apache.commons.digester.Rule
      extended byorg.apache.commons.digester.BeanPropertySetterRule
          extended byorg.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

Field Summary
 
Fields inherited from class org.apache.commons.digester.BeanPropertySetterRule
bodyText, propertyName
 
Fields inherited from class org.apache.commons.digester.Rule
digester, namespaceURI
 
Constructor Summary
JobSchedulingDataProcessor.SimpleConverterRule(String propertyName, org.apache.commons.beanutils.Converter converter, Class clazz)
          Construct rule that sets the given property from the body text.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 set
converter - converter to use
clazz - class to convert to
Method Detail

end

public void end(String namespace,
                String name)
         throws Exception
Process the end of this element.

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 namespace
name - 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

Quartz Enterprise Job Scheduler Project Page