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.
-dain
On Tuesday, September 2, 2003, at 08:24 PM, Aaron Mulder wrote:
Thanks you again. Am I right that in order to extract the
"j2eeType" property from the String supplied by J2EEServer, we could do
something like this:
new ObjectName(name).getKeyProperty("j2eeType")
Thanks,
Aaron
On Wed, 3 Sep 2003, gianny DAMOUR wrote:
This is a possible implementation. However, J2EEServer.getResources
returns
an array of OBJECT_NAME/String identifying the available resources. A
name
contains a "j2eeType" property which can be used to infer the type of
the
Manageable Object.
For instance, the names returned by J2EEServer.getResources could be:
geronimo.j2ee.management:j2eeType=JDBCResource,name=Oracle,J2EEServer=
server
geronimo.j2ee.management:j2eeType=JMSResource,name=OpenJMS,J2EEServer=
server
By using the value of the j2eeType property, one knows that the first
one is
a JDBCResource and the second one is JMSResource.
/*************************
* Dain Sundstrom
* Partner
* Core Developers Network
*************************/