core/src/main/java/com/digitalpebble/stormcrawler/persistence/Scheduler.java
@SuppressWarnings({ "rawtypes", "unchecked" })
    public static Scheduler getInstance(Map stormConf) {
        Scheduler scheduler;

        String className = ConfUtils.getString(stormConf,
                schedulerClassParamName);

        if (StringUtils.isBlank(className)) {
            throw new RuntimeException("Missing value for config  "
                    + schedulerClassParamName);
        }

        try {
            Class<?> schedulerc = Class.forName(className);
            boolean interfaceOK = Scheduler.class.isAssignableFrom(schedulerc);
            if (!interfaceOK) {
                throw new RuntimeException("Class " + className
                        + " must extend Scheduler");
            }
            scheduler = (Scheduler) schedulerc.newInstance();
        } catch (Exception e) {
            throw new RuntimeException("Can't instanciate " + className);
        }

        scheduler.init(stormConf);
        return scheduler;
    }
@SuppressWarnings({ "rawtypes", "unchecked" })
    public static Scheduler getInstance(Map stormConf) {
        Scheduler scheduler;

        String className = ConfUtils.getString(stormConf,
                schedulerClassParamName);

        if (StringUtils.isBlank(className)) {
            throw new RuntimeException("Missing value for config  "
                    + schedulerClassParamName);
        }

        try {
            Class<?> schedulerc = Class.forName(className);
            boolean interfaceOK = Scheduler.class.isAssignableFrom(schedulerc);
            if (!interfaceOK) {
                throw new RuntimeException("Class " + className
                        + " must extend Scheduler");
            }
            scheduler = (Scheduler) schedulerc.newInstance();
        } catch (Exception e) {
            throw new RuntimeException("Can't instanciate " + className);
        }

        scheduler.init(stormConf);
        return scheduler;
    }
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public static Scheduler getInstance ( Map stormConf ) { Scheduler scheduler ; String className = ConfUtils . getString ( stormConf , schedulerClassParamName ) ; if ( StringUtils . isBlank ( className ) ) { throw new RuntimeException ( "Missing value for config  " + schedulerClassParamName ) ; } try { Class < ? > schedulerc = Class . forName ( className ) ; boolean interfaceOK = Scheduler . class . isAssignableFrom ( schedulerc ) ; if ( ! interfaceOK ) { throw new RuntimeException ( "Class " + className + " must extend Scheduler" ) ; } scheduler = ( Scheduler ) schedulerc . newInstance ( ) ; } catch ( Exception e ) { throw new RuntimeException ( "Can't instanciate " + className ) ; } scheduler . init ( stormConf ) ; return scheduler ; }
Returns a Scheduler instance based on the configuration *
Returns a Scheduler instance based on the configuration *