users@glassfish.java.net

Re: tmueller wrote:Yes. See here

From: <forums_at_java.net>
Date: Sat, 9 Apr 2011 16:38:11 -0500 (CDT)

OK, I am probably not doing this correctly or a supported/future proof way,
but for the record I've managed to inject a ProbeProviderFactory into my
resource adapter class. Having spent a while debugging the connector code,
there is no support for injection (Maybe this should be a bug/feature request
as it seems they are the poor child of J2EE apps in this respect). I then
scoured  jndi looking for something and even spent time trying to use the
injectionmanager to inject a factory object manually without any luck.
Finally I came across code in the glassfish EJB runtime that does this:

 

ProbeProviderFactory
ppf=EjbContainerUtilImpl.getInstance().getProbeProviderFactory();
which works as expected and injects the factory from where I can register my
probes and suddenly everything springs to life. My events are captured, my
counts are incremented and I can read the values using the monitoring api.

 

If there is a better/cleaner way I'd love to hear about it. Thanks for the
suggestions/help along the way

 

John


--
[Message sent by forum member 'jsl123']
View Post: http://forums.java.net/node/781136