Thread: [Ejtools-cvs] CVS: applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model Domain
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-04-22 17:39:08
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model In directory usw-pr-cvs1:/tmp/cvs-serv29020/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model Added Files: Domain.java EJBConnectionService.java Log Message: Initial Import --- NEW FILE: Domain.java --- package net.sourceforge.ejtools.jmxbrowser.model; import java.awt.*; import java.beans.*; import java.beans.beancontext.*; import java.util.*; import javax.management.*; import javax.naming.*; import javax.swing.*; import org.w3c.dom.*; import com.dreambean.awt.*; /** * Description of the Class * * @author letiembl * @created 13 décembre 2001 */ public class Domain extends Node { /** Constructor */ public Domain() { } public String getSmallIcon(){ return "Home16.gif"; } /** * Setter for the reference attribute * * @param resource The new value */ public void setReference(ObjectInstance resource) { this.name = resource.getObjectName().getDomain(); } } --- NEW FILE: EJBConnectionService.java --- package net.sourceforge.ejtools.jmxbrowser.model; import java.util.Set; import javax.management.Attribute; import javax.management.MBeanInfo; import javax.management.ObjectName; import javax.management.QueryExp; import javax.naming.InitialContext; import javax.rmi.PortableRemoteObject; import org.jboss.jmx.adaptor.interfaces.Adaptor; import org.jboss.jmx.adaptor.interfaces.AdaptorHome; /** * Description of the Class * * @author letiembl * @created 13 décembre 2001 */ public class EJBConnectionService implements ConnectionService { /** Description of the Field */ protected transient Adaptor connector = null; /** Description of the Field */ protected String ejbName = null; /** Description of the Field */ protected String factory = null; /** Description of the Field */ protected String pkgs = null; /** Description of the Field */ protected String url = null; /** Constructor */ protected EJBConnectionService() { } /** * Getter for the attribute attribute * * @param name Description of Parameter * @param attribute Description of Parameter * @return The value * @exception Exception Description of Exception */ public Object getAttribute(ObjectName name, String attribute) throws Exception { return getConnector().getAttribute(name, attribute); } /** * Getter for the defaultDomain attribute * * @return The value * @exception Exception Description of Exception */ public String getDefaultDomain() throws Exception { return getConnector().getDefaultDomain(); } /** * Getter for the mBeanCount attribute * * @return The value * @exception Exception Description of Exception */ public Integer getMBeanCount() throws Exception { return getConnector().getMBeanCount(); } /** * Getter for the mBeanInfo attribute * * @param name Description of Parameter * @return The value * @exception Exception Description of Exception */ public MBeanInfo getMBeanInfo(ObjectName name) throws Exception { return getConnector().getMBeanInfo(name); } /** * Description of the Method * * @param name Description of Parameter * @param action Description of Parameter * @param params Description of Parameter * @param signatures Description of Parameter * @return Description of the Returned Value * @exception Exception Description of Exception */ public Object invoke(ObjectName name, String action, Object[] params, String[] signatures) throws Exception { return getConnector().invoke(name, action, params, signatures); } /** * Description of the Method * * @param name Description of Parameter * @param exp Description of Parameter * @return Description of the Returned Value * @exception Exception Description of Exception */ public Set queryMBeans(ObjectName name, QueryExp exp) throws Exception { return getConnector().queryMBeans(name, exp); } /** * Setter for the attribute attribute * * @param name The new value * @param attribute The new value * @exception Exception Description of Exception */ public void setAttribute(ObjectName name, Attribute attribute) throws Exception { getConnector().setAttribute(name, attribute); } /** * Setter for the eJBName attribute * * @param ejbName The new value */ public void setEJBName(String ejbName) { this.ejbName = ejbName; connector = null; } /** * Setter for the factory attribute * * @param factory The new value */ public void setFactory(String factory) { this.factory = factory; connector = null; } /** * Setter for the packages attribute * * @param pkgs The new value */ public void setPackages(String pkgs) { this.pkgs = pkgs; connector = null; } /** * Setter for the url attribute * * @param url The new value */ public void setURL(String url) { this.url = url; connector = null; } /** * Description of the Method * * @return Description of the Returned Value * @exception Exception Description of Exception */ protected Adaptor getConnector() throws Exception { if (connector == null) { InitialContext context = new InitialContext(); Object ref = context.lookup(this.ejbName); AdaptorHome home = (AdaptorHome) PortableRemoteObject.narrow(ref, AdaptorHome.class); connector = home.create(); } return connector; } } |