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.jmx.browser.frame.ServerInternalFrame; 22 23 import org.ejtools.jmx.browser.model.Resource; 24 25 import org.ejtools.util.state.DefaultRule; 26 27 import org.xml.sax.Attributes ; 28 29 30 31 40 41 public class ResourceRule extends DefaultRule 42 43 { 44 45 54 55 public void loadEnter(Map context) 56 57 { 58 59 ServerInternalFrame frame = (ServerInternalFrame) context.get("FRAME"); 60 61 Attributes attrs = (Attributes ) context.get("ATTRIBUTES"); 62 63 64 65 String objectName = attrs.getValue("objectName"); 66 67 Resource resource = frame.queryMBean(objectName); 68 69 if (resource != null) 70 71 { 72 73 context.put("RESOURCE", resource); 74 75 76 77 String listen = attrs.getValue("listen"); 78 79 if ("true".equals(listen)) 80 81 { 82 83 try 84 85 { 86 87 resource.registerForNotifications(); 88 89 } 90 91 catch (Exception e) 92 93 { 94 95 e.printStackTrace(); 96 97 } 98 99 } 100 101 } 102 103 } 104 105 } 106 107 | Popular Tags |