Hi,

> My guess it it is faster to use a (pre-compiled) regular 
> expression to  
> grab the chunk you are interested in out our the string 
> directly.  Last  
> I checked constructing an ObjectName was very expensive.

Yes, that used to be true.

With JMX 1.2 (and the current MX4J CVS) you can use 
ObjectName.getInstance("domain:key=value"), that creates the objectname once 
and then caches it.
MX4J does the same caching also using the plain constructor, but using the 
getInstance() is guaranteed to work with any implementation.

So, IMHO no need to use regexp.

Simon

Reply via email to