Re: svn commit: r1051852 - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl: StackObjectPool.java StackObjectPoolFactory.java

2010-12-22 Thread Simone Tripodi
just done, thanks Phil!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Dec 23, 2010 at 3:58 AM, Phil Steitz  wrote:
> On Wed, Dec 22, 2010 at 6:36 AM,  wrote:
>
>> Author: simonetripodi
>> Date: Wed Dec 22 11:36:49 2010
>> New Revision: 1051852
>>
>> URL: http://svn.apache.org/viewvc?rev=1051852&view=rev
>> Log:
>> made classes fields volatile
>> removed synchronization on getters/setters methods
>>
>> Modified:
>>
>>  commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>>
>>  commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>>
>> Modified:
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>> URL:
>> http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java?rev=1051852&r1=1051851&r2=1051852&view=diff
>>
>> ==
>> ---
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>> (original)
>> +++
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>> Wed Dec 22 11:36:49 2010
>> @@ -226,7 +226,7 @@ public class StackObjectPool extends
>>      * @return the number of instances currently borrowed from this pool
>>      */
>>     @Override
>> -    public synchronized int getNumActive() {
>> +    public int getNumActive() {
>>         return _numActive;
>>     }
>>
>
> This one is probably not a good idea.   This impl is over-synchronized, but
> access to this data member needs to be protected.  It is also incremented in
> borrowObject.  I recommend that we revert this (numActive).
>
> Phil
>
>>
>> @@ -332,12 +332,12 @@ public class StackObjectPool extends
>>     /**
>>      * cap on the number of "sleeping" instances in the pool
>>      */
>> -    private int maxSleeping; // @GuardedBy("this")
>> +    private volatile int maxSleeping; // @GuardedBy("this")
>>
>>     /**
>>      * Number of objects borrowed but not yet returned to the pool.
>>      */
>> -    private int _numActive = 0; // @GuardedBy("this")
>> +    private volatile int _numActive = 0; // @GuardedBy("this")
>>
>>     /**
>>      * Returns the {...@link PoolableObjectFactory} used by this pool to
>> create and manage object instances.
>> @@ -355,7 +355,7 @@ public class StackObjectPool extends
>>      * @return maxSleeping
>>      * @since 1.5.5
>>      */
>> -    public synchronized int getMaxSleeping() {
>> +    public int getMaxSleeping() {
>>         return this.maxSleeping;
>>     }
>>
>> @@ -365,7 +365,7 @@ public class StackObjectPool extends
>>      * @param maxSleeping
>>      * @since 2.0
>>      */
>> -    public synchronized void setMaxSleeping(int maxSleeping) {
>> +    public void setMaxSleeping(int maxSleeping) {
>>         this.maxSleeping = maxSleeping;
>>     }
>>  }
>>
>> Modified:
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>> URL:
>> http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java?rev=1051852&r1=1051851&r2=1051852&view=diff
>>
>> ==
>> ---
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>> (original)
>> +++
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>> Wed Dec 22 11:36:49 2010
>> @@ -80,13 +80,13 @@ public class StackObjectPoolFactory i
>>     /**
>>      * cap on the number of "sleeping" instances in the pool
>>      */
>> -    private int maxSleeping; // @GuardedBy("this")
>> +    private volatile int maxSleeping; // @GuardedBy("this")
>>
>>     /**
>>      * initial size of the pool (this specifies the size of the container,
>>      * it does not cause the pool to be pre-populated.)
>>      */
>> -    private int initIdleCapacity; // @GuardedBy("this")
>> +    private volatile int initIdleCapacity; // @GuardedBy("this")
>>
>>     /**
>>      * Returns the factory used by created pools.
>> @@ -104,7 +104,7 @@ public class StackObjectPoolFactory i
>>      * @return the maximum number of idle instances in created pools
>>      * @since 1.5.5
>>      */
>> -    public synchronized int getMaxSleeping() {
>> +    public int getMaxSleeping() {
>>         return this.maxSleeping;
>>     }
>>
>> @@ -114,7 +114,7 @@ public class StackObjectPoolFactory i
>>      * @param maxSleeping
>>      * @since 2.0
>>      */
>> -    public synchronized void setMaxSleeping(int maxSleeping) {
>> +    public void setMaxSleeping(int maxSleeping) {
>>         this.maxSleeping = maxSleeping;
>>     }
>>
>> @@ -124,7 +124,7 @@ public class StackObjectPoolFactory i
>>      * @return size of created containers (created pools are not
>> pre-populated)
>>      * @since 1.5.5
>>      */
>> -    public synchronized i

Re: [pool] reorganizing pool2.impl package and new possible pool implementations

2010-12-22 Thread Simone Tripodi
Hi Phil,

>>
>> org.apache.commons.pool2.impl
>>                                           | generic
>>                                           | reference
>>                                           | stack
>>
>> common stuff could be included directly under impl.
>>
>
> What exactly would that be?
>

just realized that there are no common stuff shared by different kind of pool :P

>
> I was going to propose dropping the stack pools altogether.  The LIFO/FIFO
> config option in the generic pools makes them mostly irrelevant (i.e., you
> can get the same behavior with a suitably configured GOP / GKOP with much
> more configurability)
>

I had the same feelings here, but felt a little shy on saying that.
You've my full support on this, I agree on dropping stack based pool
implementations.

> I don't want to sound too conservative and I will certainly not stand in the
> way of new / different pool implementations, but I would personally prefer
> to keep the number of included pool impls as small as possible.
>

I propose a more democratic way, I mean, like you made us notice,
keeping/adding the pool impl only if it makes sense to.
I wouldn't think about the included pools in therms of "size" but
rather in therms of "meaning"

> I think the first thing we need to do is to decide what implementations we
> are going to a) keep or b) add for 2.0.  I have been convinced that we need
> to keep GKOP as well as GOP.  As I said above, I would like to consider
> dropping the stack-based pools.  I think we should keep the reference-based
> pool and I am open to the new ones you suggest, just don't have use cases
> myself for them.

I'm not ready to show use cases too, sorry :( But they can be added
with a trivial refactory, moving the current SoftReferenceObjectPool
implementation to an

AbstractReferenceObjectPool> extends
BaseObjectPool implements ObjectPool

then in subclasses do the minimum. I can quickly provide a patch for it.

> There are quite a few impls buried in PoolUtils that might
> make sense to pull out (or eliminate).
>

I just made a census (with proposals):

 * PoolableObjectFactoryAdaptor
 * KeyedPoolableObjectFactoryAdaptor
 * ObjectPoolAdaptor
 * KeyedObjectPoolAdaptor

I propose to eliminate these adaptors, they implement a behavior that
users can replicate with a trivial code and without build a
pool/factory on top of an existing ones

 * CheckedObjectPool
 * CheckedKeyedObjectPool

These can be eliminated too, having introduced the generics

 * ObjectPoolMinIdleTimerTask
 * KeyedObjectPoolMinIdleTimerTask

I propose these pools can be pulled out and moved to a proper package

 * SynchronizedObjectPool
 * SynchronizedKeyedObjectPool
 * SynchronizedPoolableObjectFactory
 * SynchronizedKeyedPoolableObjectFactory

These could be pulled out too, even if something suggests me that
pools synchronization can be realized with just a Proxy, I'll do a
little experiment to submit so you can evaluate.

> What might make sense is to replace "impl" with "instance" (or "object") and
> "reference" (or "ref").  So you have o.a.c.p, o.a.c.p.instance,
> o.a.c.p.reference.
>

sounds much better than keeping the intermediate "impl", I agree :)

Should I have to write all these notes on the wiki and open issues
before proceeding?
Many thanks in advance, have a nice day!
Simo

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



[GUMP@vmgump]: Project commons-email (in module apache-commons) failed

2010-12-22 Thread Gump
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at gene...@gump.apache.org.

Project commons-email has an issue affecting its community integration.
This issue affects 1 projects,
 and has been outstanding for 2 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- commons-email :  Commons Email Package


Full details are available at:
http://vmgump.apache.org/gump/public/apache-commons/commons-email/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Sole jar output [commons-email-*[0-9T].jar] identifier set to project 
name
 -DEBUG- (Apache Gump generated) Apache Maven Settings in: 
/srv/gump/public/workspace/apache-commons/email/gump_mvn_settings.xml
 -INFO- Failed with reason build failed
 -DEBUG- Maven POM in: /srv/gump/public/workspace/apache-commons/email/pom.xml
 -DEBUG- Extracted fallback artifacts from Gump Repository



The following work was performed:
http://vmgump.apache.org/gump/public/apache-commons/commons-email/gump_work/build_apache-commons_commons-email.html
Work Name: build_apache-commons_commons-email (Type: Build)
Work ended in a state of : Failed
Elapsed: 26 secs
Command Line: /opt/maven2/bin/mvn --batch-mode 
-Dmaven.jar.mail=/srv/gump/packages/javamail-1.4/mail.jar --settings 
/srv/gump/public/workspace/apache-commons/email/gump_mvn_settings.xml package 
[Working Directory: /srv/gump/public/workspace/apache-commons/email]
M2_HOME: /opt/maven2
-
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more 
info.
Tests run: 13, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.432 sec <<< 
FAILURE!
Running org.apache.commons.mail.EmailLiveTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.354 sec
Running org.apache.commons.mail.SendWithAttachmentsTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.101 sec
Running org.apache.commons.mail.DataSourceResolverTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.021 sec
Running org.apache.commons.mail.util.MimeMessageParserTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.244 sec
Running org.apache.commons.mail.EmailTest
Tests run: 40, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.24 sec
Running org.apache.commons.mail.EmailAttachmentTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.346 sec
Running org.apache.commons.mail.ImageHtmlEmailTest
Tests run: 19, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.57 sec <<< 
FAILURE!
Running org.apache.commons.mail.DefaultAuthenticatorTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Running org.apache.commons.mail.util.URLFactoryTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec
Running org.apache.commons.mail.SimpleEmailTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.027 sec
Running org.apache.commons.mail.MultiPartEmailTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.049 sec
Running org.apache.commons.mail.InvalidInternetAddressTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec
Running org.apache.commons.mail.InvalidAddressTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec

Results :

Failed tests: 
  testEmbedFileWithCID(org.apache.commons.mail.HtmlEmailTest)
  testEmbedFileWithCID(org.apache.commons.mail.ImageHtmlEmailTest)

Tests run: 110, Failures: 2, Errors: 0, Skipped: 0

[INFO] 
[ERROR] BUILD FAILURE
[INFO] 
[INFO] There are test failures.

Please refer to 
/srv/gump/public/workspace/apache-commons/email/target/surefire-reports for the 
individual test results.
[INFO] 
[INFO] For more information, run Maven with the -e switch
[INFO] 
[INFO] Total time: 25 seconds
[INFO] Finished at: Thu Dec 23 06:45:44 UTC 2010
[INFO] Final Memory: 51M/122M
[INFO] 
-

To subscribe to this information via syndicated feeds:
- RSS: http://vmgump.apache.org/gump/public/apache-commons/commons-email/rss.xml
- Atom: 
http://vmgump.apache.org/gump/public/apache-commons/commons-email/atom.xml

== Gump Tracking Only ===
Produced by Apache Gump(TM) version 2.3.
Gump Run 0823122010, vmgump.apache.org:vmgump:0823122

[g...@vmgump]: Project commons-collections4 (in module apache-commons) failed

2010-12-22 Thread Gump
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at gene...@gump.apache.org.

Project commons-collections4 has an issue affecting its community integration.
This issue affects 2 projects,
 and has been outstanding for 14 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- commons-collections4 :  Collections
- commons-collections4-testframework :  Apache Commons


Full details are available at:

http://vmgump.apache.org/gump/public/apache-commons/commons-collections4/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- (Apache Gump generated) Apache Maven Settings in: 
/srv/gump/public/workspace/apache-commons/collections/gump_mvn_settings.xml
 -INFO- Failed with reason build failed
 -DEBUG- Maven POM in: 
/srv/gump/public/workspace/apache-commons/collections/pom.xml
 -DEBUG- Extracted fallback artifacts from Gump Repository



The following work was performed:
http://vmgump.apache.org/gump/public/apache-commons/commons-collections4/gump_work/build_apache-commons_commons-collections4.html
Work Name: build_apache-commons_commons-collections4 (Type: Build)
Work ended in a state of : Failed
Elapsed: 20 secs
Command Line: /opt/maven2/bin/mvn --batch-mode --settings 
/srv/gump/public/workspace/apache-commons/collections/gump_mvn_settings.xml 
package 
[Working Directory: /srv/gump/public/workspace/apache-commons/collections]
M2_HOME: /opt/maven2
-
required: org.apache.commons.collections.Closure[]
found: org.apache.commons.collections.Closure[]

[INFO] 8 errors 
[INFO] -
[INFO] 
[ERROR] BUILD FAILURE
[INFO] 
[INFO] Compilation failure

/srv/gump/public/workspace/apache-commons/collections/src/java/org/apache/commons/collections/functors/SwitchTransformer.java:[68,38]
 invalid inferred types for T; actual arguments do not conforms to inferred 
formal arguments
required: org.apache.commons.collections.Predicate[]
found: org.apache.commons.collections.Predicate[]

/srv/gump/public/workspace/apache-commons/collections/src/java/org/apache/commons/collections/functors/SwitchTransformer.java:[69,40]
 invalid inferred types for I; actual arguments do not conforms to inferred 
formal arguments
required: org.apache.commons.collections.Transformer[]
found: org.apache.commons.collections.Transformer[]

/srv/gump/public/workspace/apache-commons/collections/src/java/org/apache/commons/collections/functors/OnePredicate.java:[66,38]
 invalid inferred types for T; actual arguments do not conforms to inferred 
formal arguments
required: org.apache.commons.collections.Predicate[]
found: org.apache.commons.collections.Predicate[]

/srv/gump/public/workspace/apache-commons/collections/src/java/org/apache/commons/collections/functors/SwitchClosure.java:[66,38]
 invalid inferred types for T; actual arguments do not conforms to inferred 
formal arguments
required: org.apache.commons.collections.Predicate[]
found: org.apache.commons.collections.Predicate[]

/srv/gump/public/workspace/apache-commons/collections/src/java/org/apache/commons/collections/functors/SwitchClosure.java:[67,36]
 invalid inferred types for E; actual arguments do not conforms to inferred 
formal arguments
required: org.apache.commons.collections.Closure[]
found: org.apache.commons.collections.Closure[]

/srv/gump/public/workspace/apache-commons/collections/src/java/org/apache/commons/collections/functors/ChainedTransformer.java:[56,40]
 invalid inferred types for I; actual arguments do not conforms to inferred 
formal arguments
required: org.apache.commons.collections.Transformer[]
found: org.apache.commons.collections.Transformer[]

/srv/gump/public/workspace/apache-commons/collections/src/java/org/apache/commons/collections/functors/NonePredicate.java:[61,38]
 invalid inferred types for T; actual arguments do not conforms to inferred 
formal arguments
required: org.apache.commons.collections.Predicate[]
found: org.apache.commons.collections.Predicate[]

/srv/gump/public/workspace/apache-commons/collections/src/java/org/apache/commons/collections/functors/ChainedClosure.java:[53,36]
 invalid inferred types for E; actual arguments do not conforms to inferred 
formal arguments
required: org.apache.commons.collections.Closure[]
found: org.apache.commons.collections.Closure[]


[INFO] 
[INFO] For more information, run Maven with the -e switch
[INFO] -

Re: [VOTE] Release Commons IO 2.0.1 based on RC1

2010-12-22 Thread Niall Pemberton
Apologies,  IO 2.0.1 RC1 is available for review here:
http://people.apache.org/~niallp/io-2.0.1-rc1/

Niall

On Thu, Dec 23, 2010 at 4:15 AM, Niall Pemberton
 wrote:
> There have been a couple of bugs fixed since the IO 2.0 release, so I
> would like to release IO 2.0.1
>
> [ ] +1 Yes go ahead an release based on RC1
> [ ] -1 No, because...
>
> IO 2.0.1 RC1 is available for review here:
>  http://people.apache.org/~niallp/io-2.01.-rc1/
>
> Maven artifacts are here:
>  http://people.apache.org/~niallp//io-2.0.1-rc1/maven/
>
> Details of changes since 2.0 are in the release notes:
>  http://people.apache.org/~niallp/io-2.0.1-rc1/RELEASE-NOTES.txt
>
> I have tested this with JDK 1.5 & 1.6 using maven2.
>
> The tag is here:
>  http://svn.apache.org/viewvc/commons/proper/io/tags/commons-io-2.0.1-rc1/
>
> Site:
>  http://people.apache.org/~niallp/io-2.0.1-rc1/site/
> (note some *relative* links are broken and the 2.0.1 directories are
> not yet created - these will be OK once the site is deployed)
>
> Clirr Report (compared to 2.0):
>  http://people.apache.org/~niallp/io-2.0.1-rc1/site/clirr-report.html
>
> RAT Report:
>  http://people.apache.org/~niallp/io-2.0.1-rc1/site/rat-report.html
>
> tia
>
> Niall
>

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



[VOTE] Release Commons IO 2.0.1 based on RC1

2010-12-22 Thread Niall Pemberton
There have been a couple of bugs fixed since the IO 2.0 release, so I
would like to release IO 2.0.1

[ ] +1 Yes go ahead an release based on RC1
[ ] -1 No, because...

IO 2.0.1 RC1 is available for review here:
 http://people.apache.org/~niallp/io-2.01.-rc1/

Maven artifacts are here:
 http://people.apache.org/~niallp//io-2.0.1-rc1/maven/

Details of changes since 2.0 are in the release notes:
 http://people.apache.org/~niallp/io-2.0.1-rc1/RELEASE-NOTES.txt

I have tested this with JDK 1.5 & 1.6 using maven2.

The tag is here:
 http://svn.apache.org/viewvc/commons/proper/io/tags/commons-io-2.0.1-rc1/

Site:
 http://people.apache.org/~niallp/io-2.0.1-rc1/site/
(note some *relative* links are broken and the 2.0.1 directories are
not yet created - these will be OK once the site is deployed)

Clirr Report (compared to 2.0):
 http://people.apache.org/~niallp/io-2.0.1-rc1/site/clirr-report.html

RAT Report:
 http://people.apache.org/~niallp/io-2.0.1-rc1/site/rat-report.html

tia

Niall

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: svn commit: r1051852 - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl: StackObjectPool.java StackObjectPoolFactory.java

2010-12-22 Thread Phil Steitz
On Wed, Dec 22, 2010 at 6:36 AM,  wrote:

> Author: simonetripodi
> Date: Wed Dec 22 11:36:49 2010
> New Revision: 1051852
>
> URL: http://svn.apache.org/viewvc?rev=1051852&view=rev
> Log:
> made classes fields volatile
> removed synchronization on getters/setters methods
>
> Modified:
>
>  
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>
>  
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>
> Modified:
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
> URL:
> http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java?rev=1051852&r1=1051851&r2=1051852&view=diff
>
> ==
> ---
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
> (original)
> +++
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
> Wed Dec 22 11:36:49 2010
> @@ -226,7 +226,7 @@ public class StackObjectPool extends
>  * @return the number of instances currently borrowed from this pool
>  */
> @Override
> -public synchronized int getNumActive() {
> +public int getNumActive() {
> return _numActive;
> }
>

This one is probably not a good idea.   This impl is over-synchronized, but
access to this data member needs to be protected.  It is also incremented in
borrowObject.  I recommend that we revert this (numActive).

Phil

>
> @@ -332,12 +332,12 @@ public class StackObjectPool extends
> /**
>  * cap on the number of "sleeping" instances in the pool
>  */
> -private int maxSleeping; // @GuardedBy("this")
> +private volatile int maxSleeping; // @GuardedBy("this")
>
> /**
>  * Number of objects borrowed but not yet returned to the pool.
>  */
> -private int _numActive = 0; // @GuardedBy("this")
> +private volatile int _numActive = 0; // @GuardedBy("this")
>
> /**
>  * Returns the {...@link PoolableObjectFactory} used by this pool to
> create and manage object instances.
> @@ -355,7 +355,7 @@ public class StackObjectPool extends
>  * @return maxSleeping
>  * @since 1.5.5
>  */
> -public synchronized int getMaxSleeping() {
> +public int getMaxSleeping() {
> return this.maxSleeping;
> }
>
> @@ -365,7 +365,7 @@ public class StackObjectPool extends
>  * @param maxSleeping
>  * @since 2.0
>  */
> -public synchronized void setMaxSleeping(int maxSleeping) {
> +public void setMaxSleeping(int maxSleeping) {
> this.maxSleeping = maxSleeping;
> }
>  }
>
> Modified:
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
> URL:
> http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java?rev=1051852&r1=1051851&r2=1051852&view=diff
>
> ==
> ---
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
> (original)
> +++
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
> Wed Dec 22 11:36:49 2010
> @@ -80,13 +80,13 @@ public class StackObjectPoolFactory i
> /**
>  * cap on the number of "sleeping" instances in the pool
>  */
> -private int maxSleeping; // @GuardedBy("this")
> +private volatile int maxSleeping; // @GuardedBy("this")
>
> /**
>  * initial size of the pool (this specifies the size of the container,
>  * it does not cause the pool to be pre-populated.)
>  */
> -private int initIdleCapacity; // @GuardedBy("this")
> +private volatile int initIdleCapacity; // @GuardedBy("this")
>
> /**
>  * Returns the factory used by created pools.
> @@ -104,7 +104,7 @@ public class StackObjectPoolFactory i
>  * @return the maximum number of idle instances in created pools
>  * @since 1.5.5
>  */
> -public synchronized int getMaxSleeping() {
> +public int getMaxSleeping() {
> return this.maxSleeping;
> }
>
> @@ -114,7 +114,7 @@ public class StackObjectPoolFactory i
>  * @param maxSleeping
>  * @since 2.0
>  */
> -public synchronized void setMaxSleeping(int maxSleeping) {
> +public void setMaxSleeping(int maxSleeping) {
> this.maxSleeping = maxSleeping;
> }
>
> @@ -124,7 +124,7 @@ public class StackObjectPoolFactory i
>  * @return size of created containers (created pools are not
> pre-populated)
>  * @since 1.5.5
>  */
> -public synchronized int getInitCapacity() {
> +public int getInitCapacity() {
> return this.initIdleCapacity;
> }
>
> @@ -133,7 +133,7 @@ public class StackObjectPoolFactory i
>  *
>  * @param initIdleCapacity size of created containers (created pools
> are not pre-populated)
> 

Re: [pool] reorganizing pool2.impl package and new possible pool implementations

2010-12-22 Thread Phil Steitz
On Wed, Dec 22, 2010 at 9:42 AM, Simone Tripodi wrote:

> Hi all mates,
> I'd like to propose a small stuff reorganization in the `impl` package
> that is growing up and we could arrange stuff in a cleaner way.
> I propose the following packages:
>
> org.apache.commons.pool2.impl
>   | generic
>   | reference
>   | stack
>
> common stuff could be included directly under impl.
>

What exactly would that be?

>
> Moreover since we've the SoftReference pool implementation, I propose
> to add a full set of java.lang.ref.Reference pool implementation, the
> current one could become an abstract class using data structures of
> java.lang.ref.Reference references, subclass just provide
> PhantomReference, SoftReference and WeakReference specialization.
> WDYT? Many thanks in advance for feedbacks/suggestions.
>

I was going to propose dropping the stack pools altogether.  The LIFO/FIFO
config option in the generic pools makes them mostly irrelevant (i.e., you
can get the same behavior with a suitably configured GOP / GKOP with much
more configurability)

I don't want to sound too conservative and I will certainly not stand in the
way of new / different pool implementations, but I would personally prefer
to keep the number of included pool impls as small as possible.

I think the first thing we need to do is to decide what implementations we
are going to a) keep or b) add for 2.0.  I have been convinced that we need
to keep GKOP as well as GOP.  As I said above, I would like to consider
dropping the stack-based pools.  I think we should keep the reference-based
pool and I am open to the new ones you suggest, just don't have use cases
myself for them.  There are quite a few impls buried in PoolUtils that might
make sense to pull out (or eliminate).

What might make sense is to replace "impl" with "instance" (or "object") and
"reference" (or "ref").  So you have o.a.c.p, o.a.c.p.instance,
o.a.c.p.reference.


> Simo
>
> PS In the meantime, I'm taking care of removing synchronized methods
> and making fields volatile, please review when having spare time! :)
>

Thanks!

Phil

> Have a nice day,
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


Re: [pool] reorganizing pool2.impl package and new possible pool implementations

2010-12-22 Thread Simone Tripodi
Hi Gary!
In the generic package would go the Generic(Keyed)ObjectPool and
related Configuration/Factory, and agreed, ref sounds better than
reference :)
What does anyone think about it?
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Wed, Dec 22, 2010 at 6:43 PM, Gary Gregory
 wrote:
> On Dec 22, 2010, at 9:43, Simone Tripodi  wrote:
>
>> Hi all mates,
>> I'd like to propose a small stuff reorganization in the `impl` package
>> that is growing up and we could arrange stuff in a cleaner way.
>> I propose the following packages:
>>
>> org.apache.commons.pool2.impl
>>                                           | generic
>>                                           | reference
>>                                           | stack
>>
>> common stuff could be included directly under impl.
>>
>> Moreover since we've the SoftReference pool implementation, I propose
>> to add a full set of java.lang.ref.Reference pool implementation, the
>> current one could become an abstract class using data structures of
>> java.lang.ref.Reference references, subclass just provide
>> PhantomReference, SoftReference and WeakReference specialization.
>> WDYT? Many thanks in advance for feedbacks/suggestions.
>
> If we do a package for reference code I would suggest to use the same name as 
> in the jre: "ref" instead of "reference"
>
> Gary
>
>> Simo
>>
>> PS In the meantime, I'm taking care of removing synchronized methods
>> and making fields volatile, please review when having spare time! :)
>> Have a nice day,
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
>> For additional commands, e-mail: dev-h...@commons.apache.org
>>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [pool] reorganizing pool2.impl package and new possible pool implementations

2010-12-22 Thread Gary Gregory
On Dec 22, 2010, at 9:43, Simone Tripodi  wrote:

> Hi all mates,
> I'd like to propose a small stuff reorganization in the `impl` package
> that is growing up and we could arrange stuff in a cleaner way.
> I propose the following packages:
> 
> org.apache.commons.pool2.impl
>   | generic
>   | reference
>   | stack
> 
> common stuff could be included directly under impl.
> 
> Moreover since we've the SoftReference pool implementation, I propose
> to add a full set of java.lang.ref.Reference pool implementation, the
> current one could become an abstract class using data structures of
> java.lang.ref.Reference references, subclass just provide
> PhantomReference, SoftReference and WeakReference specialization.
> WDYT? Many thanks in advance for feedbacks/suggestions.

If we do a package for reference code I would suggest to use the same name as 
in the jre: "ref" instead of "reference"

Gary

> Simo
> 
> PS In the meantime, I'm taking care of removing synchronized methods
> and making fields volatile, please review when having spare time! :)
> Have a nice day,
> Simo
> 
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
> 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [pool] reorganizing pool2.impl package and new possible pool implementations

2010-12-22 Thread Gary Gregory
What goes in the generic package?

Gary

On Dec 22, 2010, at 9:43, "Simone Tripodi"  wrote:

> Hi all mates,
> I'd like to propose a small stuff reorganization in the `impl` package
> that is growing up and we could arrange stuff in a cleaner way.
> I propose the following packages:
> 
> org.apache.commons.pool2.impl
>   | generic
>   | reference
>   | stack
> 
> common stuff could be included directly under impl.
> 
> Moreover since we've the SoftReference pool implementation, I propose
> to add a full set of java.lang.ref.Reference pool implementation, the
> current one could become an abstract class using data structures of
> java.lang.ref.Reference references, subclass just provide
> PhantomReference, SoftReference and WeakReference specialization.
> WDYT? Many thanks in advance for feedbacks/suggestions.
> Simo
> 
> PS In the meantime, I'm taking care of removing synchronized methods
> and making fields volatile, please review when having spare time! :)
> Have a nice day,
> Simo
> 
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
> 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [VOTE] Release Commons VFS 2.0

2010-12-22 Thread Ralph Goers

On Dec 21, 2010, at 11:43 PM, Jörg Schaible wrote:

>>> 
>>> But the RM should definitely *look at* the generated release notes and,
>> IMO, intentionally committing them is a good thing.  Nothing generated
>> directly from maven has ever met my expectations in terms of formatting
>> and
>> content, so I have always ended up tweaking the generated files.  I don't
>> see this as onerous, personally.
> 
> Then why not generating it directly before the release manually, "finalize" 
> it and commit it? After a release it can be deleted again in svn.

This is exactly what I'm thinking of doing with an enhancement to the release 
plugin, changes plugin or a new plugin. release-prepare would then do this 
automatically.

> 
> All we need then is a verification that the file exists while releasing. 
> This can be done by the verifier plugin (best to bind the goal to the 
> validation phase) in the release profile.

This wouldn't be necessary since the above plugin would fail if it can't 
generate the release notes.

Ralph
-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: svn commit: r1051852 - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl: StackObjectPool.java StackObjectPoolFactory.java

2010-12-22 Thread Simone Tripodi
going to fix it now, thanks :)
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Wed, Dec 22, 2010 at 3:53 PM, sebb  wrote:
> On 22 December 2010 11:36,   wrote:
>> Author: simonetripodi
>> Date: Wed Dec 22 11:36:49 2010
>> New Revision: 1051852
>>
>> URL: http://svn.apache.org/viewvc?rev=1051852&view=rev
>> Log:
>> made classes fields volatile
>> removed synchronization on getters/setters methods
>
> Need to remove whichever @GuardedBy comments are no longer true.
>
>> Modified:
>>    
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>>    
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>>
>> Modified: 
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>> URL: 
>> http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java?rev=1051852&r1=1051851&r2=1051852&view=diff
>> ==
>> --- 
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>>  (original)
>> +++ 
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>>  Wed Dec 22 11:36:49 2010
>> @@ -226,7 +226,7 @@ public class StackObjectPool extends
>>      * @return the number of instances currently borrowed from this pool
>>      */
>>     @Override
>> -    public synchronized int getNumActive() {
>> +    public int getNumActive() {
>>         return _numActive;
>>     }
>>
>> @@ -332,12 +332,12 @@ public class StackObjectPool extends
>>     /**
>>      * cap on the number of "sleeping" instances in the pool
>>      */
>> -    private int maxSleeping; // @GuardedBy("this")
>> +    private volatile int maxSleeping; // @GuardedBy("this")
>>
>>     /**
>>      * Number of objects borrowed but not yet returned to the pool.
>>      */
>> -    private int _numActive = 0; // @GuardedBy("this")
>> +    private volatile int _numActive = 0; // @GuardedBy("this")
>>
>>     /**
>>      * Returns the {...@link PoolableObjectFactory} used by this pool to 
>> create and manage object instances.
>> @@ -355,7 +355,7 @@ public class StackObjectPool extends
>>      * @return maxSleeping
>>      * @since 1.5.5
>>      */
>> -    public synchronized int getMaxSleeping() {
>> +    public int getMaxSleeping() {
>>         return this.maxSleeping;
>>     }
>>
>> @@ -365,7 +365,7 @@ public class StackObjectPool extends
>>      * @param maxSleeping
>>      * @since 2.0
>>      */
>> -    public synchronized void setMaxSleeping(int maxSleeping) {
>> +    public void setMaxSleeping(int maxSleeping) {
>>         this.maxSleeping = maxSleeping;
>>     }
>>  }
>>
>> Modified: 
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>> URL: 
>> http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java?rev=1051852&r1=1051851&r2=1051852&view=diff
>> ==
>> --- 
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>>  (original)
>> +++ 
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>>  Wed Dec 22 11:36:49 2010
>> @@ -80,13 +80,13 @@ public class StackObjectPoolFactory i
>>     /**
>>      * cap on the number of "sleeping" instances in the pool
>>      */
>> -    private int maxSleeping; // @GuardedBy("this")
>> +    private volatile int maxSleeping; // @GuardedBy("this")
>>
>>     /**
>>      * initial size of the pool (this specifies the size of the container,
>>      * it does not cause the pool to be pre-populated.)
>>      */
>> -    private int initIdleCapacity; // @GuardedBy("this")
>> +    private volatile int initIdleCapacity; // @GuardedBy("this")
>>
>>     /**
>>      * Returns the factory used by created pools.
>> @@ -104,7 +104,7 @@ public class StackObjectPoolFactory i
>>      * @return the maximum number of idle instances in created pools
>>      * @since 1.5.5
>>      */
>> -    public synchronized int getMaxSleeping() {
>> +    public int getMaxSleeping() {
>>         return this.maxSleeping;
>>     }
>>
>> @@ -114,7 +114,7 @@ public class StackObjectPoolFactory i
>>      * @param maxSleeping
>>      * @since 2.0
>>      */
>> -    public synchronized void setMaxSleeping(int maxSleeping) {
>> +    public void setMaxSleeping(int maxSleeping) {
>>         this.maxSleeping = maxSleeping;
>>     }
>>
>> @@ -124,7 +124,7 @@ public class StackObjectPoolFactory i
>>      * @return size of created containers (created pools are not 
>> pre-populated)
>>      * @since 1.5.5
>>      */
>> -    public synchronized int getInitCapacity() {
>> +    public int getInitCapacity() {
>>         return this.initIdleCapacity;
>>     }
>>
>> @@ -133,7 +133,7 @@ public class StackObje

Re: svn commit: r1051863 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java

2010-12-22 Thread Simone Tripodi
Hi Seb,
thanks a lot, there's always something to learn :)
Have a nice day,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Wed, Dec 22, 2010 at 3:51 PM, sebb  wrote:
> On 22 December 2010 11:52,   wrote:
>> Author: simonetripodi
>> Date: Wed Dec 22 11:52:09 2010
>> New Revision: 1051863
>>
>> URL: http://svn.apache.org/viewvc?rev=1051863&view=rev
>> Log:
>> made fields volatile
>> removed synchronization on getters/setters methods
>>
>> Modified:
>>    
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
>>
>> Modified: 
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
>> URL: 
>> http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java?rev=1051863&r1=1051862&r2=1051863&view=diff
>> ==
>> --- 
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
>>  (original)
>> +++ 
>> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
>>  Wed Dec 22 11:52:09 2010
>> @@ -81,13 +81,13 @@ public class StackKeyedObjectPoolFactory
>>     /**
>>      * cap on the number of "sleeping" instances in the pool
>>      */
>> -    private int maxSleeping; // @GuardedBy("this")
>> +    private volatile int maxSleeping; // @GuardedBy("this")
>
> The �...@guardedby comment needs to be removed, as it no longer applies.
>
> [Note: volatile is not always OK for int or long - e.g. if the field
> can be incremented, volatile is not sufficient.
> But here the writes don't depend on the previous value, so no
> possibility of an intervening thread.]
>
>>
>>     /**
>>      * initial size of the pool (this specifies the size of the container,
>>      * it does not cause the pool to be pre-populated.)
>>      */
>> -    private int initIdleCapacity; // @GuardedBy("this")
>> +    private volatile int initIdleCapacity; // @GuardedBy("this")
>>
>>     /**
>>      * Returns the KeyedPoolableObjectFactory used by StackKeyedObjectPools 
>> created by this factory
>> @@ -105,7 +105,7 @@ public class StackKeyedObjectPoolFactory
>>      * @return maxSleeping setting for created pools
>>      * @since 1.5.5
>>      */
>> -    public synchronized int getMaxSleeping() {
>> +    public int getMaxSleeping() {
>>         return this.maxSleeping;
>>     }
>>
>> @@ -115,7 +115,7 @@ public class StackKeyedObjectPoolFactory
>>      * @param maxSleeping
>>      * @since 2.0
>>      */
>> -    public synchronized void setMaxSleeping(int maxSleeping) {
>> +    public void setMaxSleeping(int maxSleeping) {
>>         this.maxSleeping = maxSleeping;
>>     }
>>
>> @@ -125,7 +125,7 @@ public class StackKeyedObjectPoolFactory
>>      * @return initial capacity setting for created pools
>>      * @since 1.5.5
>>      */
>> -    public synchronized int getInitialCapacity() {
>> +    public int getInitialCapacity() {
>>         return this.initIdleCapacity;
>>     }
>>
>> @@ -135,7 +135,7 @@ public class StackKeyedObjectPoolFactory
>>      * @param initIdleCapacity
>>      * @since 2.0
>>      */
>> -    public synchronized void setInitIdleCapacity(int initIdleCapacity) {
>> +    public void setInitIdleCapacity(int initIdleCapacity) {
>>         this.initIdleCapacity = initIdleCapacity;
>>     }
>>
>>
>>
>>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: svn commit: r1051852 - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl: StackObjectPool.java StackObjectPoolFactory.java

2010-12-22 Thread sebb
On 22 December 2010 11:36,   wrote:
> Author: simonetripodi
> Date: Wed Dec 22 11:36:49 2010
> New Revision: 1051852
>
> URL: http://svn.apache.org/viewvc?rev=1051852&view=rev
> Log:
> made classes fields volatile
> removed synchronization on getters/setters methods

Need to remove whichever @GuardedBy comments are no longer true.

> Modified:
>    
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>    
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>
> Modified: 
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
> URL: 
> http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java?rev=1051852&r1=1051851&r2=1051852&view=diff
> ==
> --- 
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>  (original)
> +++ 
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
>  Wed Dec 22 11:36:49 2010
> @@ -226,7 +226,7 @@ public class StackObjectPool extends
>      * @return the number of instances currently borrowed from this pool
>      */
>     @Override
> -    public synchronized int getNumActive() {
> +    public int getNumActive() {
>         return _numActive;
>     }
>
> @@ -332,12 +332,12 @@ public class StackObjectPool extends
>     /**
>      * cap on the number of "sleeping" instances in the pool
>      */
> -    private int maxSleeping; // @GuardedBy("this")
> +    private volatile int maxSleeping; // @GuardedBy("this")
>
>     /**
>      * Number of objects borrowed but not yet returned to the pool.
>      */
> -    private int _numActive = 0; // @GuardedBy("this")
> +    private volatile int _numActive = 0; // @GuardedBy("this")
>
>     /**
>      * Returns the {...@link PoolableObjectFactory} used by this pool to 
> create and manage object instances.
> @@ -355,7 +355,7 @@ public class StackObjectPool extends
>      * @return maxSleeping
>      * @since 1.5.5
>      */
> -    public synchronized int getMaxSleeping() {
> +    public int getMaxSleeping() {
>         return this.maxSleeping;
>     }
>
> @@ -365,7 +365,7 @@ public class StackObjectPool extends
>      * @param maxSleeping
>      * @since 2.0
>      */
> -    public synchronized void setMaxSleeping(int maxSleeping) {
> +    public void setMaxSleeping(int maxSleeping) {
>         this.maxSleeping = maxSleeping;
>     }
>  }
>
> Modified: 
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
> URL: 
> http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java?rev=1051852&r1=1051851&r2=1051852&view=diff
> ==
> --- 
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>  (original)
> +++ 
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
>  Wed Dec 22 11:36:49 2010
> @@ -80,13 +80,13 @@ public class StackObjectPoolFactory i
>     /**
>      * cap on the number of "sleeping" instances in the pool
>      */
> -    private int maxSleeping; // @GuardedBy("this")
> +    private volatile int maxSleeping; // @GuardedBy("this")
>
>     /**
>      * initial size of the pool (this specifies the size of the container,
>      * it does not cause the pool to be pre-populated.)
>      */
> -    private int initIdleCapacity; // @GuardedBy("this")
> +    private volatile int initIdleCapacity; // @GuardedBy("this")
>
>     /**
>      * Returns the factory used by created pools.
> @@ -104,7 +104,7 @@ public class StackObjectPoolFactory i
>      * @return the maximum number of idle instances in created pools
>      * @since 1.5.5
>      */
> -    public synchronized int getMaxSleeping() {
> +    public int getMaxSleeping() {
>         return this.maxSleeping;
>     }
>
> @@ -114,7 +114,7 @@ public class StackObjectPoolFactory i
>      * @param maxSleeping
>      * @since 2.0
>      */
> -    public synchronized void setMaxSleeping(int maxSleeping) {
> +    public void setMaxSleeping(int maxSleeping) {
>         this.maxSleeping = maxSleeping;
>     }
>
> @@ -124,7 +124,7 @@ public class StackObjectPoolFactory i
>      * @return size of created containers (created pools are not 
> pre-populated)
>      * @since 1.5.5
>      */
> -    public synchronized int getInitCapacity() {
> +    public int getInitCapacity() {
>         return this.initIdleCapacity;
>     }
>
> @@ -133,7 +133,7 @@ public class StackObjectPoolFactory i
>      *
>      * @param initIdleCapacity size of created containers (created pools are 
> not pre-populated)
>      */
> -    public synchronized void setInitCapacity(int initIdleCapacity) {
> +    public void setInitCapacity(int initIdleCapacity) {
>         this

Re: svn commit: r1051863 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java

2010-12-22 Thread sebb
On 22 December 2010 11:52,   wrote:
> Author: simonetripodi
> Date: Wed Dec 22 11:52:09 2010
> New Revision: 1051863
>
> URL: http://svn.apache.org/viewvc?rev=1051863&view=rev
> Log:
> made fields volatile
> removed synchronization on getters/setters methods
>
> Modified:
>    
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
>
> Modified: 
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
> URL: 
> http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java?rev=1051863&r1=1051862&r2=1051863&view=diff
> ==
> --- 
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
>  (original)
> +++ 
> commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
>  Wed Dec 22 11:52:09 2010
> @@ -81,13 +81,13 @@ public class StackKeyedObjectPoolFactory
>     /**
>      * cap on the number of "sleeping" instances in the pool
>      */
> -    private int maxSleeping; // @GuardedBy("this")
> +    private volatile int maxSleeping; // @GuardedBy("this")

The  @GuardedBy comment needs to be removed, as it no longer applies.

[Note: volatile is not always OK for int or long - e.g. if the field
can be incremented, volatile is not sufficient.
But here the writes don't depend on the previous value, so no
possibility of an intervening thread.]

>
>     /**
>      * initial size of the pool (this specifies the size of the container,
>      * it does not cause the pool to be pre-populated.)
>      */
> -    private int initIdleCapacity; // @GuardedBy("this")
> +    private volatile int initIdleCapacity; // @GuardedBy("this")
>
>     /**
>      * Returns the KeyedPoolableObjectFactory used by StackKeyedObjectPools 
> created by this factory
> @@ -105,7 +105,7 @@ public class StackKeyedObjectPoolFactory
>      * @return maxSleeping setting for created pools
>      * @since 1.5.5
>      */
> -    public synchronized int getMaxSleeping() {
> +    public int getMaxSleeping() {
>         return this.maxSleeping;
>     }
>
> @@ -115,7 +115,7 @@ public class StackKeyedObjectPoolFactory
>      * @param maxSleeping
>      * @since 2.0
>      */
> -    public synchronized void setMaxSleeping(int maxSleeping) {
> +    public void setMaxSleeping(int maxSleeping) {
>         this.maxSleeping = maxSleeping;
>     }
>
> @@ -125,7 +125,7 @@ public class StackKeyedObjectPoolFactory
>      * @return initial capacity setting for created pools
>      * @since 1.5.5
>      */
> -    public synchronized int getInitialCapacity() {
> +    public int getInitialCapacity() {
>         return this.initIdleCapacity;
>     }
>
> @@ -135,7 +135,7 @@ public class StackKeyedObjectPoolFactory
>      * @param initIdleCapacity
>      * @since 2.0
>      */
> -    public synchronized void setInitIdleCapacity(int initIdleCapacity) {
> +    public void setInitIdleCapacity(int initIdleCapacity) {
>         this.initIdleCapacity = initIdleCapacity;
>     }
>
>
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



[pool] reorganizing pool2.impl package and new possible pool implementations

2010-12-22 Thread Simone Tripodi
Hi all mates,
I'd like to propose a small stuff reorganization in the `impl` package
that is growing up and we could arrange stuff in a cleaner way.
I propose the following packages:

org.apache.commons.pool2.impl
   | generic
   | reference
   | stack

common stuff could be included directly under impl.

Moreover since we've the SoftReference pool implementation, I propose
to add a full set of java.lang.ref.Reference pool implementation, the
current one could become an abstract class using data structures of
java.lang.ref.Reference references, subclass just provide
PhantomReference, SoftReference and WeakReference specialization.
WDYT? Many thanks in advance for feedbacks/suggestions.
Simo

PS In the meantime, I'm taking care of removing synchronized methods
and making fields volatile, please review when having spare time! :)
Have a nice day,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [VOTE] Release Commons VFS 2.0

2010-12-22 Thread sebb
On 22 December 2010 07:43, Jörg Schaible  wrote:
> Hi,
>
> Phil Steitz wrote:
>
>> On Tue, Dec 21, 2010 at 7:48 PM, sebb  wrote:
>>
>>> On 22 December 2010 00:11, Phil Steitz  wrote:
>>> > On Tue, Dec 21, 2010 at 7:00 PM, Ralph Goers
>>> > >> >wrote:
>>> >
>>> >>
>>> >> On Dec 21, 2010, at 2:55 PM, sebb wrote:
>>> >>
>>> >> > On 21 December 2010 05:21, Ralph Goers 
>>> >> wrote
>>> >> >
>>> >> >> I have not included release notes in the src zip since my
>>> understanding
>>> >> is the src zip should contain the directories pretty much as they
>>> >> exist
>>> in
>>> >> SVN.  Instead I have added a README.txt that tells a user how to
>>> generate
>>> >> the announcement file.
>>> >> >
>>> >> > I would prefer to see the release notes generated and checked into
>>> >> > SVN; they can then be included in both source and binary archives.
>>> >> >
>>> >> > See for example MATH and NET (2.0)
>>> >>
>>> >> I looked at net/trunk. I would prefer that the release notes be
>>> generated
>>> >> during mvn release:prepare instead of requiring a manual mvn
>>> >> invocation
>>> to
>>> >> create the release notes and then a commit. I have that working for
>>> >> the binary distribution but I don't want to do it for the source
>>> distribution
>>> >> since they shouldn't be included if they aren't in svn and, in my
>>> >> view,
>>> they
>>> >> shouldn't be in svn because they will generally be out of sync with
>>> >> changes.xml in trunk.
>>> >>
>>> >> I would say that is up to the RM :)
>>> >
>>> > I personally don't have a problem with the out-of-synch condition.
>>> > What
>>> is
>>> > important is, like changes.xml or any other file, what gets tagged and
>>> > released.
>>>
>>> +1
>>>
>>> I think it's vital that the release notes are included in the source
>>> release.
>>>
>>> The user should not be required to run a command to create the release
>>> notes.
>>>
>>> But the RM should definitely *look at* the generated release notes and,
>> IMO, intentionally committing them is a good thing.  Nothing generated
>> directly from maven has ever met my expectations in terms of formatting
>> and
>> content, so I have always ended up tweaking the generated files.

BTW, I did a bit of work with the MATH vm file which makes it possible
to produce better formatting, by adjusting the spacing in the
changes.xml file.

It's a bit tedious getting it correct initially but the output can
look quite acceptable.

Once set up, adding new entries is easy - just follow the existing spacing.

> > I don't see this as onerous, personally.

+1

> Then why not generating it directly before the release manually, "finalize"
> it and commit it? After a release it can be deleted again in svn.

Why delete it?

So long as the RN are uptodate for the release, it does not matter if
it gets a bit stale later.
Changes.xml is not always kept up to date between releases either.

> All we need then is a verification that the file exists while releasing.
> This can be done by the verifier plugin (best to bind the goal to the
> validation phase) in the release profile.

The verification that is needed is that changes.xml is uptodate, and
the RN file corresponds.

> - Jörg
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org