commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1053598 - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref: PhantomReferenceObjectPool.java PhantomReferenceObjectPoolMBean.java SoftReferenceObjectPool.java WeakReferenceObjectPool.java WeakReferenceObjectPoolMBean.java
Date Wed, 29 Dec 2010 10:11:20 GMT
Author: simonetripodi
Date: Wed Dec 29 10:11:19 2010
New Revision: 1053598

URL: http://svn.apache.org/viewvc?rev=1053598&view=rev
Log:
added (Phantom|Weak)Reference pool implementations
fixed wrong import on SoftReferenceObjectPool

Added:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPool.java
  (with props)
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPoolMBean.java
  (with props)
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPool.java
  (with props)
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPoolMBean.java
  (with props)
Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/SoftReferenceObjectPool.java

Added: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPool.java?rev=1053598&view=auto
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPool.java
(added)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPool.java
Wed Dec 29 10:11:19 2010
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.pool2.ref;
+
+import java.lang.ref.PhantomReference;
+import java.lang.ref.ReferenceQueue;
+
+import org.apache.commons.pool2.ObjectPool;
+import org.apache.commons.pool2.PoolableObjectFactory;
+
+/**
+ * A {@link java.lang.ref.PhantomReference PhantomReference} based
+ * {@link ObjectPool}.
+ *
+ * @version $Revision$ $Date$
+ */
+public final class PhantomReferenceObjectPool<T> extends AbstractReferenceObjectPool<T,
PhantomReference<T>> implements PhantomReferenceObjectPoolMBean {
+
+    /**
+     * Create a <code>SoftReferenceObjectPool</code> with the specified factory.
+     *
+     * @param factory object factory to use, not {@code null}
+     * @throws IllegalArgumentException if the factory is null
+     */
+    public PhantomReferenceObjectPool(PoolableObjectFactory<T> factory) {
+        super(factory);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected PhantomReference<T> createReference(T referent, ReferenceQueue<? super
T> referenceQueue) {
+        return new PhantomReference<T>(referent, referenceQueue);
+    }
+
+}

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPool.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPool.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPoolMBean.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPoolMBean.java?rev=1053598&view=auto
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPoolMBean.java
(added)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPoolMBean.java
Wed Dec 29 10:11:19 2010
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.pool2.ref;
+
+/**
+ * The <code>PhantomReference</code>-based <code>ObjectPool</code>
JMX interface.
+ *
+ * @version $Revision$ $Date$
+ * @since 2.0
+ */
+public interface PhantomReferenceObjectPoolMBean extends ReferenceObjectPoolMBean {
+
+}

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPoolMBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPoolMBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/PhantomReferenceObjectPoolMBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/SoftReferenceObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/SoftReferenceObjectPool.java?rev=1053598&r1=1053597&r2=1053598&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/SoftReferenceObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/SoftReferenceObjectPool.java
Wed Dec 29 10:11:19 2010
@@ -22,7 +22,6 @@ import java.lang.ref.SoftReference;
 
 import org.apache.commons.pool2.ObjectPool;
 import org.apache.commons.pool2.PoolableObjectFactory;
-import org.apache.commons.pool2.reference.SoftReferenceObjectPoolMBean;
 
 /**
  * A {@link java.lang.ref.SoftReference SoftReference} based

Added: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPool.java?rev=1053598&view=auto
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPool.java
(added)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPool.java
Wed Dec 29 10:11:19 2010
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.pool2.ref;
+
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.WeakReference;
+
+import org.apache.commons.pool2.ObjectPool;
+import org.apache.commons.pool2.PoolableObjectFactory;
+
+/**
+ * A {@link java.lang.ref.WeakReference WeakReference} based
+ * {@link ObjectPool}.
+ *
+ * @version $Revision$ $Date$
+ */
+public final class WeakReferenceObjectPool<T> extends AbstractReferenceObjectPool<T,
WeakReference<T>> implements WeakReferenceObjectPoolMBean {
+
+    /**
+     * Create a <code>SoftReferenceObjectPool</code> with the specified factory.
+     *
+     * @param factory object factory to use, not {@code null}
+     * @throws IllegalArgumentException if the factory is null
+     */
+    public WeakReferenceObjectPool(PoolableObjectFactory<T> factory) {
+        super(factory);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected WeakReference<T> createReference(T referent, ReferenceQueue<? super
T> referenceQueue) {
+        return new WeakReference<T>(referent, referenceQueue);
+    }
+
+}

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPool.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPool.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPoolMBean.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPoolMBean.java?rev=1053598&view=auto
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPoolMBean.java
(added)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPoolMBean.java
Wed Dec 29 10:11:19 2010
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.pool2.ref;
+
+/**
+ * The <code>WeakReference</code>-based <code>ObjectPool</code> JMX
interface.
+ *
+ * @version $Revision$ $Date$
+ * @since 2.0
+ */
+public interface WeakReferenceObjectPoolMBean extends ReferenceObjectPoolMBean {
+
+}

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPoolMBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPoolMBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/ref/WeakReferenceObjectPoolMBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message