⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mbeannotificationdescriptor.java

📁 jmx在spring中的实现
💻 JAVA
字号:
/*
======================================================================

  XMLMBeanNotificationInfo.java

  Created by Claude Duguay
  Copyright (c) 2005

======================================================================
*/

package com.claudeduguay.mbeans.model;

import org.jdom.*;

import javax.management.modelmbean.*;

import com.claudeduguay.util.jdom.*;

public class MBeanNotificationDescriptor
	extends MBeanFeatureDescriptor
	implements IStorableElement
{
	protected String[] types;
	
	public MBeanNotificationDescriptor() {}

	public MBeanNotificationDescriptor(Element element)
	{
		parseElement(element);
	}
	
	public ModelMBeanNotificationInfo createMBeanNotificationInfo()
	{
		return new ModelMBeanNotificationInfo(types, name, description);
	}

	public String[] getNotifyTypes()
	{
		return types;
	}

	public void setNotifyTypes(String[] types)
	{
		this.types = types;
	}
	
	public Element buildElement()
	{
		Element element = super.buildElement();
		element.setName("notification");
		element.setAttribute("types", MBeanDescriptorUtil.buildCommaSeparatedList(getNotifyTypes()));
		return element;
	}
	
	public void parseElement(Element element)
	{
		super.parseElement(element);
		setNotifyTypes(MBeanDescriptorUtil.parseCommaSeparatedList(element.getAttributeValue("types")));
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -