dev@glassfish.java.net

Re: Activating my monitoring module

From: Jennifer Chou <jennifer.chou_at_oracle.com>
Date: Fri, 07 Jan 2011 21:57:55 -0500

On 1/7/2011 8:28 PM, Lee Chuk Munn wrote:
> 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.
>
The user will turn the monitoring OFF for your module using the config
settings in domain.xml. Set to HIGH or LOW to turn it on. To see the
current list of modules to monitor:
asadmin get configs.config.server-config.monitoring-service.*

The monitoring framework will take care of turning on/off the probe so
data collection will be stopped.

Some documentation:
http://wiki.glassfish.java.net/attach/V3FunctionalSpecs/Making_Module_Monitorable_V3.html

Jennifer
> 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
>>>>>>
>>>>>>