All Downloads are FREE. Search and download functionalities are using the official Maven repository.

step.functions.base.defaults.SleepKeyword Maven / Gradle / Ivy

There is a newer version: 3.21.1
Show newest version
/*******************************************************************************
 * (C) Copyright 2016 Dorian Cransac and Jerome Comte
 *  
 * This file is part of rtm
 *  
 * rtm is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *  
 * rtm is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *  
 * You should have received a copy of the GNU Affero General Public License
 * along with rtm.  If not, see .
 *******************************************************************************/
package step.functions.base.defaults;

import step.core.accessors.Attribute;
import step.handlers.javahandler.AbstractKeyword;

@Attribute(key="project", value="@Common")
public class SleepKeyword extends AbstractKeyword{
	
	//@Keyword
	@Attribute(key="htmlTemplate", value="")
	public void Sleep(){
		int sleepDurationMs;
		try {
			sleepDurationMs  = input.getInt("sleepTime");
		} catch (Exception e) {
			try {
				sleepDurationMs = Integer.parseInt(input.getString("sleepTime"));
			} catch (Exception e2) {
				throw new RuntimeException("Unable to parse attribute 'sleepTime' as long.",e2);
			}
		} 

		try {
			Thread.sleep(sleepDurationMs);
		} catch (InterruptedException e) {
		} finally {
			//
		}	
	}
	

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy