[Ejtools-cvs] applications/management.browser/src/main/org/ejtools/management/browser/model/service
Brought to you by:
letiemble
From: <let...@us...> - 2003-12-14 08:40:55
|
Update of /cvsroot/ejtools/applications/management.browser/src/main/org/ejtools/management/browser/model/service In directory sc8-pr-cvs1:/tmp/cvs-serv21061/management.browser/src/main/org/ejtools/management/browser/model/service Modified Files: CacheService.java CacheServiceProvider.java ConnectionMetaData.java ConnectionService.java ConnectionServiceProvider.java MEJBConnectionService.java NotificationService.java NotificationServiceProvider.java Log Message: Add more javadocs. Adjust workspace persistence. Index: CacheService.java =================================================================== RCS file: /cvsroot/ejtools/applications/management.browser/src/main/org/ejtools/management/browser/model/service/CacheService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CacheService.java 27 Nov 2003 01:39:48 -0000 1.3 --- CacheService.java 13 Dec 2003 22:31:57 -0000 1.4 *************** *** 1,67 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.io.Serializable; ! import java.util.Enumeration; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface CacheService extends Serializable ! { ! /** Description of the Field */ ! public final int DOMAIN_TYPE = 0; ! /** Description of the Field */ ! public final int RESOURCE_TYPE = 1; ! ! ! /** ! * Adds a feature to the Entity attribute of the CacheService object ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! * @param value Description of the Parameter ! */ ! public void add(int type, Object key, Object value); ! ! ! /** ! * Description of the Method ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! */ ! public void remove(int type, Object key); ! ! ! /** ! * Description of the Method ! * ! * @param type Description of the Parameter ! * @return Description of the Return Value ! */ ! public Enumeration keys(int type); ! ! ! /** Description of the Method */ ! public void clear(); ! ! ! /** ! * Description of the Method ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object get(int type, Object key); ! } --- 1,67 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.io.Serializable; ! import java.util.Enumeration; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface CacheService extends Serializable ! { ! /** Description of the Field */ ! public final int DOMAIN_TYPE = 0; ! /** Description of the Field */ ! public final int RESOURCE_TYPE = 1; ! ! ! /** ! * Adds a feature to the Entity attribute of the CacheService object ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! * @param value Description of the Parameter ! */ ! public void add(int type, Object key, Object value); ! ! ! /** ! * Description of the Method ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! */ ! public void remove(int type, Object key); ! ! ! /** ! * Description of the Method ! * ! * @param type Description of the Parameter ! * @return Description of the Return Value ! */ ! public Enumeration keys(int type); ! ! ! /** Description of the Method */ ! public void clear(); ! ! ! /** ! * Description of the Method ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object get(int type, Object key); ! } Index: CacheServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/applications/management.browser/src/main/org/ejtools/management/browser/model/service/CacheServiceProvider.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CacheServiceProvider.java 27 Nov 2003 01:39:48 -0000 1.3 --- CacheServiceProvider.java 13 Dec 2003 22:31:57 -0000 1.4 *************** *** 1,167 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.beans.beancontext.BeanContextServices; ! import java.util.Enumeration; ! import java.util.Hashtable; ! import java.util.Iterator; ! import java.util.Vector; ! ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Service release to complete ! */ ! public class CacheServiceProvider extends CustomBeanContextServiceProvider implements CacheService ! { ! /** Description of the Field */ ! protected Hashtable domains = new Hashtable(); ! /** Description of the Field */ ! protected Hashtable resources = new Hashtable(); ! /** Description of the Field */ ! protected CacheService service = null; ! ! ! /** Constructor for the ConnectionServiceProvider object */ ! public CacheServiceProvider() ! { ! service = this; ! } ! ! ! /** ! * Adds a feature to the Entity attribute of the CacheServiceProvider object ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! * @param value Description of the Parameter ! */ ! public void add(int type, Object key, Object value) ! { ! this.getTable(type).put(key, value); ! // logger.debug("Entity added " + type + ", " + key); ! } ! ! ! /** Description of the Method */ ! public void clear() ! { ! super.clear(); ! this.getTable(CacheService.DOMAIN_TYPE).clear(); ! this.getTable(CacheService.RESOURCE_TYPE).clear(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object get(int type, Object key) ! { ! return this.getTable(type).get(key); ! } ! ! ! /** ! * Getter for the currentServiceSelectors attribute ! * ! * @param bcs Description of the Parameter ! * @param serviceClass Description of the 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 the Parameter ! * @param requestor Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @param serviceSelector Description of the Parameter ! * @return The 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 type Description of the Parameter ! * @return Description of the Return Value ! */ ! public Enumeration keys(int type) ! { ! return this.getTable(type).keys(); ! } ! ! ! /** ! * 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) { } ! ! ! /** ! * Description of the Method ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! */ ! public void remove(int type, Object key) ! { ! this.getTable(type).remove(key); ! // logger.debug("Entity removed " + type + ", " + key); ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{CacheService.class}; ! } ! ! ! /** ! * Gets the table attribute of the CacheServiceProvider object ! * ! * @param type Description of the Parameter ! * @return The table value ! * @paramtype Description of the Parameter ! * @paramtype Description of the Parameter ! * @paramtype Description of the Parameter ! */ ! protected Hashtable getTable(int type) ! { ! if (type == CacheService.DOMAIN_TYPE) ! { ! return this.domains; ! } ! return this.resources; ! } ! } --- 1,167 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.beans.beancontext.BeanContextServices; ! import java.util.Enumeration; ! import java.util.Hashtable; ! import java.util.Iterator; ! import java.util.Vector; ! ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Service release to complete ! */ ! public class CacheServiceProvider extends CustomBeanContextServiceProvider implements CacheService ! { ! /** Description of the Field */ ! protected Hashtable domains = new Hashtable(); ! /** Description of the Field */ ! protected Hashtable resources = new Hashtable(); ! /** Description of the Field */ ! protected CacheService service = null; ! ! ! /** Constructor for the ConnectionServiceProvider object */ ! public CacheServiceProvider() ! { ! service = this; ! } ! ! ! /** ! * Adds a feature to the Entity attribute of the CacheServiceProvider object ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! * @param value Description of the Parameter ! */ ! public void add(int type, Object key, Object value) ! { ! this.getTable(type).put(key, value); ! // logger.debug("Entity added " + type + ", " + key); ! } ! ! ! /** Description of the Method */ ! public void clear() ! { ! super.clear(); ! this.getTable(CacheService.DOMAIN_TYPE).clear(); ! this.getTable(CacheService.RESOURCE_TYPE).clear(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object get(int type, Object key) ! { ! return this.getTable(type).get(key); ! } ! ! ! /** ! * Getter for the currentServiceSelectors attribute ! * ! * @param bcs Description of the Parameter ! * @param serviceClass Description of the 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 the Parameter ! * @param requestor Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @param serviceSelector Description of the Parameter ! * @return The 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 type Description of the Parameter ! * @return Description of the Return Value ! */ ! public Enumeration keys(int type) ! { ! return this.getTable(type).keys(); ! } ! ! ! /** ! * 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) { } ! ! ! /** ! * Description of the Method ! * ! * @param type Description of the Parameter ! * @param key Description of the Parameter ! */ ! public void remove(int type, Object key) ! { ! this.getTable(type).remove(key); ! // logger.debug("Entity removed " + type + ", " + key); ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{CacheService.class}; ! } ! ! ! /** ! * Gets the table attribute of the CacheServiceProvider object ! * ! * @param type Description of the Parameter ! * @return The table value ! * @paramtype Description of the Parameter ! * @paramtype Description of the Parameter ! * @paramtype Description of the Parameter ! */ ! protected Hashtable getTable(int type) ! { ! if (type == CacheService.DOMAIN_TYPE) ! { ! return this.domains; ! } ! return this.resources; ! } ! } Index: ConnectionMetaData.java =================================================================== RCS file: /cvsroot/ejtools/applications/management.browser/src/main/org/ejtools/management/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:39:48 -0000 1.3 --- ConnectionMetaData.java 13 Dec 2003 22:31:57 -0000 1.4 *************** *** 1,93 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import org.ejtools.util.service.ProfileMetaData; ! ! /** ! * @author Laurent Etiemble ! * @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.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"; ! ! ! /** Constructor for ConnectionMetaData. */ ! public ConnectionMetaData() ! { ! super(); ! } ! ! ! /** ! * Gets the fileName attribute of the ConnectionMetaData object ! * ! * @return The fileName value ! */ ! public String getFileName() ! { ! return "/management.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,93 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import org.ejtools.util.service.ProfileMetaData; ! ! /** ! * @author Laurent Etiemble ! * @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.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"; ! ! ! /** Constructor for ConnectionMetaData. */ ! public ConnectionMetaData() ! { ! super(); ! } ! ! ! /** ! * Gets the fileName attribute of the ConnectionMetaData object ! * ! * @return The fileName value ! */ ! public String getFileName() ! { ! return "/management.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/management.browser/src/main/org/ejtools/management/browser/model/service/ConnectionService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConnectionService.java 27 Nov 2003 01:39:48 -0000 1.3 --- ConnectionService.java 13 Dec 2003 22:31:57 -0000 1.4 *************** *** 1,51 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.io.Serializable; ! ! import javax.management.j2ee.Management; ! ! import org.ejtools.util.service.Profile; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface ConnectionService extends Serializable ! { ! /** ! * Gets the mBeanServer attribute of the ConnectionService object ! * ! * @return The mBeanServer value ! */ ! public Management getMEJB(); ! ! ! /** ! * 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,51 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.io.Serializable; ! ! import javax.management.j2ee.Management; ! ! import org.ejtools.util.service.Profile; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface ConnectionService extends Serializable ! { ! /** ! * Gets the mBeanServer attribute of the ConnectionService object ! * ! * @return The mBeanServer value ! */ ! public Management getMEJB(); ! ! ! /** ! * 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/management.browser/src/main/org/ejtools/management/browser/model/service/ConnectionServiceProvider.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConnectionServiceProvider.java 27 Nov 2003 01:39:48 -0000 1.3 --- ConnectionServiceProvider.java 13 Dec 2003 22:31:57 -0000 1.4 *************** *** 1,80 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ConnectionServiceProvider extends CustomBeanContextServiceProvider ! { ! /** Description of the Field */ ! protected ConnectionService service = null; ! ! ! /** Constructor for the ConnectionServiceProvider object */ ! public ConnectionServiceProvider() ! { ! this.service = new MEJBConnectionService(); ! } ! ! ! /** ! * 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}; ! } ! } --- 1,80 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ConnectionServiceProvider extends CustomBeanContextServiceProvider ! { ! /** Description of the Field */ ! protected ConnectionService service = null; ! ! ! /** Constructor for the ConnectionServiceProvider object */ ! public ConnectionServiceProvider() ! { ! this.service = new MEJBConnectionService(); ! } ! ! ! /** ! * 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}; ! } ! } Index: MEJBConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/management.browser/src/main/org/ejtools/management/browser/model/service/MEJBConnectionService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MEJBConnectionService.java 27 Nov 2003 01:39:48 -0000 1.3 --- MEJBConnectionService.java 13 Dec 2003 22:31:57 -0000 1.4 *************** *** 1,146 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.util.Hashtable; ! ! import javax.management.j2ee.Management; ! import javax.management.j2ee.ManagementHome; ! import javax.naming.Context; ! import javax.naming.InitialContext; ! import javax.rmi.PortableRemoteObject; ! ! import org.apache.log4j.Logger; ! import org.ejtools.util.service.Profile; ! ! /** ! * MEJB connection that holds the EJB handle to the J2EE server ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class MEJBConnectionService implements ConnectionService ! { ! /** Connected state */ ! protected boolean connected = false; ! /** Description of the Field */ ! protected Management mejb = null; ! /** The connection profile */ ! protected Profile profile = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(MEJBConnectionService.class); ! ! ! /** Constructor for MEJBConnectionService. */ ! public MEJBConnectionService() ! { ! super(); ! } ! ! ! /** ! * Connect to the MBean server with this profile ! * ! * @param profile Connection profile ! */ ! public void connect(Profile profile) ! { ! this.profile = profile; ! try ! { ! this.createMEJB(); ! this.setConnected(true); ! } ! catch (Exception e) ! { ! logger.error("Error while connecting to MEJB", e); ! this.setConnected(false); ! } ! } ! ! ! /** Disconnect from the MBean server */ ! public void disconnect() ! { ! try ! { ! this.mejb.remove(); ! } ! catch (Exception e) ! { ! logger.warn("Error while disconnecting from MEJB", e); ! // Do nothing ! } ! this.setConnected(false); ! } ! ! ! /** ! * Gets the proxied MBean server ! * ! * @return The MBeanServer proxy ! */ ! public Management getMEJB() ! { ! if (!this.connected) ! { ! logger.warn("Service is not connected"); ! throw new IllegalStateException("The service is not connected. Call 'connect' method before."); ! } ! if (this.mejb == null) ! { ! logger.warn("MEJB reference is null"); ! throw new IllegalStateException("The server is null. Call 'connect' method before."); ! } ! return this.mejb; ! } ! ! ! /** ! * Return whether the connector is connector ! * ! * @return true if connected ! */ ! public boolean isConnected() ! { ! return this.connected; ! } ! ! ! /** ! * Sets the connection state value ! * ! * @param connected The connection state ! */ ! public void setConnected(boolean connected) ! { ! this.connected = connected; ! } ! ! ! /** ! * Create the proxy to the MBean server. This method must set the MBean server after a successful creation. ! * ! * @exception Exception Description of the Exception ! */ ! protected void createMEJB() ! throws Exception ! { ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! InitialContext context = new InitialContext(props); ! Object ref = context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! ! ManagementHome home = (ManagementHome) PortableRemoteObject.narrow(ref, ManagementHome.class); ! this.mejb = home.create(); ! } ! } --- 1,146 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.util.Hashtable; ! ! import javax.management.j2ee.Management; ! import javax.management.j2ee.ManagementHome; ! import javax.naming.Context; ! import javax.naming.InitialContext; ! import javax.rmi.PortableRemoteObject; ! ! import org.apache.log4j.Logger; ! import org.ejtools.util.service.Profile; ! ! /** ! * MEJB connection that holds the EJB handle to the J2EE server ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class MEJBConnectionService implements ConnectionService ! { ! /** Connected state */ ! protected boolean connected = false; ! /** Description of the Field */ ! protected Management mejb = null; ! /** The connection profile */ ! protected Profile profile = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(MEJBConnectionService.class); ! ! ! /** Constructor for MEJBConnectionService. */ ! public MEJBConnectionService() ! { ! super(); ! } ! ! ! /** ! * Connect to the MBean server with this profile ! * ! * @param profile Connection profile ! */ ! public void connect(Profile profile) ! { ! this.profile = profile; ! try ! { ! this.createMEJB(); ! this.setConnected(true); ! } ! catch (Exception e) ! { ! logger.error("Error while connecting to MEJB", e); ! this.setConnected(false); ! } ! } ! ! ! /** Disconnect from the MBean server */ ! public void disconnect() ! { ! try ! { ! this.mejb.remove(); ! } ! catch (Exception e) ! { ! logger.warn("Error while disconnecting from MEJB", e); ! // Do nothing ! } ! this.setConnected(false); ! } ! ! ! /** ! * Gets the proxied MBean server ! * ! * @return The MBeanServer proxy ! */ ! public Management getMEJB() ! { ! if (!this.connected) ! { ! logger.warn("Service is not connected"); ! throw new IllegalStateException("The service is not connected. Call 'connect' method before."); ! } ! if (this.mejb == null) ! { ! logger.warn("MEJB reference is null"); ! throw new IllegalStateException("The server is null. Call 'connect' method before."); ! } ! return this.mejb; ! } ! ! ! /** ! * Return whether the connector is connector ! * ! * @return true if connected ! */ ! public boolean isConnected() ! { ! return this.connected; ! } ! ! ! /** ! * Sets the connection state value ! * ! * @param connected The connection state ! */ ! public void setConnected(boolean connected) ! { ! this.connected = connected; ! } ! ! ! /** ! * Create the proxy to the MBean server. This method must set the MBean server after a successful creation. ! * ! * @exception Exception Description of the Exception ! */ ! protected void createMEJB() ! throws Exception ! { ! Hashtable props = new Hashtable(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.profile.getProperty(ConnectionMetaData.FACTORY)); ! props.put(Context.URL_PKG_PREFIXES, this.profile.getProperty(ConnectionMetaData.PACKAGES)); ! props.put(Context.PROVIDER_URL, this.profile.getProperty(ConnectionMetaData.URL)); ! props.put(Context.SECURITY_PRINCIPAL, this.profile.getProperty(ConnectionMetaData.PRINCIPAL)); ! props.put(Context.SECURITY_CREDENTIALS, this.profile.getProperty(ConnectionMetaData.CREDENTIALS)); ! ! InitialContext context = new InitialContext(props); ! Object ref = context.lookup(this.profile.getProperty(ConnectionMetaData.CONTEXT)); ! ! ManagementHome home = (ManagementHome) PortableRemoteObject.narrow(ref, ManagementHome.class); ! this.mejb = home.create(); ! } ! } Index: NotificationService.java =================================================================== RCS file: /cvsroot/ejtools/applications/management.browser/src/main/org/ejtools/management/browser/model/service/NotificationService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NotificationService.java 27 Nov 2003 01:39:48 -0000 1.3 --- NotificationService.java 13 Dec 2003 22:31:57 -0000 1.4 *************** *** 1,56 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.io.Serializable; ! import java.util.Collection; ! ! import javax.management.ObjectName; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface NotificationService extends Serializable ! { ! /** ! * Adds a feature to the ObjectName attribute of the NotificationService object ! * ! * @param object The feature to be added to the ObjectName attribute ! */ ! public void addObjectName(ObjectName object); ! ! ! /** ! * Description of the Method ! * ! * @param object Description of the Parameter ! */ ! public void removeObjectName(ObjectName object); ! ! ! /** ! * Description of the Method ! * ! * @param object Description of the Parameter ! * @return Description of the Return Value ! */ ! public boolean hasObjectName(ObjectName object); ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public Collection listAll(); ! ! ! /** Description of the Method */ ! public void clearAll(); ! } --- 1,56 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.io.Serializable; ! import java.util.Collection; ! ! import javax.management.ObjectName; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface NotificationService extends Serializable ! { ! /** ! * Adds a feature to the ObjectName attribute of the NotificationService object ! * ! * @param object The feature to be added to the ObjectName attribute ! */ ! public void addObjectName(ObjectName object); ! ! ! /** ! * Description of the Method ! * ! * @param object Description of the Parameter ! */ ! public void removeObjectName(ObjectName object); ! ! ! /** ! * Description of the Method ! * ! * @param object Description of the Parameter ! * @return Description of the Return Value ! */ ! public boolean hasObjectName(ObjectName object); ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public Collection listAll(); ! ! ! /** Description of the Method */ ! public void clearAll(); ! } Index: NotificationServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/applications/management.browser/src/main/org/ejtools/management/browser/model/service/NotificationServiceProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NotificationServiceProvider.java 27 Nov 2003 01:39:48 -0000 1.4 --- NotificationServiceProvider.java 13 Dec 2003 22:31:57 -0000 1.5 *************** *** 1,384 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.awt.Component; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextServices; ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.ResourceBundle; ! import java.util.Vector; ! ! import javax.management.Notification; ! import javax.management.NotificationListener; ! import javax.management.ObjectName; ! import javax.management.j2ee.ListenerRegistration; ! import javax.swing.JTable; ! import javax.swing.table.AbstractTableModel; ! ! import org.apache.log4j.Logger; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! import org.ejtools.swing.table.TableModelSorter; ! import org.ejtools.util.LimitedStack; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Service release to complete ! */ ! public class NotificationServiceProvider extends CustomBeanContextServiceProvider implements BeanContextChildComponentProxy, NotificationService, NotificationListener ! { ! /** Description of the Field */ ! protected NotificationTableModel model = null; ! /** Description of the Field */ ! protected LimitedStack notifications = new LimitedStack(500); ! /** Description of the Field */ ! protected Vector objectNames = new Vector(); ! /** Description of the Field */ ! protected NotificationService service = null; ! /** Description of the Field */ ! protected JTable table = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(NotificationServiceProvider.class); ! /** Description of the Field */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.management.browser.Resources"); ! ! ! /** Constructor for the ConnectionServiceProvider object */ ! public NotificationServiceProvider() ! { ! this.service = this; ! } ! ! ! /** ! * Adds a feature to the ObjectName attribute of the NotificationService object ! * ! * @param object The feature to be added to the ObjectName attribute ! */ ! public void addObjectName(ObjectName object) ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! ! if (this.hasObjectName(object)) ! { ! return; ! } ! ! if (context.hasService(ConnectionService.class)) ! { ! logger.debug("Using service ConnectionService..."); ! try ! { ! ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! ListenerRegistration registration = service.getMEJB().getListenerRegistry(); ! logger.debug("ListenerRegistration " + registration); ! registration.addNotificationListener(object, this, null, "EJTOOLS Management BROWSER"); ! this.objectNames.add(object.getCanonicalName()); ! context.releaseService(this, this, ConnectionService.class); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation of service ConnectionService", e); ! } ! } ! } ! ! ! /** Description of the Method */ ! public void clearAll() ! { ! this.notifications.clear(); ! } ! ! ! /** ! * @return The component value ! */ ! public Component getComponent() ! { ! if (this.table == null) ! { ! this.model = new NotificationServiceProvider.NotificationTableModel(); ! TableModelSorter sorter = new TableModelSorter(this.model); ! this.table = new JTable(sorter); ! sorter.addMouseListenerToHeaderInTable(this.table); ! } ! return this.table; ! } ! ! ! /** ! * 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 notification Description of the Parameter ! * @param handback Description of the Parameter ! */ ! public void handleNotification(Notification notification, java.lang.Object handback) ! { ! logger.debug("Notification received (" + handback + ")"); ! this.notifications.push(notification); ! if (this.model != null) ! { ! this.model.fireTableRowsInserted(this.notifications.size(), this.notifications.size()); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param object Description of the Parameter ! * @return Description of the Return Value ! */ ! public boolean hasObjectName(ObjectName object) ! { ! return this.objectNames.contains(object.getCanonicalName()); ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public Collection listAll() ! { ! return this.reverse(notifications); ! } ! ! ! /** ! * 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) { } ! ! ! /** ! * Description of the Method ! * ! * @param object Description of the Parameter ! */ ! public void removeObjectName(ObjectName object) ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! ! if (!this.hasObjectName(object)) ! { ! return; ! } ! ! if (context.hasService(ConnectionService.class)) ! { ! logger.debug("Using service ConnectionService..."); ! try ! { ! ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! ListenerRegistration registration = service.getMEJB().getListenerRegistry(); ! logger.debug("ListenerRegistration " + registration); ! registration.removeNotificationListener(object, this); ! this.objectNames.remove(object.getCanonicalName()); ! context.releaseService(this, this, ConnectionService.class); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation of service ConnectionService", e); ! } ! } ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{NotificationService.class}; ! } ! ! ! /** ! * Description of the Method ! * ! * @param collection Description of the Parameter ! * @return Description of the Return Value ! * @todo Move elsewhere ! */ ! protected Collection reverse(Collection collection) ! { ! Vector result = new Vector(); ! ! Iterator it = collection.iterator(); ! while (it.hasNext()) ! { ! result.insertElementAt(it.next(), 0); ! } ! ! return result; ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! * @created 18 septembre 2002 ! * @todo I18N ! */ ! private class NotificationTableModel extends AbstractTableModel ! { ! /** Description of the Field */ ! private String COLUMN_MESSAGE = resources.getString("notification.table.column.message"); ! /** Description of the Field */ ! private String COLUMN_SEQUENCE = resources.getString("notification.table.column.sequence"); ! /** Description of the Field */ ! private String COLUMN_SOURCE = resources.getString("notification.table.column.source"); ! /** Description of the Field */ ! private String COLUMN_TIMESTAMP = resources.getString("notification.table.column.timestamp"); ! /** Description of the Field */ ! private String COLUMN_TYPE = resources.getString("notification.table.column.type"); ! ! ! /** ! * @param columnIndex Description of the Parameter ! * @return The columnClass value ! */ ! public Class getColumnClass(int columnIndex) ! { ! switch (columnIndex) ! { ! case 0: ! return Object.class; ! case 1: ! return String.class; ! case 2: ! return String.class; ! case 3: ! return String.class; ! case 4: ! return String.class; ! } ! return Object.class; ! } ! ! ! /** ! * @return The columnCount value ! */ ! public int getColumnCount() ! { ! return 5; ! } ! ! ! /** ! * @param columnIndex Description of the Parameter ! * @return The columnName value ! */ ! public String getColumnName(int columnIndex) ! { ! switch (columnIndex) ! { ! case 0: ! return COLUMN_SOURCE; ! case 1: ! return COLUMN_TIMESTAMP; ! case 2: ! return COLUMN_SEQUENCE; ! case 3: ! return COLUMN_TYPE; ! case 4: ! return COLUMN_MESSAGE; ! } ! return super.getColumnName(columnIndex); ! } ! ! ! /** ! * @return The rowCount value ! */ ! public int getRowCount() ! { ! return NotificationServiceProvider.this.notifications.size(); ! } ! ! ! /** ! * @param rowIndex Description of the Parameter ! * @param columnIndex Description of the Parameter ! * @return The valueAt value ! */ ! public Object getValueAt(int rowIndex, int columnIndex) ! { ! Object o = null; ! if (rowIndex < NotificationServiceProvider.this.notifications.size()) ! { ! Notification notif = (Notification) NotificationServiceProvider.this.notifications.elementAt(rowIndex); ! switch (columnIndex) ! { ! case 0: ! o = notif.getSource(); ! break; ! case 1: ! o = new String("" + notif.getTimeStamp()); ! break; ! case 2: ! o = new String("" + notif.getSequenceNumber()); ! break; ! case 3: ! o = notif.getType(); ! break; ! case 4: ! o = notif.getMessage(); ! break; ! } ! } ! if (o == null) ! { ! o = new String(); ! } ! return o; ! } ! } ! } --- 1,384 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.management.browser.model.service; ! ! import java.awt.Component; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextServices; ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.ResourceBundle; ! import java.util.Vector; ! ! import javax.management.Notification; ! import javax.management.NotificationListener; ! import javax.management.ObjectName; ! import javax.management.j2ee.ListenerRegistration; ! import javax.swing.JTable; ! import javax.swing.table.AbstractTableModel; ! ! import org.apache.log4j.Logger; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! import org.ejtools.swing.table.TableModelSorter; ! import org.ejtools.util.LimitedStack; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Service release to complete ! */ ! public class NotificationServiceProvider extends CustomBeanContextServiceProvider implements BeanContextChildComponentProxy, NotificationService, NotificationListener ! { ! /** Description of the Field */ ! protected NotificationTableModel model = null; ! /** Description of the Field */ ! protected LimitedStack notifications = new LimitedStack(500); ! /** Description of the Field */ ! protected Vector objectNames = new Vector(); ! /** Description of the Field */ ! protected NotificationService service = null; ! /** Description of the Field */ ! protected JTable table = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(NotificationServiceProvider.class); ! /** Description of the Field */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.management.browser.Resources"); ! ! ! /** Constructor for the ConnectionServiceProvider object */ ! public NotificationServiceProvider() ! { ! this.service = this; ! } ! ! ! /** ! * Adds a feature to the ObjectName attribute of the NotificationService object ! * ! * @param object The feature to be added to the ObjectName attribute ! */ ! public void addObjectName(ObjectName object) ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! ! if (this.hasObjectName(object)) ! { ! return; ! } ! ! if (context.hasService(ConnectionService.class)) ! { ! logger.debug("Using service ConnectionService..."); ! try ! { ! ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! ListenerRegistration registration = service.getMEJB().getListenerRegistry(); ! logger.debug("ListenerRegistration " + registration); ! registration.addNotificationListener(object, this, null, "EJTOOLS Management BROWSER"); ! this.objectNames.add(object.getCanonicalName()); ! context.releaseService(this, this, ConnectionService.class); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation of service ConnectionService", e); ! } ! } ! } ! ! ! /** Description of the Method */ ! public void clearAll() ! { ! this.notifications.clear(); ! } ! ! ! /** ! * @return The component value ! */ ! public Component getComponent() ! { ! if (this.table == null) ! { ! this.model = new NotificationServiceProvider.NotificationTableModel(); ! TableModelSorter sorter = new TableModelSorter(this.model); ! this.table = new JTable(sorter); ! sorter.addMouseListenerToHeaderInTable(this.table); ! } ! return this.table; ! } ! ! ! /** ! * 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 notification Description of the Parameter ! * @param handback Description of the Parameter ! */ ! public void handleNotification(Notification notification, java.lang.Object handback) ! { ! logger.debug("Notification received (" + handback + ")"); ! this.notifications.push(notification); ! if (this.model != null) ! { ! this.model.fireTableRowsInserted(this.notifications.size(), this.notifications.size()); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param object Description of the Parameter ! * @return Description of the Return Value ! */ ! public boolean hasObjectName(ObjectName object) ! { ! return this.objectNames.contains(object.getCanonicalName()); ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public Collection listAll() ! { ! return this.reverse(notifications); ! } ! ! ! /** ! * 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) { } ! ! ! /** ! * Description of the Method ! * ! * @param object Description of the Parameter ! */ ! public void removeObjectName(ObjectName object) ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! ! if (!this.hasObjectName(object)) ! { ! return; ! } ! ! if (context.hasService(ConnectionService.class)) ! { ! logger.debug("Using service ConnectionService..."); ! try ! { ! ConnectionService service = (ConnectionService) context.getService(this, this, ConnectionService.class, this, this); ! ListenerRegistration registration = service.getMEJB().getListenerRegistry(); ! logger.debug("ListenerRegistration " + registration); ! registration.removeNotificationListener(object, this); ! this.objectNames.remove(object.getCanonicalName()); ! context.releaseService(this, this, ConnectionService.class); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation of service ConnectionService", e); ! } ! } ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{NotificationService.class}; ! } ! ! ! /** ! * Description of the Method ! * ! * @param collection Description of the Parameter ! * @return Description of the Return Value ! * @todo Move elsewhere ! */ ! protected Collection reverse(Collection collection) ! { ! Vector result = new Vector(); ! ! Iterator it = collection.iterator(); ! while (it.hasNext()) ! { ! result.insertElementAt(it.next(), 0); ! } ! ! return result; ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! * @created 18 septembre 2002 ! * @todo I18N ! */ ! private class NotificationTableModel extends AbstractTableModel ! { ! /** Description of the Field */ ! private String COLUMN_MESSAGE = resources.getString("notification.table.column.message"); ! /** Description of the Field */ ! private String COLUMN_SEQUENCE = resources.getString... [truncated message content] |