KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > piratepete > dbpirate > CommandManager


1 package com.piratepete.dbpirate;
2
3
4 import com.piratepete.dbpirate.Const;
5 import EDU.oswego.cs.dl.util.concurrent.*;
6 import com.piratepete.dbpirate.commands.*;
7
8
9 /**
10  * CommandManager Class
11  * Copyright (C) 2003 David L. Whitehurst<p>
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.<p>
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.<p>
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.<p>
26  *
27  * <a HREF="http://www.piratepetesoftware.com">piratepetesoftware.com</a><br>
28  * <a HREF="mailto:dlwhitehurst@comcast.net">dlwhitehurst@comcast.net</a>
29  *
30  * @version 1.0a
31  */

32 public class CommandManager {
33
34         public CommandManager() {}
35         
36         public static void run (int commandID) {
37             
38             switch (commandID) {
39                 
40                 case Const.CMD_NEWCONNECTION :
41                     // call new connection command object here
42
try {
43                         ThreadedExecutor executor = new ThreadedExecutor();
44                         NewConnection task = new NewConnection();
45                         executor.execute(task);
46                         
47                     } catch (InterruptedException JavaDoc iex) {
48                         // do something
49
}
50                     
51                     break;
52                     
53                     
54                 
55                 
56             }
57             
58         }
59 }
60
Popular Tags