Source code: org/alicebot/server/core/BotProcesses.java
1 // Decompiled by Jad v1.5.8c. Copyright 2001 Pavel Kouznetsov.
2 // Jad home page: http://www.geocities.com/kpdus/jad.html
3 // Decompiler options: packimports(3)
4
5 package org.alicebot.server.core;
6
7 import java.util.*;
8 import org.alicebot.server.core.util.Trace;
9
10 // Referenced classes of package org.alicebot.server.core:
11 // BotProcess
12
13 public class BotProcesses
14 {
15
16 public static void start(BotProcess botprocess, String s)
17 {
18 registry.put(s, botprocess);
19 Thread thread = new Thread(botprocess, s);
20 thread.setDaemon(true);
21 thread.start();
22 }
23
24 public static Iterator getRegistryIterator()
25 {
26 return registry.values().iterator();
27 }
28
29 public static BotProcess get(String s)
30 {
31 return (BotProcess)registry.get(s);
32 }
33
34 public static void shutdownAll()
35 {
36 Trace.userinfo("Shutting down all BotProcesses.");
37 BotProcess botprocess;
38 for(Iterator iterator = registry.values().iterator(); iterator.hasNext(); botprocess.shutdown())
39 {
40 botprocess = (BotProcess)iterator.next();
41 Trace.userinfo("Shutting down " + botprocess);
42 }
43
44 Trace.userinfo("Finished shutting down BotProcesses.");
45 }
46
47 private BotProcesses()
48 {
49 }
50
51 private static HashMap registry = new HashMap();
52
53 }