Java 8 MBeanNotificationInfo - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 MBeanNotificationInfo class.

This code example shows how to use the following methods:
        if (info != null)
            return (info);
 
        // Create and return a new information object 
        info = new MBeanNotificationInfo
            (getNotifTypes(), getName(), getDescription()); 
        //Descriptor descriptor = info.getDescriptor(); 
        //addFields(descriptor); 
        //info.setDescriptor(descriptor); 
        return (info);
 
    } 
 
 
    /** 
     * Return a string representation of this notification descriptor. 
     */ 
    @Override 
    public String toString() {
 
5
CodeRank
This code example shows how to use the following methods:
        String[] types = new String[]{
            AttributeChangeNotification.ATTRIBUTE_CHANGE
        }; 
        String notifName = AttributeChangeNotification.class.getName();
        String description = "An attribute of this MBean has changed";
        MBeanNotificationInfo info = new MBeanNotificationInfo(types, notifName, description);
        return new MBeanNotificationInfo[]{info};
    } 
 
    @Override 
    public void handleNotification(Notification notification, Object handback) {
        if ("perfTimer".equals(notification.getType())) {
            assert Objects.equal(handback, name);
            refresh(); 
        } 
    } 
 
    @Override 
    public void refresh() { 
        if (registered) {
5
CodeRank
This code example shows how to use the following methods:
     * @return the type of the field or {@code null} if it wasn't found 
     */ 
    public MBeanNotificationInfo getNotificationInfo() { 
        String[] notificationTypes = new String[1]; 
        notificationTypes[0] = m_field; 
        MBeanNotificationInfo mbni = new MBeanNotificationInfo( 
            notificationTypes, m_name, m_description); 
        return mbni; 
    } 
} 
4
CodeRank
This code example shows how to use the following methods:
 
    public static MBeanNotificationInfo[] getDefaultNotificationInfo() {
        String[] types = new String[] {NOTIFY_INIT, NOTIFY_CONNECT, NOTIFY_ABANDON, SLOW_QUERY_NOTIFICATION, FAILED_QUERY_NOTIFICATION, SUSPECT_ABANDONED_NOTIFICATION};
        String name = Notification.class.getName();
        String description = "A connection pool error condition was met.";
        MBeanNotificationInfo info = new MBeanNotificationInfo(types, name, description);
        return new MBeanNotificationInfo[] {info};
    } 
 
    /** 
     * Return true if the notification was sent successfully, false otherwise. 
     * @param type 
     * @param message 
     * @return true if the notification succeeded 
     */ 
    public boolean notify(final String type, String message) {
        try { 
            Notification n = new Notification(
                    type,
                    this,
4
CodeRank
This code example shows how to use the following methods:
        if (info != null)
            return (info);
 
        // Create and return a new information object 
        info = new MBeanNotificationInfo
            (getNotifTypes(), getName(), getDescription()); 
        //Descriptor descriptor = info.getDescriptor(); 
        //addFields(descriptor); 
        //info.setDescriptor(descriptor); 
        return (info);
 
    } 
 
 
    /** 
     * Return a string representation of this notification descriptor. 
     */ 
    public String toString() {
 
        StringBuffer sb = new StringBuffer("NotificationInfo[");
4
CodeRank
This code example shows how to use the following methods:
 
	public MBeanNotificationInfo[] getNotificationInfo() {
		return new MBeanNotificationInfo[] {new MBeanNotificationInfo(
			new String[] { AttributeChangeNotification.ATTRIBUTE_CHANGE },
			AttributeChangeNotification.class.getName(),
			"Generated when the ObjectStore MBean is registered and destroyed") 
		}; 
	} 
} 
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
 
	static { 
		final String[] notifTypes = new String[] { };
		final String name = Notification.class.getName();
		final String description = "Ehcache Hibernate Statistics Event";
		NOTIFICATION_INFO = new MBeanNotificationInfo( notifTypes, name, description );
	} 
 
	/** 
	 * Constructor accepting the backing {@link CacheManager} 
	 * 
	 * @param manager the backing {@link CacheManager} 
	 * 
	 * @throws NotCompliantMBeanException 
	 */ 
	public EhcacheHibernate(CacheManager manager) throws NotCompliantMBeanException {
		super( EhcacheHibernateMBean.class ); 
		ehcacheStats = new EhcacheStatsImpl( manager );
	} 
 
3
CodeRank
This code example shows how to use the following methods:
{ 
   CircuitBreaker circuitBreaker;
 
   public CircuitBreakerJMX(CircuitBreaker circuitBreaker, final ObjectName mbeanObjectName)
   { 
      super(new MBeanNotificationInfo(new String[]{"serviceLevel", "status"}, Notification.class.getName(), "Circuit breaker notifications"));
 
      this.circuitBreaker = circuitBreaker;
      circuitBreaker.addPropertyChangeListener(new PropertyChangeListener()
      { 
         long sequenceNr = System.currentTimeMillis();
 
         @Override 
         public void propertyChange(PropertyChangeEvent evt)
         { 
            Notification notification = new Notification(evt.getPropertyName(), mbeanObjectName, sequenceNr++, System.currentTimeMillis(), evt.getNewValue().toString());
            sendNotification(notification);
         } 
      }); 
   } 
4
CodeRank
This code example shows how to use the following methods:
        mbci1 =
            new MBeanConstructorInfo("name", "descr", null);
        mbci2 =
            new MBeanConstructorInfo("name", "descr", params);
        mbni1 =
            new MBeanNotificationInfo(null, "name", "descr");
        mbni2 =
            new MBeanNotificationInfo(new String[] {"type"}, "name", "descr");
        mboi1 =
            new MBeanOperationInfo("name", "descr", null, "type", ACTION);
        mboi2 =
            new MBeanOperationInfo("name", "descr", params, "type", INFO);
        mbi1 =
            new MBeanInfo("class", "descr", null, null, null, null);
        mbi2 =
            new MBeanInfo(
                "class", "descr", 
                new MBeanAttributeInfo[] {mbai},
                new MBeanConstructorInfo[] {mbci1, mbci2},
                new MBeanOperationInfo[] {mboi1, mboi2},
4
CodeRank
See Code Examples for Java 8 MBeanNotificationInfo Methods: