Java Code Examples for org.springframework.jmx.export.metadata.ManagedNotification

The following examples show how to use org.springframework.jmx.export.metadata.ManagedNotification. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spring-analysis-note   Source File: MetadataMBeanInfoAssembler.java    License: MIT License 5 votes vote down vote up
/**
 * Reads the {@link ManagedNotification} metadata from the {@code Class} of the managed resource
 * and generates and returns the corresponding {@link ModelMBeanNotificationInfo} metadata.
 */
@Override
protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) {
	ManagedNotification[] notificationAttributes =
			obtainAttributeSource().getManagedNotifications(getClassToExpose(managedBean));
	ModelMBeanNotificationInfo[] notificationInfos =
			new ModelMBeanNotificationInfo[notificationAttributes.length];

	for (int i = 0; i < notificationAttributes.length; i++) {
		ManagedNotification attribute = notificationAttributes[i];
		notificationInfos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(attribute);
	}

	return notificationInfos;
}
 
Example 2
public void setNotificationInfos(ManagedNotification[] notificationInfos) {
	ModelMBeanNotificationInfo[] infos = new ModelMBeanNotificationInfo[notificationInfos.length];
	for (int i = 0; i < notificationInfos.length; i++) {
		ManagedNotification notificationInfo = notificationInfos[i];
		infos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(notificationInfo);
	}
	this.notificationInfos = infos;
}
 
Example 3
Source Project: java-technology-stack   Source File: MetadataMBeanInfoAssembler.java    License: MIT License 5 votes vote down vote up
/**
 * Reads the {@link ManagedNotification} metadata from the {@code Class} of the managed resource
 * and generates and returns the corresponding {@link ModelMBeanNotificationInfo} metadata.
 */
@Override
protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) {
	ManagedNotification[] notificationAttributes =
			obtainAttributeSource().getManagedNotifications(getClassToExpose(managedBean));
	ModelMBeanNotificationInfo[] notificationInfos =
			new ModelMBeanNotificationInfo[notificationAttributes.length];

	for (int i = 0; i < notificationAttributes.length; i++) {
		ManagedNotification attribute = notificationAttributes[i];
		notificationInfos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(attribute);
	}

	return notificationInfos;
}
 
Example 4
public void setNotificationInfos(ManagedNotification[] notificationInfos) {
	ModelMBeanNotificationInfo[] infos = new ModelMBeanNotificationInfo[notificationInfos.length];
	for (int i = 0; i < notificationInfos.length; i++) {
		ManagedNotification notificationInfo = notificationInfos[i];
		infos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(notificationInfo);
	}
	this.notificationInfos = infos;
}
 
Example 5
/**
 * Reads the {@link ManagedNotification} metadata from the {@code Class} of the managed resource
 * and generates and returns the corresponding {@link ModelMBeanNotificationInfo} metadata.
 */
@Override
protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) {
	ManagedNotification[] notificationAttributes =
			this.attributeSource.getManagedNotifications(getClassToExpose(managedBean));
	ModelMBeanNotificationInfo[] notificationInfos =
			new ModelMBeanNotificationInfo[notificationAttributes.length];

	for (int i = 0; i < notificationAttributes.length; i++) {
		ManagedNotification attribute = notificationAttributes[i];
		notificationInfos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(attribute);
	}

	return notificationInfos;
}
 
Example 6
public void setNotificationInfos(ManagedNotification[] notificationInfos) {
	ModelMBeanNotificationInfo[] infos = new ModelMBeanNotificationInfo[notificationInfos.length];
	for (int i = 0; i < notificationInfos.length; i++) {
		ManagedNotification notificationInfo = notificationInfos[i];
		infos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(notificationInfo);
	}
	this.notificationInfos = infos;
}
 
Example 7
/**
 * Reads the {@link ManagedNotification} metadata from the {@code Class} of the managed resource
 * and generates and returns the corresponding {@link ModelMBeanNotificationInfo} metadata.
 */
@Override
protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) {
	ManagedNotification[] notificationAttributes =
			this.attributeSource.getManagedNotifications(getClassToExpose(managedBean));
	ModelMBeanNotificationInfo[] notificationInfos =
			new ModelMBeanNotificationInfo[notificationAttributes.length];

	for (int i = 0; i < notificationAttributes.length; i++) {
		ManagedNotification attribute = notificationAttributes[i];
		notificationInfos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(attribute);
	}

	return notificationInfos;
}
 
Example 8
public void setNotificationInfos(ManagedNotification[] notificationInfos) {
	ModelMBeanNotificationInfo[] infos = new ModelMBeanNotificationInfo[notificationInfos.length];
	for (int i = 0; i < notificationInfos.length; i++) {
		ManagedNotification notificationInfo = notificationInfos[i];
		infos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(notificationInfo);
	}
	this.notificationInfos = infos;
}