1 7 package org.ejtools.management.browser.state.rules; 8 9 import java.beans.beancontext.BeanContextServices ; 10 import java.util.Map ; 11 12 import org.ejtools.management.browser.frame.ServerInternalFrame; 13 import org.ejtools.management.browser.model.Server; 14 import org.ejtools.util.state.DefaultRule; 15 import org.xml.sax.Attributes ; 16 17 22 public class ServerRule extends DefaultRule 23 { 24 29 public void loadEnter(Map context) 30 { 31 BeanContextServices container = (BeanContextServices ) context.get("CONTAINER"); 32 ServerInternalFrame frame = (ServerInternalFrame) context.get("FRAME"); 33 34 Server server = new Server(); 35 context.put("SERVER", server); 36 37 frame.setServer(server); 38 container.add(frame); 39 40 Attributes attrs = (Attributes ) context.get("ATTRIBUTES"); 41 42 String name = attrs.getValue("name"); 43 server.setName(name); 44 45 String connected = attrs.getValue("connected"); 46 if ("true".equals(connected)) 47 { 48 server.connect(); 49 } 50 } 51 } 52 | Popular Tags |