dev@glassfish.java.net

Re: Activating my monitoring module

From: Lee Chuk Munn <chuk-munn.lee_at_oracle.com>
Date: Sat, 08 Jan 2011 09:28:50 +0800

Hi

I have one more question, hopefully its the last

Assuming that I want to allow users to turn on/off the probe, how to I
programatically load a @Service. Current all the services I use are
@Inject into the object.

Also once I've gotten are reference to a service how to do terminate the
service so that my probe will stop collecting data.

Thanks

Regards

On 08/01/11 08:34, Jennifer Chou wrote:
> On 1/7/2011 7:05 PM, Lee Chuk Munn wrote:
> Thanks. What is the practice for other modules? Do they have a asadmin
> subcommand to load it or its always loaded?
>
>> I think the module should get loaded when needed, whether on startup or
>> upon deployment, etc.
> If the module is not loaded and when I fire the event, the event will
> not get published right? Are there any performance implications?
>
>> Correct, when you fire the event you're calling the no-op probe method -
>> the probe itself will not get fired.
>> No additonal performance implication if you have the values already to
>> pass to the no-op probe method.
> Thanks again for the quick reply
>
> Regards
> Chuk
>
> On 07/01/11 23:36, Tom Mueller wrote:
>
>>>> To have the service loaded, something else that is loaded needs to
>>>> reference it, or it needs to implement the org.glassfish.api.Startup
>>>> interface, or you can put the module into the modules/autostart directory.
>>>>
>>>> Tom
>>>>
>>>>
>>>> On 1/7/2011 8:56 AM, Lee Chuk Munn wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> I've written some probes and the ModuleBootstrap like so
>>>>>
>>>>> @Service(name="xmppcontainer-jmx")
>>>>> @Scoped(Singleton.class)
>>>>> public class XMPPContainerJMXimplements PostConstruct {
>>>>>
>>>>> public void postConstruct() {
>>>>> StatsProviderManager.register(...)
>>>>> }
>>>>>
>>>>> 1. How does this get loaded?
>>>>>
>>>>> 2. Do you only publish events when the listeners are loaded?
>>>>>
>>>>> Thanks
>>>>>
>
-- 
The generation of random numbers is too important to be left to chance.
	-- Robert R. Coveyou