Package org.glassfish.admin.amx.util.jmx

Examples of org.glassfish.admin.amx.util.jmx.NotificationBuilder


    public void sendNotification(final Notification notification) {
        getNotificationEmitter().sendNotification(notification);
    }

    protected NotificationBuilder createNotificationBuilder(final String notificationType) {
        NotificationBuilder builder = null;

        if (notificationType.equals(AttributeChangeNotification.ATTRIBUTE_CHANGE)) {
            builder = new AttributeChangeNotificationBuilder(getObjectName());
        } else {
            builder = new NotificationBuilder(notificationType, getObjectName());
        }

        return (builder);
    }
View Full Code Here


    protected synchronized NotificationBuilder getNotificationBuilder(final String notificationType) {
        if (mNotificationBuilders == null) {
            mNotificationBuilders = new HashMap<String, NotificationBuilder>();
        }

        NotificationBuilder builder = mNotificationBuilders.get(notificationType);

        if (builder == null) {
            builder = createNotificationBuilder(notificationType);
            mNotificationBuilders.put(notificationType, builder);
        }
View Full Code Here

    protected void sendNotification(
            final String notificationType,
            final String message,
            final String key,
            final Serializable value) {
        final NotificationBuilder builder =
                getNotificationBuilder(notificationType);

        final Notification notif = builder.buildNew(message);
        NotificationBuilder.putMapData(notif, key, value);

        sendNotification(notif);
    }
View Full Code Here

        mNotificationTypeToNotificationBuilderMap.clear();
        for( final String notifType : ALL_LOG_RECORD_NOTIFICATION_TYPES )
        {
            mNotificationTypeToNotificationBuilderMap.put(
                notifType,
                new NotificationBuilder( notifType, objectName ) );
        }
    }
View Full Code Here

   
   
        private NotificationBuilder
    notificationTypeToNotificationBuilder( final String notificationType )
    {
        NotificationBuilder builder =
            mNotificationTypeToNotificationBuilderMap.get( notificationType );
           
        assert( builder != null );
       
        return builder;
View Full Code Here

                // don't construct a Notification if there are no listeners.
                if ( getLogLevelListenerCount( level ) != 0 )
                {
                    final String notifType  = logLevelToNotificationType( level );
                   
                    final NotificationBuilder   builder =
                        notificationTypeToNotificationBuilder( notifType );
                   
                    // Notification.getMessage() will be the formatted log record
                    final String    logRecordAsString    = formatter.format( logRecord );
                   
                    final Map<String,Serializable>  userData    =
                        logRecordToMap( logRecord, logRecordAsString );
                       
                    final Notification notif    =
                        builder.buildNewWithMap( logRecordAsString, userData);
                       
                    debug( "privateLoggingHook: sending: " + notif );
                    sendNotification( notif );
                }
                else
View Full Code Here

    private void initNotificationTypeToNotificationBuilderMap(final ObjectName objectName) {
        mNotificationTypeToNotificationBuilderMap.clear();
        for (final String notifType : ALL_LOG_RECORD_NOTIFICATION_TYPES) {
            mNotificationTypeToNotificationBuilderMap.put(
                    notifType,
                    new NotificationBuilder(notifType, objectName));
        }
    }
View Full Code Here

                    new NotificationBuilder(notifType, objectName));
        }
    }

    private NotificationBuilder notificationTypeToNotificationBuilder(final String notificationType) {
        NotificationBuilder builder =
                mNotificationTypeToNotificationBuilderMap.get(notificationType);

        assert (builder != null);

        return builder;
View Full Code Here

            try {
                // don't construct a Notification if there are no listeners.
                if (getLogLevelListenerCount(level) != 0) {
                    final String notifType = logLevelToNotificationType(level);

                    final NotificationBuilder builder =
                            notificationTypeToNotificationBuilder(notifType);

                    // Notification.getMessage() will be the formatted log record
                    final String logRecordAsString = formatter.format(logRecord);

                    final Map<String, Serializable> userData =
                            logRecordToMap(logRecord, logRecordAsString);

                    final Notification notif =
                            builder.buildNewWithMap(logRecordAsString, userData);

                    debug("privateLoggingHook: sending: " + notif);
                    sendNotification(notif);
                } else {
                    // debug( "privateLogHook: no listeners for level " + level );
View Full Code Here

    public void sendNotification(final Notification notification) {
        getNotificationEmitter().sendNotification(notification);
    }

    protected NotificationBuilder createNotificationBuilder(final String notificationType) {
        NotificationBuilder builder = null;

        if (notificationType.equals(AttributeChangeNotification.ATTRIBUTE_CHANGE)) {
            builder = new AttributeChangeNotificationBuilder(getObjectName());
        } else {
            builder = new NotificationBuilder(notificationType, getObjectName());
        }

        return (builder);
    }
View Full Code Here

TOP

Related Classes of org.glassfish.admin.amx.util.jmx.NotificationBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.