KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > jmx > browser > state > rules > ServerRule


1 /*
2
3  * Created on 20 juin 2003
4
5  *
6
7  * To change this generated comment go to
8
9  * Window>Preferences>Java>Code Generation>Code Template
10
11  */

12
13 package org.ejtools.jmx.browser.state.rules;
14
15
16
17 import java.beans.beancontext.BeanContextServices JavaDoc;
18
19 import java.util.Map JavaDoc;
20
21
22
23 import org.ejtools.jmx.browser.frame.ServerInternalFrame;
24
25 import org.ejtools.jmx.browser.model.Server;
26
27 import org.ejtools.util.state.DefaultRule;
28
29 import org.xml.sax.Attributes JavaDoc;
30
31
32
33 /**
34
35  * @author letiemble
36
37  * @created 20 juin 2003
38
39  * @version $Revision: 1.2 $
40
41  */

42
43 public class ServerRule extends DefaultRule
44
45 {
46
47    /**
48
49     * Description of the Method
50
51     *
52
53     * @param context Description of the Parameter
54
55     */

56
57    public void loadEnter(Map JavaDoc context)
58
59    {
60
61       BeanContextServices JavaDoc container = (BeanContextServices JavaDoc) context.get("CONTAINER");
62
63       ServerInternalFrame frame = (ServerInternalFrame) context.get("FRAME");
64
65
66
67       Server server = new Server();
68
69       context.put("SERVER", server);
70
71
72
73       frame.setServer(server);
74
75       container.add(frame);
76
77
78
79       Attributes JavaDoc attrs = (Attributes JavaDoc) context.get("ATTRIBUTES");
80
81
82
83       String JavaDoc name = attrs.getValue("name");
84
85       server.setName(name);
86
87
88
89     String JavaDoc connected = attrs.getValue("connected");
90
91     if ("true".equals(connected))
92
93     {
94
95        server.connect();
96
97     }
98
99    }
100
101 }
102
103
Popular Tags