Update of /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model
In directory usw-pr-cvs1:/tmp/cvs-serv28897/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model
Added Files:
ConnectionService.java ConnectionServiceProvider.java
Log Message:
Initial Import
--- NEW FILE: ConnectionService.java ---
package net.sourceforge.ejtools.jmxbrowser.model;
import java.util.Set;
import java.io.Serializable;
import javax.management.Attribute;
import javax.management.MBeanInfo;
import javax.management.ObjectName;
import javax.management.QueryExp;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
/**
* Description of the Class
*
* @author letiembl
* @created 13 décembre 2001
*/
public interface ConnectionService extends Serializable
{
public Object getAttribute(ObjectName name, String attribute) throws Exception;
public String getDefaultDomain() throws Exception;
public Integer getMBeanCount() throws Exception;
public MBeanInfo getMBeanInfo(ObjectName name) throws Exception;
public Object invoke(ObjectName name, String action, Object[] params, String[] signatures) throws Exception;
public Set queryMBeans(ObjectName name, QueryExp exp) throws Exception;
public void setAttribute(ObjectName name, Attribute attribute) throws Exception;
public void setEJBName(String ejbName);
public void setFactory(String factory);
public void setPackages(String pkgs);
public void setURL(String url);
}
--- NEW FILE: ConnectionServiceProvider.java ---
package net.sourceforge.ejtools.jmxbrowser.model;
import java.beans.beancontext.BeanContextServiceProvider;
import java.beans.beancontext.BeanContextServices;
import java.beans.beancontext.BeanContextServicesSupport;
import java.util.Iterator;
import java.util.Vector;
import net.sourceforge.ejtools.util.JNDI;
/**
* Description of the Class
*
* @author letiembl
* @created 13 décembre 2001
*/
public class ConnectionServiceProvider extends BeanContextServicesSupport implements BeanContextServiceProvider
{
/** Description of the Field */
protected ConnectionService service = null;
protected String type = null;
public ConnectionServiceProvider(String type) {
this.type= type;
}
/**
* Getter for the currentServiceSelectors attribute
*
* @param bcs Description of Parameter
* @param serviceClass Description of Parameter
* @return The value
*/
public Iterator getCurrentServiceSelectors(BeanContextServices bcs, java.lang.Class serviceClass)
{
return (new Vector()).iterator();
}
/**
* Getter for the service attribute
*
* @param bcs Description of Parameter
* @param requestor Description of Parameter
* @param serviceClass Description of Parameter
* @param serviceSelector Description of Parameter
* @return The value
*/
public Object getService(BeanContextServices bcs, java.lang.Object requestor, java.lang.Class serviceClass, java.lang.Object serviceSelector)
{
if (service == null)
{
if("EJB".equals(type)) {
service = new EJBConnectionService();
}
if("RMI".equals(type)) {
service = new RMIConnectionService();
}
if("LOCAL".equals(type)) {
service = new LocalConnectionService();
}
}
return service;
}
/**
* Description of the Method
*
* @param bcs Description of Parameter
* @param requestor Description of Parameter
* @param service Description of Parameter
*/
public void releaseService(BeanContextServices bcs, java.lang.Object requestor, java.lang.Object service) { }
/** Description of the Method */
protected void initializeBeanContextResources()
{
((BeanContextServices) getBeanContext()).addService(ConnectionService.class, this);
}
}
|