public void afterPropertiesSet()

in src/main/groovy/grails/plugins/quartz/CustomTriggerFactoryBean.java [45:71]


    public void afterPropertiesSet() throws ParseException {
        // Create a trigger by the class name
        customTrigger = BeanUtils.instantiateClass(triggerClass);

        // If trigger is a standard trigger, set standard properties
        if(customTrigger instanceof AbstractTrigger){
            AbstractTrigger at =(AbstractTrigger) customTrigger;

            // Set job details
            if(jobDetail!=null){
                at.setJobKey(jobDetail.getKey());
            }

            // Set start delay
            if (triggerAttributes.containsKey(GrailsJobClassConstants.START_DELAY)) {
                Number startDelay = (Number) triggerAttributes.remove(GrailsJobClassConstants.START_DELAY);
                at.setStartTime(new Date(System.currentTimeMillis() + startDelay.longValue()));
            } else {
            	at.setStartTime(new Date());
			}
        }

        // Set non standard properties.
        BeanWrapper customTriggerWrapper = PropertyAccessorFactory.forBeanPropertyAccess(customTrigger);
        customTriggerWrapper.registerCustomEditor(String.class, new StringEditor());
        customTriggerWrapper.setPropertyValues(triggerAttributes);
    }