commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1531136 - /commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
Date Thu, 10 Oct 2013 22:25:10 GMT
Author: markt
Date: Thu Oct 10 22:25:10 2013
New Revision: 1531136

URL: http://svn.apache.org/r1531136
Log:
Remove remains of JMX notification support

Modified:
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java?rev=1531136&r1=1531135&r2=1531136&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
Thu Oct 10 22:25:10 2013
@@ -29,16 +29,10 @@ import java.util.concurrent.atomic.Atomi
 
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanNotificationInfo;
 import javax.management.MBeanRegistrationException;
 import javax.management.MBeanServer;
 import javax.management.MalformedObjectNameException;
 import javax.management.NotCompliantMBeanException;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
 import javax.management.ObjectName;
 
 import org.apache.commons.pool2.PooledObject;
@@ -57,7 +51,7 @@ import org.apache.commons.pool2.Swallowe
  *
  * @since 2.0
  */
-public abstract class BaseGenericObjectPool<T> implements NotificationEmitter {
+public abstract class BaseGenericObjectPool<T> {
 
     // Constants
     /**
@@ -107,7 +101,6 @@ public abstract class BaseGenericObjectP
 
     // Monitoring (primarily JMX) attributes
     private final ObjectName oname;
-    private final NotificationBroadcasterSupport jmxNotificationSupport;
     private final String creationStackTrace;
     private final AtomicLong borrowedCount = new AtomicLong(0);
     private final AtomicLong returnedCount = new AtomicLong(0);
@@ -134,10 +127,8 @@ public abstract class BaseGenericObjectP
     public BaseGenericObjectPool(BaseObjectPoolConfig config,
             String jmxNameBase, String jmxNamePrefix) {
         if (config.getJmxEnabled()) {
-            this.jmxNotificationSupport = new NotificationBroadcasterSupport();
             this.oname = jmxRegister(jmxNameBase, jmxNamePrefix);
         } else {
-            this.jmxNotificationSupport = null;
             this.oname = null;
         }
 
@@ -791,16 +782,9 @@ public abstract class BaseGenericObjectP
     }
 
     /**
-     * Returns the {@link NotificationBroadcasterSupport} for the pool
-     * @return JMX notification broadcaster
-     */
-    final NotificationBroadcasterSupport getJmxNotificationSupport() {
-        return jmxNotificationSupport;
-    }
-
-    /**
-     * Swallows an exception, sends a JMX notification, and adds the swallowed exception
-     * to the swallowed exceptions queue.
+     * Swallows an exception and notifies the configured listener for swallowed
+     * exceptions queue.
+     *
      * @param e exception to be swallowed
      */
     final void swallowException(Exception e) {
@@ -974,52 +958,6 @@ public abstract class BaseGenericObjectP
     }
 
 
-    // Implement NotificationEmitter interface
-
-    @Override
-    public final void addNotificationListener(NotificationListener listener,
-            NotificationFilter filter, Object handback)
-            throws IllegalArgumentException {
-
-        if (jmxNotificationSupport == null) {
-            throw new UnsupportedOperationException("JMX is not enabled");
-        }
-        jmxNotificationSupport.addNotificationListener(
-                listener, filter, handback);
-    }
-
-    @Override
-    public final void removeNotificationListener(NotificationListener listener)
-            throws ListenerNotFoundException {
-
-        if (jmxNotificationSupport == null) {
-            throw new UnsupportedOperationException("JMX is not enabled");
-        }
-        jmxNotificationSupport.removeNotificationListener(listener);
-    }
-
-    @Override
-    public final MBeanNotificationInfo[] getNotificationInfo() {
-
-        if (jmxNotificationSupport == null) {
-            throw new UnsupportedOperationException("JMX is not enabled");
-        }
-        return jmxNotificationSupport.getNotificationInfo();
-    }
-
-    @Override
-    public final void removeNotificationListener(NotificationListener listener,
-            NotificationFilter filter, Object handback)
-            throws ListenerNotFoundException {
-
-        if (jmxNotificationSupport == null) {
-            throw new UnsupportedOperationException("JMX is not enabled");
-        }
-        jmxNotificationSupport.removeNotificationListener(
-                listener, filter, handback);
-    }
-
-
     // Inner classes
 
     /**



Mime
View raw message