KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > test > cms > stress > SleepCommand


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.test.cms.stress;
10
11 import org.jboss.portal.cms.NodeFactory;
12
13 /**
14  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
15  * @version $Revision: 1.1 $
16  */

17 public class SleepCommand extends Command
18 {
19
20    private long millis;
21
22    public SleepCommand(String JavaDoc millis)
23    {
24       this.millis = Long.parseLong(millis);
25    }
26
27    public void execute(Client.Result result, NodeFactory factory) throws Exception JavaDoc
28    {
29       Thread.sleep(millis);
30    }
31
32    protected String JavaDoc describe()
33    {
34       return "[sleep," + millis + "]";
35    }
36 }
37
Popular Tags