1 12 13 package org.ejtools.jmx.browser.state.rules; 14 15 16 17 import java.beans.beancontext.BeanContextServices ; 18 19 import java.util.Map ; 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 ; 30 31 32 33 42 43 public class ServerRule extends DefaultRule 44 45 { 46 47 56 57 public void loadEnter(Map context) 58 59 { 60 61 BeanContextServices container = (BeanContextServices ) 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 attrs = (Attributes ) context.get("ATTRIBUTES"); 80 81 82 83 String name = attrs.getValue("name"); 84 85 server.setName(name); 86 87 88 89 String 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 |