Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2008 the original author or authors.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package groovy.jmx.builder;
The JmxEventListner class is used by the builder to listen to events on the event bus. It is used internally by JmxBuilder to handle attribute-change and operation-invoke events on the bean() node.

Vladimir Vivien
See also:
public class JmxEventListener implements NotificationListener {
    private static JmxEventListener listener;

Factory method that returns an instance of the listener.

- JmxEventListener instance.
    public static synchronized JmxEventListener getListner() {
        if ( == null) {
             = new JmxEventListener();
        return ;

This is the mplemented method for NotificationListener. It is called by an event emitter to dispatch JMX events to listeners. Here it handles internal JmxBuilder events.

notification the notification object passed to closure used to handle JmxBuilder events.
handback - In this case, the handback is the closure to execute when the event is handled.
    public void handleNotification(Notification notificationObject handback) {
        Map event = (Maphandback;
        if (event != null) {
            Object del = event.get("managedObject");
            Object callback = event.get("callback");
            if (callback != null && callback instanceof Closure) {
                Closure closure = (Closurecallback;
                if (closure.getMaximumNumberOfParameters() == 1)
    private static Map buildOperationNotificationPacket(Notification note) {
        Map<StringObjectresult = new HashMap<StringObject>();
        return result;
New to GrepCode? Check out our FAQ X