[Ejtools-cvs] applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/service ConnectionMeta
Brought to you by:
letiemble
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/service In directory sc8-pr-cvs1:/tmp/cvs-serv11709/jmx.browser/src/main/org/ejtools/jmx/browser/model/service Modified Files: ConnectionMetaData.java ConnectionService.java ConnectionServiceProvider.java Log Message: Add more javadocs. Adjust some things. Index: ConnectionMetaData.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/service/ConnectionMetaData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConnectionMetaData.java 27 Nov 2003 01:13:07 -0000 1.3 --- ConnectionMetaData.java 13 Dec 2003 22:15:07 -0000 1.4 *************** *** 1,98 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.service; ! ! import org.ejtools.util.service.ProfileMetaData; ! ! /** ! * @author letiembl ! * @created 14 novembre 2002 ! * @version $Revision$ ! */ ! public class ConnectionMetaData implements ProfileMetaData ! { ! /** Description of the Field */ ! protected String[] keys = new String[]{ ! ConnectionMetaData.CLASS_NAME, ! ConnectionMetaData.FACTORY, ! ConnectionMetaData.PACKAGES, ! ConnectionMetaData.URL, ! ConnectionMetaData.SERVICE, ! ConnectionMetaData.CONTEXT, ! ConnectionMetaData.PRINCIPAL, ! ConnectionMetaData.CREDENTIALS ! }; ! ! /** Description of the Field */ ! public final static String CLASS_NAME = "classname"; ! /** Description of the Field */ ! public final static String CONTEXT = "context"; ! /** Description of the Field */ ! public final static String CREDENTIALS = "credentials"; ! /** Description of the Field */ ! public final static String FACTORY = "factory"; ! /** Description of the Field */ ! public final static String PACKAGES = "packages"; ! /** Description of the Field */ ! public final static String PRINCIPAL = "principal"; ! /** Description of the Field */ ! public final static String URL = "url"; ! /** Description of the Field */ ! public final static String SERVICE = "service"; ! ! ! /** Constructor for ConnectionMetaData. */ ! public ConnectionMetaData() ! { ! super(); ! } ! ! ! /** ! * Gets the fileName attribute of the ConnectionMetaData object ! * ! * @return The fileName value ! */ ! public String getFileName() ! { ! return "/jmx.connection.properties"; ! } ! ! ! /** ! * Gets the key attribute of the ConnectionMetaData object ! * ! * @param index Description of the Parameter ! * @return The key value ! */ ! public String getKey(int index) ! { ! return this.keys[index]; ! } ! ! ! /** ! * Gets the keys attribute of the ConnectionMetaData object ! * ! * @return The keys value ! */ ! public String[] getKeys() ! { ! return this.keys; ! } ! ! ! /** ! * Gets the prefix attribute of the ConnectionMetaData object ! * ! * @return The prefix value ! */ ! public String getPrefix() ! { ! return "connection"; ! } ! } --- 1,98 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.service; ! ! import org.ejtools.util.service.ProfileMetaData; ! ! /** ! * @author letiembl ! * @created 14 novembre 2002 ! * @version $Revision$ ! */ ! public class ConnectionMetaData implements ProfileMetaData ! { ! /** Description of the Field */ ! protected String[] keys = new String[]{ ! ConnectionMetaData.CLASS_NAME, ! ConnectionMetaData.FACTORY, ! ConnectionMetaData.PACKAGES, ! ConnectionMetaData.URL, ! ConnectionMetaData.SERVICE, ! ConnectionMetaData.CONTEXT, ! ConnectionMetaData.PRINCIPAL, ! ConnectionMetaData.CREDENTIALS ! }; ! ! /** Description of the Field */ ! public final static String CLASS_NAME = "classname"; ! /** Description of the Field */ ! public final static String CONTEXT = "context"; ! /** Description of the Field */ ! public final static String CREDENTIALS = "credentials"; ! /** Description of the Field */ ! public final static String FACTORY = "factory"; ! /** Description of the Field */ ! public final static String PACKAGES = "packages"; ! /** Description of the Field */ ! public final static String PRINCIPAL = "principal"; ! /** Description of the Field */ ! public final static String URL = "url"; ! /** Description of the Field */ ! public final static String SERVICE = "service"; ! ! ! /** Constructor for ConnectionMetaData. */ ! public ConnectionMetaData() ! { ! super(); ! } ! ! ! /** ! * Gets the fileName attribute of the ConnectionMetaData object ! * ! * @return The fileName value ! */ ! public String getFileName() ! { ! return "/jmx.connection.properties"; ! } ! ! ! /** ! * Gets the key attribute of the ConnectionMetaData object ! * ! * @param index Description of the Parameter ! * @return The key value ! */ ! public String getKey(int index) ! { ! return this.keys[index]; ! } ! ! ! /** ! * Gets the keys attribute of the ConnectionMetaData object ! * ! * @return The keys value ! */ ! public String[] getKeys() ! { ! return this.keys; ! } ! ! ! /** ! * Gets the prefix attribute of the ConnectionMetaData object ! * ! * @return The prefix value ! */ ! public String getPrefix() ! { ! return "connection"; ! } ! } Index: ConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/service/ConnectionService.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConnectionService.java 10 Feb 2003 20:49:31 -0000 1.1 --- ConnectionService.java 13 Dec 2003 22:15:07 -0000 1.2 *************** *** 1,52 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.service; ! ! import java.io.Serializable; ! ! import javax.management.MBeanServer; ! ! import org.ejtools.util.service.Profile; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface ConnectionService extends Serializable ! { ! /** ! * Gets the mBeanServer attribute of the ConnectionService object ! * ! * @return The mBeanServer value ! */ ! public MBeanServer getMBeanServer(); ! ! ! /** ! * Gets the connected attribute of the ConnectionService object ! * ! * @return The connected value ! */ ! public boolean isConnected(); ! ! ! /** ! * Description of the Method ! * ! * @param profile Description of the Parameter ! */ ! public void connect(Profile profile); ! ! ! /** Description of the Method */ ! public void disconnect(); ! } ! --- 1,52 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.service; ! ! import java.io.Serializable; ! ! import javax.management.MBeanServer; ! ! import org.ejtools.util.service.Profile; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface ConnectionService extends Serializable ! { ! /** ! * Gets the mBeanServer attribute of the ConnectionService object ! * ! * @return The mBeanServer value ! */ ! public MBeanServer getMBeanServer(); ! ! ! /** ! * Gets the connected attribute of the ConnectionService object ! * ! * @return The connected value ! */ ! public boolean isConnected(); ! ! ! /** ! * Description of the Method ! * ! * @param profile Description of the Parameter ! */ ! public void connect(Profile profile); ! ! ! /** Description of the Method */ ! public void disconnect(); ! } ! Index: ConnectionServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/model/service/ConnectionServiceProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ConnectionServiceProvider.java 27 Nov 2003 01:13:07 -0000 1.4 --- ConnectionServiceProvider.java 13 Dec 2003 22:15:07 -0000 1.5 *************** *** 1,134 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.service; ! ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import org.apache.log4j.Logger; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! import org.ejtools.jmx.browser.model.connector.LocalConnectionService; ! import org.ejtools.util.service.Profile; ! ! /** ! * Description of the Class ! * ! * @author <a href="mailto:let...@us...">Laurent Etiemble</a> ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ConnectionServiceProvider extends CustomBeanContextServiceProvider ! { ! /** Description of the Field */ ! protected ConnectionService service = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ConnectionServiceProvider.class); ! ! ! /** Constructor for the ConnectionServiceProvider object */ ! public ConnectionServiceProvider() ! { ! this.setup(new LocalConnectionService()); ! } ! ! ! /** ! * Constructor for the ConnectionServiceProvider object ! * ! * @param metadata Description of the Parameter ! * @param loader Description of the Parameter ! */ ! public ConnectionServiceProvider(Profile metadata) ! { ! // Create the connection service from metadatas ! String clazz = metadata.getProperty(ConnectionMetaData.CLASS_NAME); ! if (clazz != null) ! { ! try ! { ! ConnectionService service = (ConnectionService) Thread.currentThread().getContextClassLoader().loadClass(clazz).newInstance(); ! this.setup(service); ! } ! catch (ClassNotFoundException cnfe) ! { ! logger.error(cnfe.getMessage(), cnfe); ! } ! catch (IllegalAccessException iae) ! { ! logger.error(iae.getMessage(), iae); ! } ! catch (Exception e) ! { ! logger.error(e.getMessage(), e); ! } ! } ! else ! { ! logger.error("Class provided is null"); ! } ! } ! ! ! /** ! * Getter for the currentServiceSelectors attribute ! * ! * @param bcs Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, java.lang.Class serviceClass) ! { ! return (new Vector()).iterator(); ! } ! ! ! /** ! * Getter for the service attribute ! * ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @param serviceSelector Description of the Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, java.lang.Object requestor, java.lang.Class serviceClass, java.lang.Object serviceSelector) ! { ! return this.service; ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param service Description of the Parameter ! */ ! public void releaseService(BeanContextServices bcs, java.lang.Object requestor, java.lang.Object service) { } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{ConnectionService.class}; ! } ! ! ! /** ! * Description of the Method ! * ! * @param service Description of the Parameter ! */ ! private void setup(ConnectionService service) ! { ! this.service = service; ! } ! } --- 1,134 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.model.service; ! ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import org.apache.log4j.Logger; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! import org.ejtools.jmx.browser.model.connector.LocalConnectionService; ! import org.ejtools.util.service.Profile; ! ! /** ! * Description of the Class ! * ! * @author <a href="mailto:let...@us...">Laurent Etiemble</a> ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ConnectionServiceProvider extends CustomBeanContextServiceProvider ! { ! /** Description of the Field */ ! protected ConnectionService service = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ConnectionServiceProvider.class); ! ! ! /** Constructor for the ConnectionServiceProvider object */ ! public ConnectionServiceProvider() ! { ! this.setup(new LocalConnectionService()); ! } ! ! ! /** ! * Constructor for the ConnectionServiceProvider object ! * ! * @param metadata Description of the Parameter ! * @param loader Description of the Parameter ! */ ! public ConnectionServiceProvider(Profile metadata) ! { ! // Create the connection service from metadatas ! String clazz = metadata.getProperty(ConnectionMetaData.CLASS_NAME); ! if (clazz != null) ! { ! try ! { ! ConnectionService service = (ConnectionService) Thread.currentThread().getContextClassLoader().loadClass(clazz).newInstance(); ! this.setup(service); ! } ! catch (ClassNotFoundException cnfe) ! { ! logger.error(cnfe.getMessage(), cnfe); ! } ! catch (IllegalAccessException iae) ! { ! logger.error(iae.getMessage(), iae); ! } ! catch (Exception e) ! { ! logger.error(e.getMessage(), e); ! } ! } ! else ! { ! logger.error("Class provided is null"); ! } ! } ! ! ! /** ! * Getter for the currentServiceSelectors attribute ! * ! * @param bcs Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, java.lang.Class serviceClass) ! { ! return (new Vector()).iterator(); ! } ! ! ! /** ! * Getter for the service attribute ! * ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @param serviceSelector Description of the Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, java.lang.Object requestor, java.lang.Class serviceClass, java.lang.Object serviceSelector) ! { ! return this.service; ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param service Description of the Parameter ! */ ! public void releaseService(BeanContextServices bcs, java.lang.Object requestor, java.lang.Object service) { } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{ConnectionService.class}; ! } ! ! ! /** ! * Description of the Method ! * ! * @param service Description of the Parameter ! */ ! private void setup(ConnectionService service) ! { ! this.service = service; ! } ! } |