[Ejtools-cvs] applications/management.browser/src/main/org/ejtools/management/browser/state/rules Gr
Brought to you by:
letiemble
From: <let...@us...> - 2003-11-27 01:39:52
|
Update of /cvsroot/ejtools/applications/management.browser/src/main/org/ejtools/management/browser/state/rules In directory sc8-pr-cvs1:/tmp/cvs-serv18798/management.browser/src/main/org/ejtools/management/browser/state/rules Added Files: GraphInternalFrameRule.java ManagedObjectRule.java ManagementGraphRule.java ServerInternalFrameRule.java ServerRule.java Log Message: Address Todo #800902 Address Todo #755528 --- NEW FILE: GraphInternalFrameRule.java --- /* * Created on 20 juin 2003 * * To change this generated comment go to * Window>Preferences>Java>Code Generation>Code Template */ package org.ejtools.management.browser.state.rules; import java.beans.beancontext.BeanContextServices; import java.util.Map; import org.ejtools.graph.frame.GraphInternalFrame; import org.ejtools.util.state.DefaultRule; import org.xml.sax.Attributes; /** * @author letiemble * @created 20 juin 2003 * @version $Revision: 1.1 $ */ public class GraphInternalFrameRule extends DefaultRule { /** * Description of the Method * * @param context Description of the Parameter */ public void loadEnter(Map context) { BeanContextServices container = (BeanContextServices) context.get("CONTAINER"); GraphInternalFrame frame = new GraphInternalFrame(); Attributes attrs = (Attributes) context.get("ATTRIBUTES"); String name = attrs.getValue("name"); frame.setName(name); String delay = attrs.getValue("delay"); frame.setName(name); frame.setDelay(Long.parseLong(delay)); String scale = attrs.getValue("scale"); frame.setName(name); frame.setScale(Double.parseDouble(scale)); container.add(frame); } } --- NEW FILE: ManagedObjectRule.java --- /* * Created on 20 juin 2003 * * To change this generated comment go to * Window>Preferences>Java>Code Generation>Code Template */ package org.ejtools.management.browser.state.rules; import java.util.Map; import org.ejtools.management.browser.frame.ServerInternalFrame; import org.ejtools.management.browser.model.ManagedObject; import org.ejtools.util.state.DefaultRule; import org.xml.sax.Attributes; /** * @author letiemble * @created 20 juin 2003 * @version $Revision: 1.1 $ */ public class ManagedObjectRule extends DefaultRule { /** * Description of the Method * * @param context Description of the Parameter */ public void loadEnter(Map context) { ServerInternalFrame frame = (ServerInternalFrame) context.get("FRAME"); Attributes attrs = (Attributes) context.get("ATTRIBUTES"); String objectName = attrs.getValue("objectName"); ManagedObject resource = frame.queryMBean(objectName); if (resource != null) { context.put("MANAGED-OBJECT", resource); String listen = attrs.getValue("listen"); if ("true".equals(listen)) { try { resource.registerForNotifications(); } catch (Exception e) { e.printStackTrace(); } } } } } --- NEW FILE: ManagementGraphRule.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.management.browser.state.rules; import java.util.Map; import org.ejtools.graph.service.GraphConsumer; import org.ejtools.graph.service.GraphConsumerSelector; import org.ejtools.management.browser.model.ManagedObject; import org.ejtools.util.state.DefaultRule; import org.xml.sax.Attributes; /** * @author letiemble * @version $Revision: 1.1 $ */ public class ManagementGraphRule extends DefaultRule { /** * Description of the Method * * @param context Description of the Parameter */ public void loadEnter(Map context) { ManagedObject resource = (ManagedObject) context.get("MANAGED-OBJECT"); if (resource != null) { Attributes attrs = (Attributes) context.get("ATTRIBUTES"); String attribute = attrs.getValue("attribute"); String target = attrs.getValue("target"); GraphConsumer consumer = GraphConsumerSelector.select(resource, target); resource.registerForGraph(consumer, attribute, null); } } } --- NEW FILE: ServerInternalFrameRule.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.management.browser.state.rules; import java.util.Map; import org.ejtools.management.browser.frame.ServerInternalFrame; import org.ejtools.util.state.DefaultRule; /** * @author letiembl * @version $Revision: 1.1 $ * @created 20 juin 2003 */ public class ServerInternalFrameRule extends DefaultRule { /** * Description of the Method * * @param context Description of the Parameter */ public void loadEnter(Map context) { ServerInternalFrame frame = new ServerInternalFrame(); context.put("FRAME", frame); context.put("HOLDER", frame); } } --- NEW FILE: ServerRule.java --- /* * Created on 20 juin 2003 * * To change this generated comment go to * Window>Preferences>Java>Code Generation>Code Template */ package org.ejtools.management.browser.state.rules; import java.beans.beancontext.BeanContextServices; import java.util.Map; import org.ejtools.management.browser.frame.ServerInternalFrame; import org.ejtools.management.browser.model.Server; import org.ejtools.util.state.DefaultRule; import org.xml.sax.Attributes; /** * @author letiemble * @created 20 juin 2003 * @version $Revision: 1.1 $ */ public class ServerRule extends DefaultRule { /** * Description of the Method * * @param context Description of the Parameter */ public void loadEnter(Map context) { BeanContextServices container = (BeanContextServices) context.get("CONTAINER"); ServerInternalFrame frame = (ServerInternalFrame) context.get("FRAME"); Server server = new Server(); context.put("SERVER", server); frame.setServer(server); container.add(frame); Attributes attrs = (Attributes) context.get("ATTRIBUTES"); String name = attrs.getValue("name"); server.setName(name); String connected = attrs.getValue("connected"); if ("true".equals(connected)) { server.connect(); } } } |