svn commit: r154136 - in jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs: RandomAccessContent.java provider/ftp/FtpRandomAccessContent.java provider/http/HttpRandomAccesContent.java provider/local/LocalFileRandomAccessContent.java provider/smb/SmbFileRandomAccessContent.java util/MonitorRandomAccessContent.java

2005-02-16 Thread imario
Author: imario
Date: Wed Feb 16 23:45:27 2005
New Revision: 154136

URL: http://svn.apache.org/viewcvs?view=rev&rev=154136
Log:
missing createStream() in *RandomAccesContent.getInputStream().

Thanks to Jeffrey D. Brekke for pointing this out.

Modified:

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/RandomAccessContent.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpRandomAccessContent.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFileRandomAccessContent.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/smb/SmbFileRandomAccessContent.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/util/MonitorRandomAccessContent.java

Modified: 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/RandomAccessContent.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/RandomAccessContent.java?view=diff&r1=154135&r2=154136
==
--- 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/RandomAccessContent.java
 (original)
+++ 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/RandomAccessContent.java
 Wed Feb 16 23:45:27 2005
@@ -22,7 +22,7 @@
 
 /**
  * Description
- * 
+ *
  * @author mailto:[EMAIL PROTECTED]">Mario Ivankovits
  * @version $Revision: 1.1 $ $Date$
  */
@@ -82,5 +82,5 @@
  * Notice: If you use [EMAIL PROTECTED] #seek(long)} you have to reget 
the InputStream
  * @return
  */
-public InputStream getInputStream();
+public InputStream getInputStream() throws IOException;
 }

Modified: 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpRandomAccessContent.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpRandomAccessContent.java?view=diff&r1=154135&r2=154136
==
--- 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpRandomAccessContent.java
 (original)
+++ 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpRandomAccessContent.java
 Wed Feb 16 23:45:27 2005
@@ -234,8 +234,9 @@
 return data;
 }
 
-public InputStream getInputStream()
+public InputStream getInputStream() throws IOException
 {
+createStream();
 return dis;
 }
 }

Modified: 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java?view=diff&r1=154135&r2=154136
==
--- 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java
 (original)
+++ 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java
 Wed Feb 16 23:45:27 2005
@@ -240,8 +240,9 @@
 return data;
 }
 
-public InputStream getInputStream()
+public InputStream getInputStream() throws IOException
 {
+createStream();
 return dis;
 }
 }

Modified: 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFileRandomAccessContent.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFileRandomAccessContent.java?view=diff&r1=154135&r2=154136
==
--- 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFileRandomAccessContent.java
 (original)
+++ 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFileRandomAccessContent.java
 Wed Feb 16 23:45:27 2005
@@ -28,7 +28,7 @@
 
 /**
  * RandomAccess for local files
- * 
+ *
  * @author mailto:[EMAIL PROTECTED]">Mario Ivankovits
  * @version $Revision: 1.1 $ $Date$
  */
@@ -257,7 +257,7 @@
 raf.writeUTF(str);
 }
 
-public InputStream getInputStream()
+public InputStream getInputStream() throws IOException
 {
 return rafis;
 }

Modified: 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/smb/SmbFileRandomAccessContent.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/smb/SmbFileRandomAccessContent.java?view=diff&r1=154135&r2=154136
==
--- 
jakarta/commo

DO NOT REPLY [Bug 33614] New: - vendorCode and SQLState not included in SQLException

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33614

   Summary: vendorCode and SQLState not included in SQLException
   Product: Commons
   Version: unspecified
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: DbUtils
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]


the protected rethrow Method in QueryRunner does not include the vendorCode and 
SQLState in the thrown SQLException.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [chain] LookupCommand's return value

2005-02-16 Thread James Mitchell
I'm just now catching up on some of thisbut I was wondering.if you 
configure "ignoreReturnValue" or "abortIfContextValueTrueOrNull" or 
"whatchaMaCallit", then how would you (in a looked up chain) tell the 
calling chain to abort without having to throw an exception?

--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx
- Original Message - 
From: "Joe Germuska" <[EMAIL PROTECTED]>
To: "Craig McClanahan" <[EMAIL PROTECTED]>; "Jakarta Commons Developers 
List" ; "Sean Schofield" 
<[EMAIL PROTECTED]>
Sent: Wednesday, February 16, 2005 12:48 PM
Subject: Re: [chain] LookupCommand's return value


At 9:23 AM -0800 2/16/05, Craig McClanahan wrote:
On Wed, 16 Feb 2005 08:08:14 -0500, Sean Schofield
<[EMAIL PROTECTED]> wrote:
 > I'm just hesitant to add a new dependency on my own whim.  JEXL isn't
 > very heavy (132 K) but I think people are keen on keeping Chain light
 > too.
 Keeping chain light would be nice.  I don't know too much about JEXL
 personally although I will be investigating it shortly as an
 alternative to Velocity for some template stuff I have.  How would you
 propose doing it if you didn't use JEXL?
 > Joe
Digester has some limited parameter substitution capabilities that
could be applied when the chain configuration is being parsed.  Is
that enough to satisfy the kinds of things you're thinking of that
might want expressions?
I don't think so, since I'm specifically interested in runtime state. "Is 
the ActionForm in *this* context valid?"   "Look up the command with the 
name matching the value of the 'path' property of the current 
ForwardConfig."  "Look up and execute a command only if the current value 
of context property "unitsOrdered" is greater than 1000."

Again, for some or all of these, one could probably manage with judicious 
use of CopyCommand and LookupCommand, possibly augmented by some very 
simple compiled Java commands which might have properties for some 
configurability.

If there's hesitation to formally add any external dependency to the 
project, then when I get around to writing some of these, I'll just put 
them up somewhere and invite people to have a look.  If people don't feel 
that a compile-time dependency on JEXL (which is small and which has seen 
a 1.0 release) is too great a burden, then I'll do them directly in the 
repository in a package which clearly separates them from the 
dependency-free classes (org.apache.commons.chain.impl.expr or 
org.apache.commons.chain.impl.jexl).

Joe
--
Joe Germuska[EMAIL PROTECTED]  http://blog.germuska.com 
"Narrow minds are weapons made for mass destruction"  -The Ex

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: commons benchmark in sandbox.

2005-02-16 Thread Kevin A. Burton
Brett Porter wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
You might like to check out Atlassian Profiling - I believe it does
something similar to what you are doing. I've found it useful in the
past for the reasons you've given.
http://opensource.atlassian.com/profiling/
 

Thats looks closer to what I want... I'll checkout the code...
Kevin
--
Use Rojo (RSS/Atom aggregator).  Visit http://rojo.com. Ask me for an 
invite!  Also see irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html
If you're interested in RSS, Weblogs, Social Networking, etc... then you 
should work for Rojo!  If you recommend someone and we hire them you'll 
get a free iPod!
   
Kevin A. Burton, Location - San Francisco, CA
  AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [betwixt] Patch for ID storing strategy

2005-02-16 Thread robert burrell donkin
hi christian

i've taken a look at the patch and it seems ok as far as it goes. some
more is needed since logically something similar is needed for the read
phase. i'll probably find time to add read code tomorrow unless someone
one lists beats me to it... 

in future, please consider adding some units and preferable some
documentation for the user guide. they are very much appreciated :)  

- robert

On Wed, 2005-02-16 at 09:42, Christian Aust wrote:
> Hi,
> 
> the following is a patch against current CVS 
> jakarta-commons/betwixt/src/java that implements a pluggable strategy 
> for storing already processed bean ID values. The default implementation 
> provided works exactly like it did before, but it allows me to override 
> this behaviour.
> 
> The idea is that (while serializing certain object trees that have a lot 
> of dependencies) not every instance that is referenced needs to show up 
> in the resulting XML. This depends on the use you make of it: XML 
> fragments designed to transfer individual pieces of information can be 
> significantly smaller than those needed to fully recreate a complex 
> object tree.
> 
> I'd be happy to commit this to the standard code base. Kind regards,
> 
> -  Christian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: commons benchmark in sandbox.

2005-02-16 Thread Brett Porter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

You might like to check out Atlassian Profiling - I believe it does
something similar to what you are doing. I've found it useful in the
past for the reasons you've given.

http://opensource.atlassian.com/profiling/

Kevin A. Burton wrote:

> Hey.
>
> I just added a new project to the sandbox. Its designed to provide
lightweight runtime benchmarking for Java code. Think log4j for
benchmarking.
>
> The code can be disabled at runtime with almost no performance hit. Its
also very fast when enabled as well being able to product 1M benchmarks
per second with a modern CPU.
>
> The goal is to provide universal and exported performance benchmarks
that can be enabled at runtime for the JVM. It can also be used to
provide historical benchmarking. Think perfmon for Java. We actually are
using it to tie it into ganglia and rrdtool so that we can generate
graphs as the the performance of our application.
>
> Right now its just a working proof of concept and needs a lot before it
can be shipped. Better API design, XML configuration support,
documentation, etc.
>
> Once (and if) its in Jakarta and out of the sandbox it could be used in
packages like FeedParser or Tomcat to export benchmarking statistics.
>
> Kevin
>

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCE73MOb5RoQhMkRMRAkEmAKDDzJJiFVZWbKi2nTB5WTlbJtcUCACeJPLS
VgtRFBAwoX4uXe8e01FTW7I=
=B20Q
-END PGP SIGNATURE-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jcl blog post

2005-02-16 Thread robert burrell donkin
On Wed, 2005-02-16 at 06:57, Kevin A. Burton wrote:
> Craig McClanahan wrote:
> 
> >On Tue, 15 Feb 2005 22:50:51 -0600, Vic <[EMAIL PROTECTED]> wrote:
> >  
> >
> >>oops :-[
> >>Wrong link, this is it:
> >>http://www.szegedi.org/articles/memleak.html
> >>
> >>It talks about Commons logging, since i'ts open season.
> >>.V
> >>
> >>
> >
> >There's lots of ways to shoot yourself in the foot the same way ...
> >you don't need JCL to do that ... pretty much any implementation of
> >the factory design pattern should be looked at with suspicion.
> >
> >By the way ... if you use [chain] you should *really* pay attention to
> >the Javadocs for CatalogFactory.clear() ;-)
> >  
> >
> You know I have a similar little story about Commons DBCP.
> 
> Its evil.. pure evil! ;)
> 
> I actually rewrote it from scratch because I needed a good connection 
> pool implementation and DBCP just wasn't cutting it but it was 85% there.
> 
> So one weekend I gutted the core and wrote my own pool implementation 
> and increased performance significantly.
> 
> The key part for me was that for SOME reason in my highly multithreaded 
> app it would bleed connections. After about 48 hours our app wouldn't 
> have any more connections and all my threads would sit there sleeping 
> waiting for connections that would never come.
> 
> Anyway... I called my newborn connection pool BDCP (basic database 
> connection pool).
> 
> Its about 1/5 the size of DBCP and a LOT easier to maintain.
> 
> Anyway... I was considering OSSing it here in the future but didn't know 
> how to approach it with commons-dbcp folks...

http://incubator.apache.org/learn/rules-for-revolutionaries.html

a lot of the stuff which was created in the early days of the commons is
pretty mature: either it's been taken as far as it can, or as far as the
limitations of original design (and so backwards compatibility) or by
conception (the limitations set by the original creators). there is a
place for well maintained, relatively well tested and well used
libraries. there is also a place for new libraries offering potential
benefits but which aren't as well tested in production. 

however, it's also important to be positive about the benefits offered
by the new (as opposed to simply being negative about the old). it's not
unusual for better designs to emerge by discussing different approaches
to the same problem.

- robert


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: commons benchmark in sandbox.

2005-02-16 Thread Brad Neuberg


Similarly, with AspectJ [or other alternatives], what are you providing 
that goes beyond what you might do in that space?


I haven't played around much with ApsectJ but it doesn't do a lot of what 
I want.  I mean I'd have to provide my own function advice which would 
have to implement benchmarking so I'm back to square one.

The benefit of Kevin's system is you don't have to adopt the entire aspect 
way of programming just to get benchmarking.


Brad Neuberg, [EMAIL PROTECTED]
Senior Software Engineer, Rojo Networks
Weblog: http://www.codinginparadise.org
=
Check out Rojo, an RSS and Atom news aggregator that I work on.  Visit 
http://rojo.com for more info. Feel free to ask me for an invite!

Rojo is Hiring!  If you're interested in RSS, Weblogs, Social Networking, 
Java, Open Source, etc... then come work with us at Rojo.  If you recommend 
someone and we hire them you'll get a free iPod!  See 
http://www.rojonetworks.com/JobsAtRojo.html. 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


DO NOT REPLY [Bug 33255] - [VFS] ftp file system depends on ORO for a MalformedPatternException

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33255


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r154082 - jakarta/commons/sandbox/vfs/trunk/xdocs/todo.xml

2005-02-16 Thread imario
Author: imario
Date: Wed Feb 16 12:32:19 2005
New Revision: 154082

URL: http://svn.apache.org/viewcvs?view=rev&rev=154082
Log:
updated todo

Modified:
jakarta/commons/sandbox/vfs/trunk/xdocs/todo.xml

Modified: jakarta/commons/sandbox/vfs/trunk/xdocs/todo.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/xdocs/todo.xml?view=diff&r1=154081&r2=154082
==
--- jakarta/commons/sandbox/vfs/trunk/xdocs/todo.xml (original)
+++ jakarta/commons/sandbox/vfs/trunk/xdocs/todo.xml Wed Feb 16 12:32:19 2005
@@ -83,8 +83,12 @@
 
 Fix set last-modified. (done)
 
-Support passive mode.
-Add proxy support.
+
+Support passive mode. (done 
FtpFileSystemConfigBuilder)
+
+
+Add proxy support. no ftp-proxy 
standard available. If you are lucky - you simply could use special formed urls.
+
 
 
 URL Provider:
@@ -104,7 +108,8 @@
 some mechanism needs to be provided to release and refresh
 cached info. (done)
 
-Some mechanism needs to be provided refresh cached info
+Some mechanism needs to be provided refresh cached 
info
+(FileObject.close() rereads the file informations - this 
is threadsafe)
 
 
 The local disk caching mechanism also needs more work.  
Needs



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r154081 - in jakarta/commons/sandbox/vfs/trunk: build.xml project.xml xdocs/download.xml

2005-02-16 Thread imario
Author: imario
Date: Wed Feb 16 12:32:02 2005
New Revision: 154081

URL: http://svn.apache.org/viewcvs?view=rev&rev=154081
Log:
PR: 33255

State "oro" as dependency for FTP as some FtpFileEntryParsers require it.

Thanks to Anthony Goubard for pointing this out.

Modified:
jakarta/commons/sandbox/vfs/trunk/build.xml
jakarta/commons/sandbox/vfs/trunk/project.xml
jakarta/commons/sandbox/vfs/trunk/xdocs/download.xml

Modified: jakarta/commons/sandbox/vfs/trunk/build.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/build.xml?view=diff&r1=154080&r2=154081
==
--- jakarta/commons/sandbox/vfs/trunk/build.xml (original)
+++ jakarta/commons/sandbox/vfs/trunk/build.xml Wed Feb 16 12:32:02 2005
@@ -202,5 +202,7 @@
 
 http://www.ibiblio.org/maven/xml-apis/jars/xml-apis-1.0.b2.jar";>
 
+http://www.ibiblio.org/maven/oro/jars/oro-2.0.8.jar";>
+
 
 

Modified: jakarta/commons/sandbox/vfs/trunk/project.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/project.xml?view=diff&r1=154080&r2=154081
==
--- jakarta/commons/sandbox/vfs/trunk/project.xml (original)
+++ jakarta/commons/sandbox/vfs/trunk/project.xml Wed Feb 16 12:32:02 2005
@@ -110,6 +110,12 @@
 xml-apis
 1.0.b2
 
+
+
+oro
+oro
+2.0.8
+
 
 
 

Modified: jakarta/commons/sandbox/vfs/trunk/xdocs/download.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/xdocs/download.xml?view=diff&r1=154080&r2=154081
==
--- jakarta/commons/sandbox/vfs/trunk/xdocs/download.xml (original)
+++ jakarta/commons/sandbox/vfs/trunk/xdocs/download.xml Wed Feb 16 12:32:02 
2005
@@ -41,7 +41,13 @@
 Jakarta
 http://jakarta.apache.org/commons/net/";>Commons Net Version 1.2.1 or 
later.
 
-FTP
+FTP
+
+
+
+Jakarta
+http://jakarta.apache.org/oro/";>ORO 
Version 2.0.8
+
 
 
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jcl blog post

2005-02-16 Thread robert burrell donkin
FWIW

this is a well known issue with JCL and there's no way to cure it on 1.2
JVMs (which was the target for JCL). (thanks to brian) for a few months
now, HEAD has had compatible code which allows memory reclamation on
more modern JVMs (with weak references). if a few more folks were
prepared to test the release candidate, this code might even get a
release...

it's only a practical issue in containers which have JCL placed into a
classloader high in the tree and then hot deploy contained applications
without calling release. it is also documented in the javadocs (which
should help to explain why it took so long for users to discover this
limitation.)

at least ceki puts time and effort into researching his critiques... 

- robert

On Wed, 2005-02-16 at 04:50, Vic wrote:
> oops :-[
> Wrong link, this is it:
> http://www.szegedi.org/articles/memleak.html
> 
> It talks about Commons logging, since i'ts open season.
> .V
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: commons benchmark in sandbox.

2005-02-16 Thread Kevin A. Burton
Richard Sitze wrote:
With so many benchmark and profiling tools available that do not require 
instrumenting the code, what real benefit do you see this providing? 
 

Again... I haven't found anything that comes anywhere close to what I 
need. 
Most profiling tools are horrible... and most benchmarking tools require 
you to recompile your application.

This way your app can export benchmarks and you can enable/disable them 
at runtime.

You can also LEAVE them enabled and use them to export historical data 
for your app.

Again... think log4j but for benchmarks.
Similarly, with AspectJ [or other alternatives], what are you providing 
that goes beyond what you might do in that space?

 

I haven't played around much with ApsectJ but it doesn't do a lot of 
what I want.  I mean I'd have to provide my own function advice which 
would have to implement benchmarking so I'm back to square one.

The advice approach is cool.  It would be cool of commons benchmark 
could benchmark any existing packages.  For example I could benchmark 
the ConnectorJ for MySQL without their cooperation.  Then all my 
executeUpdate, executeQuery functions would be benchmarked.

Still trying to think of the ideal approach here but its still coming 
together :)

Kevin
--
Use Rojo (RSS/Atom aggregator).  Visit http://rojo.com. Ask me for an 
invite!  Also see irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html
If you're interested in RSS, Weblogs, Social Networking, etc... then you 
should work for Rojo!  If you recommend someone and we hire them you'll 
get a free iPod!
   
Kevin A. Burton, Location - San Francisco, CA
  AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: commons benchmark in sandbox.

2005-02-16 Thread Richard Sitze
With so many benchmark and profiling tools available that do not require 
instrumenting the code, what real benefit do you see this providing? 
Similarly, with AspectJ [or other alternatives], what are you providing 
that goes beyond what you might do in that space?



***
Richard A. Sitze
IBM WebSphere WebServices Development

"Kevin A. Burton" <[EMAIL PROTECTED]> wrote on 02/16/2005 01:27:24 
PM:

> Hey.
> 
> I just added a new project to the sandbox.  Its designed to provide 
> lightweight runtime benchmarking for Java code.  Think log4j for 
> benchmarking.
> 
> The code can be disabled at runtime with almost no performance hit.  Its 

> also very fast when enabled as well being able to product 1M benchmarks 
> per second with a modern CPU.
> 
> The goal is to provide universal and exported performance benchmarks 
> that can be enabled at runtime for the JVM.  It can also be used to 
> provide historical benchmarking.  Think perfmon for Java.  We actually 
> are using it to tie it into ganglia and rrdtool so that we can generate 
> graphs as the the performance of our application.
> 
> Right now its just a working proof of concept and needs a lot before it 
> can be shipped.  Better API design, XML configuration support, 
> documentation, etc.
> 
> Once (and if) its in Jakarta and out of the sandbox it could be used in 
> packages like FeedParser or Tomcat to export benchmarking statistics.
> 
> Kevin
> 
> -- 
> 
> Use Rojo (RSS/Atom aggregator).  Visit http://rojo.com. Ask me for an 
> invite!  Also see irc.freenode.net #rojo if you want to chat.
> 
> Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html
> 
> If you're interested in RSS, Weblogs, Social Networking, etc... then you 

> should work for Rojo!  If you recommend someone and we hire them you'll 
> get a free iPod!
> 
> Kevin A. Burton, Location - San Francisco, CA
>AIM/YIM - sfburtonator,  Web - http://peerfear.org/
> GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


svn commit: r154073 - jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java

2005-02-16 Thread burton
Author: burton
Date: Wed Feb 16 11:31:06 2005
New Revision: 154073

URL: http://svn.apache.org/viewcvs?view=rev&rev=154073
Log:
moved TODOs to a dedicate source file

Modified:

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java?view=diff&r1=154072&r2=154073
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 Wed Feb 16 11:31:06 2005
@@ -19,26 +19,29 @@
 import java.util.*;
 
 /**
+ * 
  * Benchmark that allows cheap and lightweight "benchmarking" (go figure) of
  * arbitrary code.  All you have to do is call start() every time a method
  * starts which will then increment the benchmark and perform any operations
  * necessary to maintain the benchmark.  Just call complete() when your method
  * is done.  
  * 
+ * 
  * This class is lightweight (only requires a hashmap entry, and 32 bytes per
  * benchmark of storage with no external requirements.  This class is also
  * threadsafe so if you need to call this from multithreaded code to benchmark
  * then you'll be ok.
- * 
+ *
+ * 
  * The benchmark is maintained as number of starts and completes per minute.
  * This can be any type of operation you want.  Technically the interval can be
  * longer than a minute but we will end up with stale data.  That's the 
tradeoff
  * with this type of benchmark.  Its cheap and easy to maintain but anything
  * more than 60 seconds worth of data and you'll end up with a stale benchmark.
- * 
- * Internally we use an incremented value which is accumulated and reset ever 
60
- * seconds.  When we reset the benchmark we reset the current value so that we
- * can start accumulating again.
+ *
+ *  Internally we use an incremented value which is accumulated and reset
+ * ever 60 seconds.  When we reset the benchmark we reset the current value so
+ * that we can start accumulating again.
  * 
  * 
  * 
@@ -64,41 +67,6 @@
  * @version $Id: Benchmark.java,v 1.3 2005/02/16 02:28:09 burton Exp $
  */
 public class Benchmark {
-
-/*
-
-TODO:
-
-- Ability to enable logging with log4j and debug() so that during every
-  rotate of the benchmarks I will get a log.info() message.  These should 
be
-  log4j categories so that I can do benchmark.ksa.om.ArticlePeer.hasArticle
-  and then enable benchmarks via a log4j configurator.
-
-  - Potential bug.  If we don't log anything > 5 minutes the LAST benchmark
-  will be rotated.  I actually have to check if the last benchmark was more
-  than INTERVAL ago and if so then delete the last benchmark
-
-  - Potential bug.  When we don't call start/complete for a long period of
-time we wouldn't ever log our status.
-
-- It might actually be BETTER to combine the last benchmark with the 
current
-  benchmark but prorate the current value and then avg() them.  This would
-  give us a more realistic "ETA" style benchmark of current performance.
-  For stats which don't update very much or for 5 minute interval stats 
this
-  would be perfect.
-
-  - We're going to need a config file like log4j...
-  
-*/
-
-//FIXME: how can we measure the TOTAL time we've spent between
-//start/complete ??  This might be important because for tasks like SQL
-//selects we'll need to time the duration we spend in the methods.  I'm not
-//sure its even possible with the current API.  This actually doesn't make
-//much sense in threadtime if you think about it.  For example 100 threads
-//could be started which each take 60 seconds to finish.  If they all 
finish
-//at the same time we would compute that 6 seconds of machine time were
-//used
 
 /**
  * How often should we maintain/reset the benchmark.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



commons benchmark in sandbox.

2005-02-16 Thread Kevin A. Burton
Hey.
I just added a new project to the sandbox.  Its designed to provide 
lightweight runtime benchmarking for Java code.  Think log4j for 
benchmarking.

The code can be disabled at runtime with almost no performance hit.  Its 
also very fast when enabled as well being able to product 1M benchmarks 
per second with a modern CPU.

The goal is to provide universal and exported performance benchmarks 
that can be enabled at runtime for the JVM.  It can also be used to 
provide historical benchmarking.  Think perfmon for Java.  We actually 
are using it to tie it into ganglia and rrdtool so that we can generate 
graphs as the the performance of our application.

Right now its just a working proof of concept and needs a lot before it 
can be shipped.  Better API design, XML configuration support, 
documentation, etc.

Once (and if) its in Jakarta and out of the sandbox it could be used in 
packages like FeedParser or Tomcat to export benchmarking statistics.

Kevin
--
Use Rojo (RSS/Atom aggregator).  Visit http://rojo.com. Ask me for an 
invite!  Also see irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html
If you're interested in RSS, Weblogs, Social Networking, etc... then you 
should work for Rojo!  If you recommend someone and we hire them you'll 
get a free iPod!
   
Kevin A. Burton, Location - San Francisco, CA
  AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


svn commit: r154072 - in jakarta/commons/sandbox/vfs/trunk/src: java/org/apache/commons/vfs/ java/org/apache/commons/vfs/provider/ java/org/apache/commons/vfs/provider/ftp/ java/org/apache/commons/vfs/provider/http/ java/org/apache/commons/vfs/provider/local/ java/org/apache/commons/vfs/provider/smb/ java/org/apache/commons/vfs/util/ test/org/apache/commons/vfs/test/ test/org/apache/commons/vfs/util/

2005-02-16 Thread imario
Author: imario
Date: Wed Feb 16 11:25:31 2005
New Revision: 154072

URL: http://svn.apache.org/viewcvs?view=rev&rev=154072
Log:
FtpRandomAccessContent aka restart filetransfer
bugfix HttpRandomAccessContent - extended testcase

Added:

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpRandomAccessContent.java
Modified:

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/RandomAccessContent.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractRandomAccessContent.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FTPClientWrapper.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpClient.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpFileProvider.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpFileSystemConfigBuilder.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/local/LocalFileRandomAccessContent.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/smb/SmbFileRandomAccessContent.java

jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/util/MonitorRandomAccessContent.java

jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/test/ProviderRandomReadTests.java

jakarta/commons/sandbox/vfs/trunk/src/test/org/apache/commons/vfs/util/DelegatingFileSystemOptionsBuilderTest.java

Modified: 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/RandomAccessContent.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/RandomAccessContent.java?view=diff&r1=154071&r2=154072
==
--- 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/RandomAccessContent.java
 (original)
+++ 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/RandomAccessContent.java
 Wed Feb 16 11:25:31 2005
@@ -18,12 +18,13 @@
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
+import java.io.InputStream;
 
 /**
  * Description
  * 
  * @author mailto:[EMAIL PROTECTED]">Mario Ivankovits
- * @version $Revision: 1.1 $ $Date: 2004/06/17 19:29:28 $
+ * @version $Revision: 1.1 $ $Date$
  */
 public interface RandomAccessContent extends DataOutput, DataInput
 {
@@ -43,6 +44,8 @@
  * of the file does not change the file length.  The file length will
  * change only by writing after the offset has been set beyond the end
  * of the file.
+ * 
+ * Notice: If you use [EMAIL PROTECTED] #getInputStream()} you have to 
reget the InputStream after calling [EMAIL PROTECTED] #seek(long)}
  *
  * @param pos the offset position, measured in bytes from the
  *beginning of the file, at which to set the file
@@ -72,4 +75,12 @@
  * @throws IOException if an I/O error occurs.
  */
 public void close() throws IOException;
+
+/**
+ * get the inputstream interface
+ * 
+ * Notice: If you use [EMAIL PROTECTED] #seek(long)} you have to reget 
the InputStream
+ * @return
+ */
+public InputStream getInputStream();
 }

Modified: 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractRandomAccessContent.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractRandomAccessContent.java?view=diff&r1=154071&r2=154072
==
--- 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractRandomAccessContent.java
 (original)
+++ 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractRandomAccessContent.java
 Wed Feb 16 11:25:31 2005
@@ -26,7 +26,7 @@
  * (for read-only random access implementations)
  * 
  * @author mailto:[EMAIL PROTECTED]">Mario Ivankovits
- * @version $Revision: 1.1 $ $Date: 2004/06/17 19:29:28 $
+ * @version $Revision: 1.1 $ $Date$
  */
 public abstract class AbstractRandomAccessContent implements 
RandomAccessContent
 {

Modified: 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FTPClientWrapper.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FTPClientWrapper.java?view=diff&r1=154071&r2=154072
==
--- 
jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FTPClientWrapper.java
 (original)
+++ 

[Jakarta Commons Wiki] Updated: UsingSVN

2005-02-16 Thread commons-dev
   Date: 2005-02-16T11:22:50
   Editor: KevinBurton
   Wiki: Jakarta Commons Wiki
   Page: UsingSVN
   URL: http://wiki.apache.org/jakarta-commons/UsingSVN

   no comment

Change Log:

--
@@ -35,8 +35,10 @@
 == Importing ==
 
 {{{
-svn import 
https://svn.apache.org/repos/asf/jakarta/commons/sandbox/benchmark/trunk
+svn import 
https://svn.apache.org/repos/asf/jakarta/commons/sandbox/PROJECT_NAME/trunk
 }}}
+
+Where PROJECT_NAME is the name of the package you want to import.
 
 = Differences between CVS and SVN =
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r154071 - jakarta/commons/sandbox/benchmark/trunk/project.xml

2005-02-16 Thread burton
Author: burton
Date: Wed Feb 16 11:22:38 2005
New Revision: 154071

URL: http://svn.apache.org/viewcvs?view=rev&rev=154071
Log:
projects support

Added:
jakarta/commons/sandbox/benchmark/trunk/project.xml

Added: jakarta/commons/sandbox/benchmark/trunk/project.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/project.xml?view=auto&rev=154071
==
--- jakarta/commons/sandbox/benchmark/trunk/project.xml (added)
+++ jakarta/commons/sandbox/benchmark/trunk/project.xml Wed Feb 16 11:22:38 2005
@@ -0,0 +1,88 @@
+
+
+
+../commons-build/sandbox-project.xml
+
+Commons Benchmark
+
+commons-benchmark
+
+/images/benchmark-logo-white.png
+
+http://jakarta.apache.org/commons/sandbox/benchmark/
+
+2004
+
+Jakarta Benchmark
+
+Jakarta Benchmark
+
+0.0.1
+
+org.apache.commons.benchmark
+
+
+
+
+
+
+
+
+
+
+Kevin A. Burton
+
+burton
+burton1--at--rojo.com
+Rojo Networks Inc.
+
+
+
+
+
+
+
+
+
+
+
+
+xml-apis2.0.2
+xerces2.0.2
+
+
+
+
+[EMAIL PROTECTED]
+src/java
+
+
+
+
+maven-changelog-plugin
+maven-changes-plugin
+
+
+
+
+
+maven-developer-activity-plugin
+maven-file-activity-plugin
+maven-javadoc-plugin
+
+
+
+maven-jxr-plugin
+maven-license-plugin
+
+
+
+
+
+



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Jakarta Commons Wiki] Updated: UsingSVN

2005-02-16 Thread commons-dev
   Date: 2005-02-16T11:16:49
   Editor: KevinBurton
   Wiki: Jakarta Commons Wiki
   Page: UsingSVN
   URL: http://wiki.apache.org/jakarta-commons/UsingSVN

   no comment

Change Log:

--
@@ -5,13 +5,14 @@
 a day.  *Instead*, check out individual components, or (more likely)
 check out "trunks-proper" or "trunks-sandbox".
 
-'''Checkout all components'''
+== Checkout all components ==
 {{{
 svn co https://svn.apache.org/repos/asf/jakarta/commons/trunks-proper/ 
jakarta/commons/trunks-proper
 svn co https://svn.apache.org/repos/asf/jakarta/commons/trunks-sandbox/ 
jakarta/commons/trunks-sandbox
 }}}
 
-'''Checkout individual components''' ''(Don't forget to checkout 
commons-build!)''
+== Checkout individual components''' ''(Don't forget to checkout 
commons-build!) ==
+
 {{{
 svn co 
https://svn.apache.org/repos/asf/jakarta/commons/proper/commons-build/trunk 
jakarta/commons/trunks-proper/commons-build
 svn co https://svn.apache.org/repos/asf/jakarta/commons/proper/dbcp/trunk 
jakarta/commons/trunks-proper/dbcp
@@ -21,7 +22,7 @@
 svn co https://svn.apache.org/repos/asf/jakarta/commons/sandbox/cache/trunk 
jakarta/commons/trunks-sandbox/cache
 }}}
 
-'''Getting directory listings'''
+== Getting directory listings==
 
 If you don't know the exact path to the component you wish to access, use 'svn 
ls' to get a directory listing, eg:
 {{{
@@ -30,6 +31,12 @@
 
 A web browser can also be used to view the repository structure, just by 
entering the URL that you would use for subversion operations.
 Note that this shows only the latest version of everything (directories and 
files).
+
+== Importing ==
+
+{{{
+svn import 
https://svn.apache.org/repos/asf/jakarta/commons/sandbox/benchmark/trunk
+}}}
 
 = Differences between CVS and SVN =
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r154067 - in jakarta/commons/sandbox/benchmark: ./ trunk/ trunk/src/ trunk/src/java/ trunk/src/java/org/ trunk/src/java/org/apache/ trunk/src/java/org/apache/commons/ trunk/src/java/org/apache/commons/benchmark/ trunk/src/java/org/apache/commons/benchmark/Benchmark.java

2005-02-16 Thread burton
Author: burton
Date: Wed Feb 16 11:13:16 2005
New Revision: 154067

URL: http://svn.apache.org/viewcvs?view=rev&rev=154067
Log:
init

Added:
jakarta/commons/sandbox/benchmark/
jakarta/commons/sandbox/benchmark/trunk/
jakarta/commons/sandbox/benchmark/trunk/src/
jakarta/commons/sandbox/benchmark/trunk/src/java/
jakarta/commons/sandbox/benchmark/trunk/src/java/org/
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java

Added: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java?view=auto&rev=154067
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 (added)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 Wed Feb 16 11:13:16 2005
@@ -0,0 +1,299 @@
+/*
+ * Copyright 1999,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.benchmark;
+
+import java.util.*;
+
+/**
+ * Benchmark that allows cheap and lightweight "benchmarking" (go figure) of
+ * arbitrary code.  All you have to do is call start() every time a method
+ * starts which will then increment the benchmark and perform any operations
+ * necessary to maintain the benchmark.  Just call complete() when your method
+ * is done.  
+ * 
+ * This class is lightweight (only requires a hashmap entry, and 32 bytes per
+ * benchmark of storage with no external requirements.  This class is also
+ * threadsafe so if you need to call this from multithreaded code to benchmark
+ * then you'll be ok.
+ * 
+ * The benchmark is maintained as number of starts and completes per minute.
+ * This can be any type of operation you want.  Technically the interval can be
+ * longer than a minute but we will end up with stale data.  That's the 
tradeoff
+ * with this type of benchmark.  Its cheap and easy to maintain but anything
+ * more than 60 seconds worth of data and you'll end up with a stale benchmark.
+ * 
+ * Internally we use an incremented value which is accumulated and reset ever 
60
+ * seconds.  When we reset the benchmark we reset the current value so that we
+ * can start accumulating again.
+ * 
+ * 
+ * 
+ * Benchmark benchmark = Benchmark.getBenchmark( "foo" );
+ * 
+ * try {
+ * 
+ * benchmark.start();
+ * 
+ * //do something expensive
+ * 
+ * } finally {
+ * benchmark.complete();
+ * }
+ * 
+ * 
+ * 
+ * The method overhead is very light. One a modern machine you can perform 
about
+ * 1M benchmarks per second.  For code thats only called a few thousand times
+ * you won't notice any performance overhead.
+ * 
+ * @author mailto:[EMAIL PROTECTED]">Kevin Burton
+ * @version $Id: Benchmark.java,v 1.3 2005/02/16 02:28:09 burton Exp $
+ */
+public class Benchmark {
+
+/*
+
+TODO:
+
+- Ability to enable logging with log4j and debug() so that during every
+  rotate of the benchmarks I will get a log.info() message.  These should 
be
+  log4j categories so that I can do benchmark.ksa.om.ArticlePeer.hasArticle
+  and then enable benchmarks via a log4j configurator.
+
+  - Potential bug.  If we don't log anything > 5 minutes the LAST benchmark
+  will be rotated.  I actually have to check if the last benchmark was more
+  than INTERVAL ago and if so then delete the last benchmark
+
+  - Potential bug.  When we don't call start/complete for a long period of
+time we wouldn't ever log our status.
+
+- It might actually be BETTER to combine the last benchmark with the 
current
+  benchmark but prorate the current value and then avg() them.  This would
+  give us a more realistic "ETA" style benchmark of current performance.
+  For stats which don't update very much or for 5 minute interval stats 
this
+  would be perfect.
+
+  - We're going to need a config file like log4j...
+  
+*/
+
+//FIXME: how can we measure the TOTAL time we've spent between
+//start/complete ?? 

DO NOT REPLY [Bug 33574] - [lang] unbalanced ReflectionToStringBuilder

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33574





--- Additional Comments From [EMAIL PROTECTED]  2005-02-16 19:50 ---
Created an attachment (id=14299)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=14299&action=view)
Patch to the unit test to show the problem.

Attached is a patch to ToStringBuilderTest.java.  If you patch the
ToStringBuilderTest.java and run the test, you will see that the test failed. 
Apply the patch intended for ReflectionToStringBuilder.java and you will see
that all tests pass.

The gist of the patch is to show that a cyclical object followed by another
object will result in a bad output string in that there is not a comma (the
default field separator) between the two objects.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [chain] LookupCommand's return value

2005-02-16 Thread Joe Germuska
At 9:23 AM -0800 2/16/05, Craig McClanahan wrote:
On Wed, 16 Feb 2005 08:08:14 -0500, Sean Schofield
<[EMAIL PROTECTED]> wrote:
 > I'm just hesitant to add a new dependency on my own whim.  JEXL isn't
 > very heavy (132 K) but I think people are keen on keeping Chain light
 > too.
 Keeping chain light would be nice.  I don't know too much about JEXL
 personally although I will be investigating it shortly as an
 alternative to Velocity for some template stuff I have.  How would you
 propose doing it if you didn't use JEXL?
 > Joe
Digester has some limited parameter substitution capabilities that
could be applied when the chain configuration is being parsed.  Is
that enough to satisfy the kinds of things you're thinking of that
might want expressions?
I don't think so, since I'm specifically interested in runtime state. 
"Is the ActionForm in *this* context valid?"   "Look up the command 
with the name matching the value of the 'path' property of the 
current ForwardConfig."  "Look up and execute a command only if the 
current value of context property "unitsOrdered" is greater than 
1000."

Again, for some or all of these, one could probably manage with 
judicious use of CopyCommand and LookupCommand, possibly augmented by 
some very simple compiled Java commands which might have properties 
for some configurability.

If there's hesitation to formally add any external dependency to the 
project, then when I get around to writing some of these, I'll just 
put them up somewhere and invite people to have a look.  If people 
don't feel that a compile-time dependency on JEXL (which is small and 
which has seen a 1.0 release) is too great a burden, then I'll do 
them directly in the repository in a package which clearly separates 
them from the dependency-free classes 
(org.apache.commons.chain.impl.expr or 
org.apache.commons.chain.impl.jexl).

Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [chain] LookupCommand's return value

2005-02-16 Thread Craig McClanahan
On Wed, 16 Feb 2005 08:08:14 -0500, Sean Schofield
<[EMAIL PROTECTED]> wrote:
> > I'm just hesitant to add a new dependency on my own whim.  JEXL isn't
> > very heavy (132 K) but I think people are keen on keeping Chain light
> > too.
> 
> Keeping chain light would be nice.  I don't know too much about JEXL
> personally although I will be investigating it shortly as an
> alternative to Velocity for some template stuff I have.  How would you
> propose doing it if you didn't use JEXL?
> 
> > Joe

Digester has some limited parameter substitution capabilities that
could be applied when the chain configuration is being parsed.  Is
that enough to satisfy the kinds of things you're thinking of that
might want expressions?

Craig

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [collections] Porting to JDK 1.5 and Generics

2005-02-16 Thread Stephen Colebourne
This project is on sf because no-one at Apache was
willing to step up and manage it here. The aim would
be to pull the code back in at some point, once more
complete.

Stephen

 --- Mauro Franceschini <[EMAIL PROTECTED]>
wrote: 
> But this project is managed external developers or
> by Apache and only
> hosted on sourceforge?
> 
> 
> On Wed, 16 Feb 2005 15:12:35 + (GMT), Stephen
> Colebourne
> <[EMAIL PROTECTED]> wrote:
> > See http://sourceforge.net/projects/collections15/
> for
> > one attempt. I believe that it should be hosted at
> > Jakarta-Commons, but I lack the time to manage
> this.
> > 
> > Maybe another Apache committer has the time?
> > 
> > Stephen
> > 
> >  --- Mauro Franceschini
> <[EMAIL PROTECTED]>
> > wrote:
> > > Hi to all!
> > >
> > > Any ideas about a port to Generics in JDK1.5
> about
> > > the Commons
> > > Collections Framework?
> > >
> > > I'd like to help on it.
> > >
> > > Mauro
> > >
> > >
> >
>
-
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> > 
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> >
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33609] - [lang] Unclear javadoc for DateUtils.iterator()

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33609


[EMAIL PROTECTED] changed:

   What|Removed |Added

Summary|Unclear javadoc for |[lang] Unclear javadoc for
   |DateUtils.iterator()|DateUtils.iterator()




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33609] New: - Unclear javadoc for DateUtils.iterator()

2005-02-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33609

   Summary: Unclear javadoc for DateUtils.iterator()
   Product: Commons
   Version: 2.0 Final
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Lang
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


The javadoc for DateUtils.iterator() seems to say that the iterator returned
will only have two dates: the start date and the end date. If it iterates over
more dates, which interval is use: hour, day, week or something else?

"For instance, passing Thursday, July 4, 2002 and a RANGE_MONTH_SUNDAY will
return an Iterator that starting with Sunday, June 30, 2002 iterates over every
day (at midnight) until with Saturday, August 3, 2002."

Also the Date version of the method does not say that the iterator returns
Calendar and not Date as I would have expected given the method signature.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r154031 - jakarta/commons/sandbox/i18n/trunk/project.xml

2005-02-16 Thread dflorey
Author: dflorey
Date: Wed Feb 16 07:22:16 2005
New Revision: 154031

URL: http://svn.apache.org/viewcvs?view=rev&rev=154031
Log:
Added Localized errors and exception + refactoring

Modified:
jakarta/commons/sandbox/i18n/trunk/project.xml

Modified: jakarta/commons/sandbox/i18n/trunk/project.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/project.xml?view=diff&r1=154030&r2=154031
==
--- jakarta/commons/sandbox/i18n/trunk/project.xml (original)
+++ jakarta/commons/sandbox/i18n/trunk/project.xml Wed Feb 16 07:22:16 2005
@@ -32,10 +32,14 @@
   Commons I18n
   Internationalization package
 
-  0.3
+  0.4
   

1
+   0.4
+   
+   
+   2
0.3

   
@@ -85,13 +89,18 @@
   
 **/*Test.java
   
-
+ 
+
+  ${basedir}/src/test
+
+  
+
+
+   
   
-${basedir}/src/test
+${basedir}/src/resources
   
 
-
-
   
 
   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [collections] Porting to JDK 1.5 and Generics

2005-02-16 Thread Mauro Franceschini
But this project is managed external developers or by Apache and only
hosted on sourceforge?


On Wed, 16 Feb 2005 15:12:35 + (GMT), Stephen Colebourne
<[EMAIL PROTECTED]> wrote:
> See http://sourceforge.net/projects/collections15/ for
> one attempt. I believe that it should be hosted at
> Jakarta-Commons, but I lack the time to manage this.
> 
> Maybe another Apache committer has the time?
> 
> Stephen
> 
>  --- Mauro Franceschini <[EMAIL PROTECTED]>
> wrote:
> > Hi to all!
> >
> > Any ideas about a port to Generics in JDK1.5 about
> > the Commons
> > Collections Framework?
> >
> > I'd like to help on it.
> >
> > Mauro
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r154028 - jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java

2005-02-16 Thread dflorey
Author: dflorey
Date: Wed Feb 16 07:15:00 2005
New Revision: 154028

URL: http://svn.apache.org/viewcvs?view=rev&rev=154028
Log:
Added Localized errors and exception + refactoring

Added:

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java

Added: 
jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java?view=auto&rev=154028
==
--- 
jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java
 (added)
+++ 
jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java
 Wed Feb 16 07:15:00 2005
@@ -0,0 +1,50 @@
+/*
+ * $Header: 
/home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons-sandbox//i18n/src/java/org/apache/commons/i18n/LocalizedException.java,v
 1.1 2004/10/04 13:41:09 dflorey Exp $
+ * $Revision: 1.1 $
+ * $Date: 2005-02-14 20:03:07 +0100 (Mo, 14 Feb 2005) $
+ *
+ * 
+ *
+ * Copyright 2004 The Apache Software Foundation 
+ *
+ * Licensed 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.i18n;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+
+import org.apache.commons.i18n.bundles.ErrorBundle;
+
+public class LocalizedError extends Error {
+private ErrorBundle errorMessage;
+
+public LocalizedError(ErrorBundle errorMessage, Throwable throwable) {
+super(errorMessage.getSummary(Locale.getDefault(), 
throwable.getMessage()), throwable);
+this.errorMessage = errorMessage;
+}
+
+public LocalizedError(ErrorBundle errorMessage) {
+super(errorMessage.getSummary(
+Locale.getDefault(), 
+MessageFormat.format(
+
MessageManager.INTERNAL_MESSAGES.getString(MessageManager.MESSAGE_ENTRY_NOT_FOUND),
+new String[] { errorMessage.getId(), 
ErrorBundle.SUMMARY }))); 
+this.errorMessage = errorMessage;
+}
+
+public ErrorBundle getErrorMessage() {
+return errorMessage;
+}
+}
\ No newline at end of file



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r154027 - in jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n: ./ bundles/

2005-02-16 Thread dflorey
Author: dflorey
Date: Wed Feb 16 07:14:17 2005
New Revision: 154027

URL: http://svn.apache.org/viewcvs?view=rev&rev=154027
Log: (empty)


Added:

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedRuntimeException.java
jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/ErrorBundle.java

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/MessageBundle.java

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/bundles/TextBundle.java
Removed:

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedError.java

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedMessage.java

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedText.java
Modified:

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/MessageManager.java

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/ResourceBundleMessageProvider.java

jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/XMLMessageProvider.java

Modified: 
jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java?view=diff&r1=154026&r2=154027
==
--- 
jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java
 (original)
+++ 
jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedException.java
 Wed Feb 16 07:14:17 2005
@@ -22,22 +22,29 @@
  */
 package org.apache.commons.i18n;
 
+import java.text.MessageFormat;
 import java.util.Locale;
 
+import org.apache.commons.i18n.bundles.ErrorBundle;
+
 public class LocalizedException extends Exception {
-private LocalizedError errorMessage;
+private ErrorBundle errorMessage;
 
-public LocalizedException(LocalizedError errorMessage, Throwable 
throwable) {
+public LocalizedException(ErrorBundle errorMessage, Throwable throwable) {
 super(errorMessage.getSummary(Locale.getDefault(), 
throwable.getMessage()), throwable);
 this.errorMessage = errorMessage;
 }
 
-public LocalizedException(LocalizedError errorMessage) {
-super(errorMessage.getSummary(Locale.getDefault(), "no message 
available"));
+public LocalizedException(ErrorBundle errorMessage) {
+super(errorMessage.getSummary(
+Locale.getDefault(), 
+MessageFormat.format(
+
MessageManager.INTERNAL_MESSAGES.getString(MessageManager.MESSAGE_ENTRY_NOT_FOUND),
+new String[] { errorMessage.getId(), 
ErrorBundle.SUMMARY }))); 
 this.errorMessage = errorMessage;
 }
 
-public LocalizedError getErrorMessage() {
+public ErrorBundle getErrorMessage() {
 return errorMessage;
 }
 }

Added: 
jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedRuntimeException.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedRuntimeException.java?view=auto&rev=154027
==
--- 
jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedRuntimeException.java
 (added)
+++ 
jakarta/commons/sandbox/i18n/trunk/src/java/org/apache/commons/i18n/LocalizedRuntimeException.java
 Wed Feb 16 07:14:17 2005
@@ -0,0 +1,50 @@
+/*
+ * $Header: 
/home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons-sandbox//i18n/src/java/org/apache/commons/i18n/LocalizedException.java,v
 1.1 2004/10/04 13:41:09 dflorey Exp $
+ * $Revision: 1.1 $
+ * $Date: 2005-02-14 20:03:07 +0100 (Mo, 14 Feb 2005) $
+ *
+ * 
+ *
+ * Copyright 2004 The Apache Software Foundation 
+ *
+ * Licensed 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.i18n;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+
+import org.apache.commons.i18n.bundles.ErrorBundle;
+
+public class Localiz

Re: [collections] Porting to JDK 1.5 and Generics

2005-02-16 Thread Stephen Colebourne
See http://sourceforge.net/projects/collections15/ for
one attempt. I believe that it should be hosted at
Jakarta-Commons, but I lack the time to manage this.

Maybe another Apache committer has the time?

Stephen

 --- Mauro Franceschini <[EMAIL PROTECTED]>
wrote: 
> Hi to all!
> 
> Any ideas about a port to Generics in JDK1.5 about
> the Commons
> Collections Framework?
> 
> I'd like to help on it.
> 
> Mauro
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Fwd: [chain] LookupCommand's return value

2005-02-16 Thread Joe Germuska
 > Basically, the JEXL dependency would only be a runtime dependency for
 people who chose to use those implementations of commands which
 depended upon it.  We could have a subproject for "contrib" or
 something, but my feeling is that that's more trouble than its worth.
 If the binary JAR for commons-chain is readily available and the API
 has no dependencies, then why not include useful implementations in
 the same JAR with clear instructions on when they require auxiliary
 libraries?  Still, if people would prefer a commons-chain-contrib
 project, I wouldn't complain; I'd just want some opinions on where
 exactly to put it.
I think the contrib thing would be overkill.  I agree with you there.
Remind me again of why your use case requires expressions?  Wouldn't
the ignoreReturn value attribute allow you to prevent the termination
of the larger chain that the LookupCommand is contained in?
I blurred two things together; if one assumed (as I did) that 
LookupCommand always returned false, then it seemed reasonable that 
you might want to have a flexible way of aborting a chain which was 
looked up.  Writing a hard-coded class which simply tests the state 
of the Context seemed less than elegant.

I have also earlier envisioned a variant of the LookupCommand which 
was more dynamic in its lookup because rather than having a command 
name hard-coded, it could use an expression to retrieve the command 
name from the Context.  You can do this to some exent using the 
"nameKey" property and the CopyCommand, but I think it would be more 
flexible and more elegant with expressions.  A specific use case I 
had thought of for this before was the idea that you might, in 
Struts, define an entire catalog of commands whose names were 
potential values for ActionForward.getPath().  You could then use a 
lookup command to automatically invoke a command in that catalog if 
one matched the path.  You couldn't get this without a custom 
command, because Copy can only copy an object in the Context, not a 
property of an object in the Context.

Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: jcl blog post

2005-02-16 Thread Vic
Yeah, thanks. I don't have many commands, they just get called over and 
over.
It just make sense that statics stay.
.V
Craig McClanahan wrote:

By the way ... if you use [chain] you should *really* pay attention to
the Javadocs for CatalogFactory.clear() ;-)
Craig
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


svn commit: r154025 - jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/util/ValidatorUtils.java

2005-02-16 Thread dgraham
Author: dgraham
Date: Wed Feb 16 06:50:57 2005
New Revision: 154025

URL: http://svn.apache.org/viewcvs?view=rev&rev=154025
Log:
Add ValidatorUtils class back after Subclipse somehow deleted it.
This includes a new copyMap() method to deprecate
FastHashMap usage.

Added:

jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/util/ValidatorUtils.java

Added: 
jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/util/ValidatorUtils.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/util/ValidatorUtils.java?view=auto&rev=154025
==
--- 
jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/util/ValidatorUtils.java
 (added)
+++ 
jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/util/ValidatorUtils.java
 Wed Feb 16 06:50:57 2005
@@ -0,0 +1,189 @@
+/*
+ * $Id: ValidatorUtils.java 153692 2005-02-14 01:33:31Z niallp $
+ * $Rev$
+ * $Date: 2005-02-13 18:33:31 -0700 (Sun, 13 Feb 2005) $
+ *
+ * 
+ * Copyright 2001-2005 The Apache Software Foundation
+ *
+ * Licensed 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.validator.util;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.collections.FastHashMap;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.validator.Arg;
+import org.apache.commons.validator.Msg;
+import org.apache.commons.validator.Var;
+
+/**
+ * Basic utility methods.
+ * 
+ * The use of FastHashMap is deprecated and will be replaced in a future
+ * release.
+ * 
+ */
+public class ValidatorUtils {
+
+private static final Log log = LogFactory.getLog(ValidatorUtils.class);
+
+/**
+ * Replace part of a String with another value.
+ *
+ * @param value String to perform the replacement on.
+ * @param key The name of the constant.
+ * @param replaceValue The value of the constant.
+ */
+public static String replace(String value, String key, String 
replaceValue) {
+
+if (value == null || key == null || replaceValue == null) {
+return value;
+}
+
+int pos = value.indexOf(key);
+
+if (pos < 0) {
+return value;
+}
+
+int length = value.length();
+int start = pos;
+int end = pos + key.length();
+
+if (length == key.length()) {
+value = replaceValue;
+
+} else if (end == length) {
+value = value.substring(0, start) + replaceValue;
+
+} else {
+value =
+value.substring(0, start)
++ replaceValue
++ replace(value.substring(end), key, replaceValue);
+}
+
+return value;
+}
+
+/**
+ * Convenience method for getting a value from a bean property as a
+ * String.  If the property is a String[] or
+ * Collection and it is empty, an empty String
+ * "" is returned.  Otherwise, property.toString() is returned.  This 
method
+ * may return null if there was an error retrieving the
+ * property.
+ */
+public static String getValueAsString(Object bean, String property) {
+Object value = null;
+
+try {
+value = PropertyUtils.getProperty(bean, property);
+
+} catch(IllegalAccessException e) {
+log.error(e.getMessage(), e);
+} catch(InvocationTargetException e) {
+log.error(e.getMessage(), e);
+} catch(NoSuchMethodException e) {
+log.error(e.getMessage(), e);
+}
+
+if (value == null) {
+return null;
+}
+
+if (value instanceof String[]) {
+return ((String[]) value).length > 0 ? value.toString() : "";
+
+} else if (value instanceof Collection) {
+return ((Collection) value).isEmpty() ? "" : value.toString();
+
+} else {
+return value.toString();
+}
+
+}
+
+/**
+ * Makes a deep copy of a FastHashMap if the values
+ * are Msg, Arg,
+ * or V

svn commit: r154021 - in jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator: Field.java Form.java ValidatorResources.java util/ValidatorUtils.java

2005-02-16 Thread dgraham
Author: dgraham
Date: Wed Feb 16 06:38:37 2005
New Revision: 154021

URL: http://svn.apache.org/viewcvs?view=rev&rev=154021
Log:
Deprecated all FastHashMap usage and provided protected 
get methods that return generic Maps to be used by subclasses.

Removed:

jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/util/ValidatorUtils.java
Modified:

jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/Field.java

jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/Form.java

jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/ValidatorResources.java

Modified: 
jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/Field.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/Field.java?view=diff&r1=154020&r2=154021
==
--- 
jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/Field.java
 (original)
+++ 
jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/Field.java
 Wed Feb 16 06:38:37 2005
@@ -41,10 +41,10 @@
  * message information and variables to perform the validations and generate 
  * error messages.  Instances of this class are configured with a 
  *  xml element.
- *
+ * 
  * The use of FastHashMap is deprecated and will be replaced in a future
  * release.
- *
+ * 
  * @see org.apache.commons.validator.Form
  */
 public class Field implements Cloneable, Serializable {
@@ -87,8 +87,14 @@
  */
 private List dependencyList = Collections.synchronizedList(new 
ArrayList());
 
+/**
+ * @deprecated Subclasses should use getVarMap() instead. 
+ */
 protected FastHashMap hVars = new FastHashMap();
-
+
+/**
+ * @deprecated Subclasses should use getMsgMap() instead.
+ */
 protected FastHashMap hMsgs = new FastHashMap();
 
 /**
@@ -223,7 +229,7 @@
  * @since Validator 1.1.4
  */
 public Msg getMessage(String key) {
-return (Msg)hMsgs.get(key);
+return (Msg) hMsgs.get(key);
 }
 
 /**
@@ -246,8 +252,7 @@
 }
 
 determineArgPosition(arg);
-
-this.ensureArgsCapacity(arg);
+ensureArgsCapacity(arg);
 
 Map argMap = this.args[arg.getPosition()];
 if (argMap == null) {
@@ -796,11 +801,24 @@
  * @throws ValidatorException
  */
 private void handleMissingAction(String name) throws ValidatorException {
-throw new ValidatorException(
-"No ValidatorAction named "
-+ name
-+ " found for field "
-+ this.getProperty());
+throw new ValidatorException("No ValidatorAction named " + name
++ " found for field " + this.getProperty());
+}
+
+/**
+ * Returns a Map of String Msg names to Msg objects.
+ * @since Validator 1.2.0
+ */
+protected Map getMsgMap() {
+return hMsgs;
+}
+
+/**
+ * Returns a Map of String Var names to Var objects.
+ * @since Validator 1.2.0
+ */
+protected Map getVarMap() {
+return hVars;
 }
 
 }

Modified: 
jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/Form.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/Form.java?view=diff&r1=154020&r2=154021
==
--- 
jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/Form.java
 (original)
+++ 
jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/Form.java
 Wed Feb 16 06:38:37 2005
@@ -44,8 +44,7 @@
 public class Form implements Serializable {
 
 /**
- * The name/key the set of validation rules is
- * stored under.
+ * The name/key the set of validation rules is stored under.
  */
 protected String name = null;
 
@@ -59,6 +58,7 @@
 
 /**
  * Map of Fields keyed on their property value.
+ * @deprecated Subclasses should use getFieldMap() instead.
  */
 protected FastHashMap hFields = new FastHashMap();
 
@@ -228,8 +228,8 @@
  * Sets the name/key of the parent set of validation rules.
  * @since Validator 1.2.0
  */
-public void setExtends(String string) {
-inherit = string;
+public void setExtends(String inherit) {
+this.inherit = inherit;
 }
 
 /**
@@ -238,5 +238,13 @@
  */
 public boolean isExtending() {
 return inherit != null;
+}
+
+/**
+ * Returns a Map of String field keys to Field objects.
+ * @since Validator 1.2.0
+ */
+protected Map getFieldMap() {
+return hFields;
 }
 }

Modified: 
jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/ValidatorResource

Fwd: [chain] LookupCommand's return value

2005-02-16 Thread Sean Schofield
-- Forwarded message --
From: Sean Schofield <[EMAIL PROTECTED]>
Date: Wed, 16 Feb 2005 09:28:55 -0500
Subject: Re: [chain] LookupCommand's return value
To: Joe Germuska <[EMAIL PROTECTED]>


> Not changing as in breaking, but perhaps extending.  What about a
> property "ignoreReturnValue" which would always return "false"
> instead of returning what the looked up command sought.

That's what I figured you meant.  I have no objection to adding
another property like this.

> Well, I have zero interest in developing any other expression parser,
> so from there, I think you're limited to very crude things, like a
> bunch of properties on a command that would specify context keys and
> imply handling, like 'abortIfContextValueTrueOrNull'

I will go one further. I have *less than zero* interest in developing
another expression parser.  ;-)

> Basically, the JEXL dependency would only be a runtime dependency for
> people who chose to use those implementations of commands which
> depended upon it.  We could have a subproject for "contrib" or
> something, but my feeling is that that's more trouble than its worth.
> If the binary JAR for commons-chain is readily available and the API
> has no dependencies, then why not include useful implementations in
> the same JAR with clear instructions on when they require auxiliary
> libraries?  Still, if people would prefer a commons-chain-contrib
> project, I wouldn't complain; I'd just want some opinions on where
> exactly to put it.

I think the contrib thing would be overkill.  I agree with you there.
Remind me again of why your use case requires expressions?  Wouldn't
the ignoreReturn value attribute allow you to prevent the termination
of the larger chain that the LookupCommand is contained in?

> Joe

sean

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [chain] LookupCommand's return value

2005-02-16 Thread Joe Germuska
At 8:08 AM -0500 2/16/05, Sean Schofield wrote:
 > As it is now, there's no way to abort a looked-up chain without
 causing the base chain to also abort.  It seems like this would not
 always be the desired result.  [snip]
Interesting way of thinking about it.  I still think the way
LookupCommand works now should be the default behavior.
-1 on changing that (which I don't think you are really proposing)

Not changing as in breaking, but perhaps extending.  What about a 
property "ignoreReturnValue" which would always return "false" 
instead of returning what the looked up command sought.

[snip}
 I'm just hesitant to add a new dependency on my own whim.  JEXL isn't
 very heavy (132 K) but I think people are keen on keeping Chain light
 too.
Keeping chain light would be nice.  I don't know too much about JEXL
personally although I will be investigating it shortly as an
alternative to Velocity for some template stuff I have.  How would you
propose doing it if you didn't use JEXL?
Well, I have zero interest in developing any other expression parser, 
so from there, I think you're limited to very crude things, like a 
bunch of properties on a command that would specify context keys and 
imply handling, like 'abortIfContextValueTrueOrNull'

Basically, the JEXL dependency would only be a runtime dependency for 
people who chose to use those implementations of commands which 
depended upon it.  We could have a subproject for "contrib" or 
something, but my feeling is that that's more trouble than its worth. 
If the binary JAR for commons-chain is readily available and the API 
has no dependencies, then why not include useful implementations in 
the same JAR with clear instructions on when they require auxiliary 
libraries?  Still, if people would prefer a commons-chain-contrib 
project, I wouldn't complain; I'd just want some opinions on where 
exactly to put it.

Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [chain] LookupCommand's return value

2005-02-16 Thread Sean Schofield
> As it is now, there's no way to abort a looked-up chain without
> causing the base chain to also abort.  It seems like this would not
> always be the desired result.  [snip]

Interesting way of thinking about it.  I still think the way
LookupCommand works now should be the default behavior.

-1 on changing that (which I don't think you are really proposing)

> I'm sure one could reorganize the overall config so that the first
> chain ended without being aborted, and then the commands which would
> have come after are instead on a separate chain behind a conditional
> Lookup command.  This isn't that hard to do, but I'm still not sure
> that I believe the class as implemented should *always* return the
> value of the looked up command.  Could we make a config value out of
> it?

Right now I am indifferent but as soon as I encounter a similar use
case in my own programming I am sure I will be +1 ;-)
 
[snip}
> I'm just hesitant to add a new dependency on my own whim.  JEXL isn't
> very heavy (132 K) but I think people are keen on keeping Chain light
> too.

Keeping chain light would be nice.  I don't know too much about JEXL
personally although I will be investigating it shortly as an
alternative to Velocity for some template stuff I have.  How would you
propose doing it if you didn't use JEXL?
 
> Joe

sean

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[collections] Porting to JDK 1.5 and Generics

2005-02-16 Thread Mauro Franceschini
Hi to all!

Any ideas about a port to Generics in JDK1.5 about the Commons
Collections Framework?

I'd like to help on it.

Mauro

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AW: [i18n] man available

2005-02-16 Thread Daniel Florey
Hi Woody,
Thanks for your help! See comments inline...

Daniel

> -Ursprüngliche Nachricht-
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Im Auftrag von Anaximandro (Woody)
> Gesendet: Mittwoch, 16. Februar 2005 11:17
> An: Jakarta Commons Developers List
> Betreff: Re: [i18n] man available
> 
> Hello Daniel,
> 
> Yup, the ConfigManager not prove to be very usefull. This class is
> increasing the coupling level to give me a few features set (the con
> figuration features itself) and gave me much more code to delegate ...
> 
> But you don't think necessary some code to configure the behaviours of
> this component? For instance: in your version when the component not
> find one message id they throw one unchecked exception. The component
> dont't force me to write one try catch block for each LocalizedEntry but
> force me to write all messages ids in their respective resource to avoid
> one exception. Avoid try catch blocks is cool, very cool, but this only
> make my code more clean, however the cost to do this is high: I must write
> the messages id (at least) to don't break the application, but if I forget
> one id the application will break in same mode.

I'll add some examples to the website that show how to deal with missing
messages, ok?

> 
> Using some code to configure this helps in this situation. I can talk to
> component: hey pal, use the message id or entry id as default when you not
> find someone. Don't throw an exception, instead, write this in log. I
> will write these messages later ok?

I try to avoid including logging into the i18n component as there are so
many different loggers around. I just removed the commons-xmlio dependencies
by using sax-parsing instead, so my goal is to achieve a component with no
dependencies.
If we need logging, I'd vote for standard jdk 1.4-logging. What do you
think?

> 
> Hence I think is better to leave this decision to the user component. I
> know you wanna a small and easy to use component, I want the same think,
> but ... I think is more easy to use a componente wich can be configured
> than one wich we can't do this.
> 
> Sorry if I'm talking to much, I really wanna help but my english make this
> more hard than really is.
> 
> Only one MessageManager? no getInstance? As I see the problem exists
> when many threads (with different Locales) try to get a message. I don't
> see any problem with diferent applications (sure, the unique ID is requi
> red). If you use only one MessageManager you will need to always provide
> the desired Locale (in constructor or in getXXX method) because there is
> no more a place to store a default Locale info since the older place
> (setLocale/getLocale) will be shared by this threads. More than this,
> doing this will bestrew Locale info in resulting client code making this
> more hard to update. Well, this is just my opinion.

It is necessary to provide the desired locale in each getXXX method of the
LocalizedBundle-subclasses. I just removed the ones using the default locale
as this causes additional confusion. If you really want to specify a
thread-specific locale (??) then you need to store it in ThreadLocal.
I'll add a method to set the default locale in the MessageManager if it
should be something different than the VM default locale.


> 
> I try to solve this writing the getInstance (as you suggest in email)
> but with this I create another problem: how to link a message with their
> respective manager? Passing this guy as parameter? nope, this is ugly. So
> writing some method to returns the current manager? Yes, make sense, then:
> getCurrentInstance, but, again, I created another problem: I need to write
> monitor code to lock unlock the instance to avoid data corruption (between
> threads). I think this is the last thing I need to close my version. I
> will
> do this (is a little hard to me because I never do this before).
> 
> I'm right im my point? I miss something?
> 
> Did you find some good idea in my code? If you do I can revise and
> generate
> the apropriate patch to you.

Yes, thanks. I'll add some LocalizedRuntimeException, LocalizedError etc.
and rename the LocalizedError to something more speaking.

> 
> Good luck with envinronment (to be honest I need to learn maven, I just
> used eclipse, always redoing the configuration when I need).

Maven is a nice tool, but very bad documented indeed. So it's hard to figure
out how to achieved the desired stuff...

> 
> Woody
> 
> >Hi Woody,
> >I'm currently trying to improve the maven environment, so that releases
> and
> >tests can easily be done.
> >My goal is to complete the component in the actual state in order to
> build
> a
> >usable release as soon as possible.
> >I've already had a look at your proposed changes. I'd like to include
> some
> >changes into the current version (LocalizedRuntimeException), but I'm not
> >sure with the ConfigManager. This one introduces a lot of complexity.
> >In order to keep the i18n-component very simpl

[GUMP@brutus]: Project commons-jelly-tags-ant (in module commons-jelly) failed

2005-02-16 Thread commons-jelly-tags-ant development
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 [EMAIL PROTECTED]

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


Full details are available at:

http://brutus.apache.org/gump/public/commons-jelly/commons-jelly-tags-ant/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Sole output [commons-jelly-tags-ant-16022005.jar] identifier set to 
project name
 -DEBUG- Dependency on ant exists, no need to add for property 
maven.jar.ant-optional.
 -DEBUG- Dependency on xml-xerces exists, no need to add for property 
maven.jar.xerces.
 -DEBUG- (Gump generated) Maven Properties in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/ant/build.properties
 -INFO- Failed with reason build failed
 -DEBUG- Maven POM in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/ant/project.xml
 -DEBUG- Maven project properties in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/ant/project.properties
 -INFO- Project Reports in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/ant/target/test-reports
 -INFO- Failed to extract fallback artifacts from Gump Repository



The following work was performed:
http://brutus.apache.org/gump/public/commons-jelly/commons-jelly-tags-ant/gump_work/build_commons-jelly_commons-jelly-tags-ant.html
Work Name: build_commons-jelly_commons-jelly-tags-ant (Type: Build)
Work ended in a state of : Failed
Elapsed: 11 secs
Command Line: maven --offline jar 
[Working Directory: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/ant]
CLASSPATH: 
/opt/jdk1.4/lib/tools.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-swing.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-trax.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-junit.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant.jar:/usr/local/gump/public/workspace/jakarta-commons/beanutils/dist/commons-beanutils-core.jar:/usr/local/gump/public/workspace/dist/junit/junit.jar:/usr/local/gump/public/workspace/xml-commons/java/build/resolver.jar:/usr/local/gump/public/workspace/ant/bootstrap/lib/ant-launcher.jar:/usr/local/gump/public/workspace/ant/bootstrap/lib/ant.jar:/usr/local/gump/public/workspace/jakarta-commons/cli/target/commons-cli-16022005.jar:/usr/local/gump/public/workspace/jakarta-commons/collections/build/commons-collections-16022005.jar:/usr/local/gump/public/workspace/jakarta-commons-sandbox/grant/target/commons-grant-16022005.jar:/usr/local/gump/public/workspace/commons-jelly/target/commons-jelly-16022005.jar:/usr/local/gump/public/workspace/commons-jelly/jelly-tags/junit/target/commons-jelly-tags-junit-16022005.jar:/usr/local/gump/public/workspace/commons-jelly/jelly-tags/util/target/commons-jelly-tags-util-16022005.jar:/usr/local/gump/public/workspace/jakarta-commons/jexl/dist/commons-jexl-16022005.jar:/usr/local/gump/public/workspace/jakarta-commons/logging/dist/commons-logging.jar:/usr/local/gump/public/workspace/jakarta-commons/logging/dist/commons-logging-api.jar:/usr/local/gump/public/workspace/dom4j/build/dom4j.jar:/usr/local/gump/public/workspace/jaxen/target/jaxen-16022005.jar
-
java:prepare-filesystem:
[mkdir] Created dir: 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/ant/target/classes

java:compile:
[echo] Compiling to 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/ant/target/classes
[echo] 
==

  NOTE: Targetting JVM 1.4, classes
  will not run on earlier JVMs

==
  
[javac] Compiling 10 source files to 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/ant/target/classes
[javac] 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/ant/src/java/org/apache/commons/jelly/tags/ant/AntTag.java:385:
 warning: 
createElement(org.apache.tools.ant.Project,java.lang.Object,java.lang.String) 
in org.apache.tools.ant.IntrospectionHelper has been deprecated
[javac] dataType = ih.createElement( getAntProject(), 
object, name.toLowerCase() );
[javac] 

Re: jcl blog post

2005-02-16 Thread Remy Maucherat
On Tue, 15 Feb 2005 21:02:28 -0800, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> On Tue, 15 Feb 2005 22:50:51 -0600, Vic <[EMAIL PROTECTED]> wrote:
> > oops :-[
> > Wrong link, this is it:
> > http://www.szegedi.org/articles/memleak.html
> >
> > It talks about Commons logging, since i'ts open season.
> > .V
> 
> There's lots of ways to shoot yourself in the foot the same way ...
> you don't need JCL to do that ... pretty much any implementation of
> the factory design pattern should be looked at with suspicion.
> 
> By the way ... if you use [chain] you should *really* pay attention to
> the Javadocs for CatalogFactory.clear() ;-)

I like this one too, which is very similar (and of course,
undocumented - the javadocs make you think the method which has to be
called to resolved the leak is useless; the issue is also very hard to
diagnose, as for some reason profilers will not "see" references kept
by this cache):
http://issues.apache.org/bugzilla/show_bug.cgi?id=26135#c6

If I was still working in Santa Clara, the J2SE folks would have heard
I wasn't happy about their "cool" feature ;)

-- 
x
Rémy Maucherat
Developer & Consultant
JBoss Group (Europe) SàRL
x

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[GUMP@brutus]: Project commons-jelly-tags-xml (in module commons-jelly) failed

2005-02-16 Thread commons-jelly-tags-xml development
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 [EMAIL PROTECTED]

Project commons-jelly-tags-xml has an issue affecting its community integration.
This issue affects 12 projects,
 and has been outstanding for 7 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- commons-jelly-tags-define :  Commons Jelly
- commons-jelly-tags-html :  Commons Jelly
- commons-jelly-tags-http :  Commons Jelly
- commons-jelly-tags-jaxme :  Commons Jelly
- commons-jelly-tags-jetty :  Commons Jelly
- commons-jelly-tags-jface :  Commons Jelly
- commons-jelly-tags-jsl :  Commons Jelly
- commons-jelly-tags-swing :  Commons Jelly
- commons-jelly-tags-xml :  Commons Jelly
- commons-jelly-tags-xmlunit :  Commons Jelly
- maven :  Project Management Tools
- maven-bootstrap :  Project Management Tools


Full details are available at:

http://brutus.apache.org/gump/public/commons-jelly/commons-jelly-tags-xml/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Sole output [commons-jelly-tags-xml-16022005.jar] identifier set to 
project name
 -DEBUG- Dependency on xml-xerces exists, no need to add for property 
maven.jar.xerces.
 -DEBUG- (Gump generated) Maven Properties in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/xml/build.properties
 -INFO- Failed with reason build failed
 -DEBUG- Maven POM in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/xml/project.xml
 -DEBUG- Maven project properties in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/xml/project.properties
 -INFO- Project Reports in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/xml/target/test-reports
 -DEBUG- Extracted fallback artifacts from Gump Repository



The following work was performed:
http://brutus.apache.org/gump/public/commons-jelly/commons-jelly-tags-xml/gump_work/build_commons-jelly_commons-jelly-tags-xml.html
Work Name: build_commons-jelly_commons-jelly-tags-xml (Type: Build)
Work ended in a state of : Failed
Elapsed: 13 secs
Command Line: maven --offline jar 
[Working Directory: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/xml]
CLASSPATH: 
/opt/jdk1.4/lib/tools.jar:/usr/local/gump/public/workspace/jakarta-commons/beanutils/dist/commons-beanutils-core.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-swing.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-trax.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-junit.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant.jar:/usr/local/gump/public/workspace/dist/junit/junit.jar:/usr/local/gump/public/workspace/xml-commons/java/build/resolver.jar:/usr/local/gump/public/workspace/ant/bootstrap/lib/ant-launcher.jar:/usr/local/gump/public/workspace/ant/bootstrap/lib/ant.jar:/usr/local/gump/public/workspace/jakarta-commons/collections/build/commons-collections-16022005.jar:/usr/local/gump/public/workspace/commons-jelly/target/commons-jelly-16022005.jar:/usr/local/gump/public/workspace/commons-jelly/jelly-tags/junit/target/commons-jelly-tags-junit-16022005.jar:/usr/local/gump/public/workspace/jakarta-commons/jexl/dist/commons-jexl-16022005.jar:/usr/local/gump/public/workspace/jakarta-commons/logging/dist/commons-logging.jar:/usr/local/gump/public/workspace/jakarta-commons/logging/dist/commons-logging-api.jar:/usr/local/gump/public/workspace/dom4j/build/dom4j.jar:/usr/local/gump/public/workspace/jaxen/target/jaxen-16022005.jar
-
[mkdir] Created dir: 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/xml/target/classes

java:compile:
[echo] Compiling to 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/xml/target/classes
[echo] 
==

  NOTE: Targetting JVM 1.4, classes
  will not run on earlier JVMs

==
  
[javac] Compiling 16 source files to 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/xml/target/classes

java:jar-resources:

test:prepare-filesystem:
[mkdir] Created dir: 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/xml/target/test-classes
[mkdir] Created dir: 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/xml/target/test-reports

test:test-resources:
Copying 36 files to 
/home/gump/workspaces2/public/workspace/commons-jelly/jell

[jira] Created: (JELLY-202) PatternSet's toString gives NPE

2005-02-16 Thread Paul Libbrecht (JIRA)
PatternSet's toString gives NPE
---

 Key: JELLY-202
 URL: http://issues.apache.org/jira/browse/JELLY-202
 Project: jelly
Type: Bug
  Components: taglib.ant  
Versions: 1.0
Reporter: Paul Libbrecht


When the logging-level is set to Debug and 
org.apache.commons.jelly.tags.ant.AntTag is setting properties (actually, 
before setting the properties) on the ant-tag, the following is attempted:
log.debug( "Setting bean property on: "+  object + " name: " + name + " value: 
" + value );
which fails with a null-pointer for the following reason which I partially 
share:
The toString of object is invoked and, if this one is a 
org.apache.tools.ant.types.PatternSet (or its inner class), it throws because 
the name is not set yet. It's not set yet because it's going to be set !

I considered this as a bug, to me, toString() should never throw.
Jelly-Ant's ant version is a bit old so I hoped a later version of Ant fixes 
this. By no means!
In todays snapshot, one can see the following:
if (name == null) {
throw new BuildException(
"Missing attribute \"name\" for a pattern");
}

I'd propose, thus, to remove the object from the debug line above until we 
manage to convince anters and we upgrade.
  log.debug( "Setting bean property on name: " + name + " value: " + value );

paul

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[GUMP@brutus]: Project commons-id (in module jakarta-commons-sandbox) failed

2005-02-16 Thread Adam Jack
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 [EMAIL PROTECTED]

Project commons-id has an issue affecting its community integration.
This issue affects 1 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-id :  Commons Identifier Package


Full details are available at:

http://brutus.apache.org/gump/public/jakarta-commons-sandbox/commons-id/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Sole output [commons-id-16022005.jar] identifier set to project name
 -DEBUG- (Gump generated) Maven Properties in: 
/usr/local/gump/public/workspace/jakarta-commons-sandbox/id/build.properties
 -INFO- Failed with reason build failed
 -DEBUG- Maven POM in: 
/usr/local/gump/public/workspace/jakarta-commons-sandbox/id/project.xml
 -DEBUG- Maven project properties in: 
/usr/local/gump/public/workspace/jakarta-commons-sandbox/id/project.properties
 -INFO- Failed to extract fallback artifacts from Gump Repository



The following work was performed:
http://brutus.apache.org/gump/public/jakarta-commons-sandbox/commons-id/gump_work/build_jakarta-commons-sandbox_commons-id.html
Work Name: build_jakarta-commons-sandbox_commons-id (Type: Build)
Work ended in a state of : Failed
Elapsed: 1 sec
Command Line: maven --offline jar 
[Working Directory: /usr/local/gump/public/workspace/jakarta-commons-sandbox/id]
CLASSPATH: 
/opt/jdk1.4/lib/tools.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-swing.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-trax.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-junit.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant.jar:/usr/local/gump/public/workspace/jakarta-commons/discovery/dist/commons-discovery.jar:/usr/local/gump/public/workspace/dist/junit/junit.jar:/usr/local/gump/public/workspace/xml-commons/java/build/resolver.jar:/usr/local/gump/public/workspace/ant/bootstrap/lib/ant-launcher.jar:/usr/local/gump/public/workspace/ant/bootstrap/lib/ant.jar:/usr/local/gump/public/workspace/jakarta-commons/logging/dist/commons-logging.jar:/usr/local/gump/public/workspace/jakarta-commons/logging/dist/commons-logging-api.jar
-
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2

org.apache.maven.MavenException: Error reading XML or initializing
at org.apache.maven.MavenUtils.getProject(MavenUtils.java:156)
at org.apache.maven.MavenUtils.getProject(MavenUtils.java:122)
at 
org.apache.maven.MavenSession.initializeRootProject(MavenSession.java:232)
at org.apache.maven.MavenSession.initialize(MavenSession.java:172)
at org.apache.maven.cli.App.doMain(App.java:475)
at org.apache.maven.cli.App.main(App.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)
--- Nested Exception ---
java.io.FileNotFoundException: Parent POM not found: 
/home/gump/workspaces2/public/workspace/jakarta-commons-sandbox/sandbox-build/project.xml
at org.apache.maven.MavenUtils.getNonJellyProject(MavenUtils.java:230)
at org.apache.maven.MavenUtils.getProject(MavenUtils.java:143)
at org.apache.maven.MavenUtils.getProject(MavenUtils.java:122)
at 
org.apache.maven.MavenSession.initializeRootProject(MavenSession.java:232)
at org.apache.maven.MavenSession.initialize(MavenSession.java:172)
at org.apache.maven.cli.App.doMain(App.java:475)
at org.apache.maven.cli.App.main(App.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)

You have encountered an unknown error ru

[betwixt] Patch for ID storing strategy

2005-02-16 Thread Christian Aust
Hi,
the following is a patch against current CVS 
jakarta-commons/betwixt/src/java that implements a pluggable strategy 
for storing already processed bean ID values. The default implementation 
provided works exactly like it did before, but it allows me to override 
this behaviour.

The idea is that (while serializing certain object trees that have a lot 
of dependencies) not every instance that is referenced needs to show up 
in the resulting XML. This depends on the use you make of it: XML 
fragments designed to transfer individual pieces of information can be 
significantly smaller than those needed to fully recreate a complex 
object tree.

I'd be happy to commit this to the standard code base. Kind regards,
-  Christian
--
Christian Aust
mailto:[EMAIL PROTECTED]
icq: 84500990 - Yahoo!: datenimperator - MSN: datenimperator
PGP: A94E 0181 664D 27E3 F05A  A751 6A7E 90D1 A0A3 DEC7
Index: org/apache/commons/betwixt/BindingConfiguration.java
===
RCS file: 
/home/cvspublic/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/BindingConfiguration.java,v
retrieving revision 1.9
diff -u -r1.9 BindingConfiguration.java
--- org/apache/commons/betwixt/BindingConfiguration.java23 Aug 2004 
19:35:29 -  1.9
+++ org/apache/commons/betwixt/BindingConfiguration.java16 Feb 2005 
09:30:37 -
@@ -18,6 +18,7 @@
 import java.io.Serializable;
 
 import org.apache.commons.betwixt.strategy.DefaultObjectStringConverter;
+import org.apache.commons.betwixt.strategy.IdStoringStrategy;
 import org.apache.commons.betwixt.strategy.ObjectStringConverter;
 import org.apache.commons.betwixt.strategy.ValueSuppressionStrategy;
 
@@ -48,6 +49,8 @@
 private String classNameAttribute = "className";
 /** Strategy for suppressing attributes with certain values when writing */
 private ValueSuppressionStrategy valueSuppressionStrategy  = 
ValueSuppressionStrategy.DEFAULT;
+/** Strategy for storing and accessing ID values */
+private IdStoringStrategy idStoringStrategy = IdStoringStrategy.DEFAULT;
 
 /**
  * Constructs a BindingConfiguration with default properties.
@@ -148,4 +151,18 @@
 ValueSuppressionStrategy valueSuppressionStrategy) {
 this.valueSuppressionStrategy = valueSuppressionStrategy;
 }
+
+   /**
+* @return Returns the idStoringStrategy.
+*/
+   public IdStoringStrategy getIdMappingStrategy() {
+   return idStoringStrategy;
+   }
+   
+   /**
+* @param idStoringStrategy The idStoringStrategy to set.
+*/
+   public void setIdMappingStrategy(IdStoringStrategy idMappingStrategy) {
+   this.idStoringStrategy = idMappingStrategy;
+   }
 }
Index: org/apache/commons/betwixt/io/AbstractBeanWriter.java
===
RCS file: 
/home/cvspublic/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/AbstractBeanWriter.java,v
retrieving revision 1.34
diff -u -r1.34 AbstractBeanWriter.java
--- org/apache/commons/betwixt/io/AbstractBeanWriter.java   9 Nov 2004 
16:15:54 -   1.34
+++ org/apache/commons/betwixt/io/AbstractBeanWriter.java   16 Feb 2005 
09:30:38 -
@@ -19,7 +19,6 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 
 import org.apache.commons.betwixt.AttributeDescriptor;
@@ -92,8 +91,6 @@
 
 /** Log used for logging (Doh!) */
 private Log log = LogFactory.getLog( AbstractBeanWriter.class );
-/** Map containing ID attribute values for beans */
-private HashMap idMap = new HashMap();
 /** Stack containing beans - used to detect cycles */
 private ArrayStack beanStack = new ArrayStack();
 /** Used to generate ID attribute values*/
@@ -345,7 +342,7 @@
 } else {
 pushBean ( context.getBean() );
 if ( getBindingConfiguration().getMapIDs() ) {
-ref = (String) idMap.get( context.getBean() );
+   ref = 
getBindingConfiguration().getIdMappingStrategy().getReferenceFor(context, 
context.getBean());
 }
 if ( ref == null ) {
 // this is the first time that this bean has be written
@@ -353,7 +350,7 @@
 if (idAttribute == null) {
 // use a generated id
 id = idGenerator.nextId();
-idMap.put( bean, id );
+
getBindingConfiguration().getIdMappingStrategy().setReference(context, bean, 
id);
 
 if ( getBindingConfiguration().getMapIDs() ) {
 // write element with id
@@ -396,7 +393,7 @@
 // convert to str

Re: jcl blog post

2005-02-16 Thread Kevin A. Burton
Shey Rab Pawo wrote:
Anyway... I called my newborn connection pool BDCP (basic database
connection pool).
Its about 1/5 the size of DBCP and a LOT easier to maintain.
   

I built my own connection pool for similar but less informed reasons. 
I found DBCP to be simply unworkable for some reason.  I may have been
at fault, but I normally do not have that much trouble with anything. 
I would be very interested in seeing your BDCP, if you are making that
public.

 

I was thinking about just putting it in the sandbox. I wanted to get my 
benchmark code public first though...

Kevin
--
Use Rojo (RSS/Atom aggregator).  Visit http://rojo.com. Ask me for an 
invite!  Also see irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html
If you're interested in RSS, Weblogs, Social Networking, etc... then you 
should work for Rojo!  If you recommend someone and we hire them you'll 
get a free iPod!
   
Kevin A. Burton, Location - San Francisco, CA
  AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412