KickJava   Java API By Example, From Geeks To Geeks.

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


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.util.Map JavaDoc;
18
19
20
21 import org.ejtools.graph.service.GraphConsumer;
22
23 import org.ejtools.graph.service.GraphConsumerSelector;
24
25 import org.ejtools.jmx.browser.model.Resource;
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 ResourceGraphRule 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       Resource resource = (Resource) context.get("RESOURCE");
62
63       if (resource != null)
64
65       {
66
67          Attributes JavaDoc attrs = (Attributes JavaDoc) context.get("ATTRIBUTES");
68
69
70
71          String JavaDoc attribute = attrs.getValue("attribute");
72
73          String JavaDoc target = attrs.getValue("target");
74
75
76
77          GraphConsumer consumer = GraphConsumerSelector.select(resource, target);
78
79          resource.registerForGraph(consumer, attribute);
80
81       }
82
83    }
84
85 }
86
87
Popular Tags