1 12 13 package org.ejtools.jmx.browser.state.rules; 14 15 16 17 import java.util.Map ; 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 ; 30 31 32 33 42 43 public class ResourceGraphRule extends DefaultRule 44 45 { 46 47 56 57 public void loadEnter(Map context) 58 59 { 60 61 Resource resource = (Resource) context.get("RESOURCE"); 62 63 if (resource != null) 64 65 { 66 67 Attributes attrs = (Attributes ) context.get("ATTRIBUTES"); 68 69 70 71 String attribute = attrs.getValue("attribute"); 72 73 String 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 |