[Ejtools-cvs] applications/jmx.browser/src/main/org/ejtools/jmx/browser/state/rules GraphInternalFra
Brought to you by:
letiemble
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/state/rules
In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/main/org/ejtools/jmx/browser/state/rules
Added Files:
GraphInternalFrameRule.java ResourceGraphRule.java
ResourceRule.java ServerInternalFrameRule.java ServerRule.java
Log Message:
Address Bug #775745
Address Todo #800902
Address Todo #755528
Remove @created tags
Add support for MXJ4 2.0.0 (still beta)
Add support for JXM Remoting through RMI
--- 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.jmx.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: ResourceGraphRule.java ---
/*
* Created on 20 juin 2003
*
* To change this generated comment go to
* Window>Preferences>Java>Code Generation>Code Template
*/
package org.ejtools.jmx.browser.state.rules;
import java.util.Map;
import org.ejtools.graph.service.GraphConsumer;
import org.ejtools.graph.service.GraphConsumerSelector;
import org.ejtools.jmx.browser.model.Resource;
import org.ejtools.util.state.DefaultRule;
import org.xml.sax.Attributes;
/**
* @author letiemble
* @created 20 juin 2003
* @version $Revision: 1.1 $
*/
public class ResourceGraphRule extends DefaultRule
{
/**
* Description of the Method
*
* @param context Description of the Parameter
*/
public void loadEnter(Map context)
{
Resource resource = (Resource) context.get("RESOURCE");
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);
}
}
}
--- NEW FILE: ResourceRule.java ---
/*
* Created on 20 juin 2003
*
* To change this generated comment go to
* Window>Preferences>Java>Code Generation>Code Template
*/
package org.ejtools.jmx.browser.state.rules;
import java.util.Map;
import org.ejtools.jmx.browser.frame.ServerInternalFrame;
import org.ejtools.jmx.browser.model.Resource;
import org.ejtools.util.state.DefaultRule;
import org.xml.sax.Attributes;
/**
* @author letiemble
* @created 20 juin 2003
* @version $Revision: 1.1 $
*/
public class ResourceRule 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");
Resource resource = frame.queryMBean(objectName);
if (resource != null)
{
context.put("RESOURCE", resource);
String listen = attrs.getValue("listen");
if ("true".equals(listen))
{
try
{
resource.registerForNotifications();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
}
}
--- NEW FILE: ServerInternalFrameRule.java ---
/*
* EJTools, the Enterprise Java Tools
*
* Distributable under LGPL license.
* See terms of license at www.gnu.org.
*/
package org.ejtools.jmx.browser.state.rules;
import java.util.Map;
import org.ejtools.jmx.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.jmx.browser.state.rules;
import java.beans.beancontext.BeanContextServices;
import java.util.Map;
import org.ejtools.jmx.browser.frame.ServerInternalFrame;
import org.ejtools.jmx.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();
}
}
}
|