/** * Creates an event generator which generates time events with the given resolution in timeunits * via the output port {@link #OUTPUT_PORT_NAME_CURRENT_TIME_RECORD}. * * @param configuration The configuration to be used for this plugin. * @param projectContext The project context to be used for this plugin. */ public CurrentTimeEventGenerationFilter( final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); this.timeunit = super.recordsTimeUnitFromProjectContext; final String configTimeunitProperty = configuration.getStringProperty(CONFIG_PROPERTY_NAME_TIMEUNIT); TimeUnit configTimeunit; try { configTimeunit = TimeUnit.valueOf(configTimeunitProperty); } catch (final IllegalArgumentException ex) { this.log.warn( configTimeunitProperty + " is no valid TimeUnit! Using inherited value of " + this.timeunit.name() + " instead."); configTimeunit = this.timeunit; } this.timerResolution = this.timeunit.convert( configuration.getLongProperty(CONFIG_PROPERTY_NAME_TIME_RESOLUTION), configTimeunit); }