You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Bordet, Simone" <si...@hp.com> on 2003/09/03 10:22:23 UTC

RE: JMX Management Console (ObjectName hog)

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