本文整理汇总了Java中javax.management.MBeanServerNotification.getMBeanName方法的典型用法代码示例。如果您正苦于以下问题:Java MBeanServerNotification.getMBeanName方法的具体用法?Java MBeanServerNotification.getMBeanName怎么用?Java MBeanServerNotification.getMBeanName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.MBeanServerNotification
的用法示例。
在下文中一共展示了MBeanServerNotification.getMBeanName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createdNotification
import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
private void createdNotification(MBeanServerNotification n) {
final String shouldEqual =
MBeanServerNotification.REGISTRATION_NOTIFICATION;
if (!n.getType().equals(shouldEqual)) {
logger.warning("createNotification", "bad type: " + n.getType());
return;
}
ObjectName name = n.getMBeanName();
if (logger.debugOn())
logger.debug("createdNotification", "for: " + name);
synchronized (this) {
if (createdDuringQuery != null) {
createdDuringQuery.add(name);
return;
}
}
if (isInstanceOf(mBeanServer, name, broadcasterClass)) {
addBufferListener(name);
if (isDisposed())
removeBufferListener(name);
}
}
示例2: snoopOnUnregister
import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
private void snoopOnUnregister(NotificationResult nr) {
Set<IdAndFilter> delegateSet = listenerMap.get(MBeanServerDelegate.DELEGATE_NAME);
if (delegateSet == null || delegateSet.isEmpty()) {
return;
}
for (TargetedNotification tn : nr.getTargetedNotifications()) {
Integer id = tn.getListenerID();
for (IdAndFilter idaf : delegateSet) {
if (idaf.id == id) {
// This is a notification from the MBeanServerDelegate.
Notification n = tn.getNotification();
if (n instanceof MBeanServerNotification &&
n.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
MBeanServerNotification mbsn = (MBeanServerNotification) n;
ObjectName gone = mbsn.getMBeanName();
synchronized (listenerMap) {
listenerMap.remove(gone);
}
}
}
}
}
}
示例3: handleNotificationInAwtEventThread
import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
private void handleNotificationInAwtEventThread(final Notification notif, final Object paramObject) {
if (StatusLoggerAdminMBean.NOTIF_TYPE_MESSAGE.equals(notif.getType())) {
if (!(paramObject instanceof ObjectName)) {
handle("Invalid notification object type", new ClassCastException(paramObject.getClass().getName()));
return;
}
final ObjectName param = (ObjectName) paramObject;
final JTextArea text = statusLogTextAreaMap.get(param);
if (text != null) {
text.append(notif.getMessage() + '\n');
}
return;
}
if (notif instanceof MBeanServerNotification) {
final MBeanServerNotification mbsn = (MBeanServerNotification) notif;
final ObjectName mbeanName = mbsn.getMBeanName();
if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(notif.getType())) {
onMBeanRegistered(mbeanName);
} else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(notif.getType())) {
onMBeanUnregistered(mbeanName);
}
}
}
示例4: handleNotification
import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
@Override
public void handleNotification(Notification notification, Object handback) {
if (notification instanceof MBeanServerNotification) {
MBeanServerNotification mbeanNotification = (MBeanServerNotification) notification;
String notificationType = mbeanNotification.getType();
ObjectName objectName = mbeanNotification.getMBeanName();
if (notificationType.equals(MBeanServerNotification.REGISTRATION_NOTIFICATION)) {
fireMBeanRegistered(objectName);
}
else if (notificationType.equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
fireMBeanUnregistered(objectName);
}
}
}
示例5: snoopOnUnregister
import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
private void snoopOnUnregister(NotificationResult nr) {
List<IdAndFilter> copy = null;
synchronized (listenerMap) {
Set<IdAndFilter> delegateSet = listenerMap.get(MBeanServerDelegate.DELEGATE_NAME);
if (delegateSet == null || delegateSet.isEmpty()) {
return;
}
copy = new ArrayList<>(delegateSet);
}
for (TargetedNotification tn : nr.getTargetedNotifications()) {
Integer id = tn.getListenerID();
for (IdAndFilter idaf : copy) {
if (idaf.id == id) {
// This is a notification from the MBeanServerDelegate.
Notification n = tn.getNotification();
if (n instanceof MBeanServerNotification &&
n.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
MBeanServerNotification mbsn = (MBeanServerNotification) n;
ObjectName gone = mbsn.getMBeanName();
synchronized (listenerMap) {
listenerMap.remove(gone);
}
}
}
}
}
}
示例6: handleNotification
import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
public void handleNotification(
final Notification notifIn,
final Object handback)
{
if (notifIn instanceof MBeanServerNotification)
{
final MBeanServerNotification notif = (MBeanServerNotification) notifIn;
final ObjectName objectName = notif.getMBeanName();
boolean match = false;
if ( mObjectName != null && mObjectName.equals(objectName) )
{
match = true;
}
else if ( objectName.getDomain().equals( mJMXDomain ) )
{
if ( mType != null && mType.equals(objectName.getKeyProperty(TYPE_KEY)) )
{
final String mbeanName = objectName.getKeyProperty(NAME_KEY);
if (mName != null && mName.equals(mbeanName))
{
match = true;
}
}
}
if ( match )
{
final String notifType = notif.getType();
if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(notifType))
{
mCallback.mbeanRegistered(objectName, this);
}
else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(notifType))
{
mCallback.mbeanUnregistered(objectName, this);
}
}
}
}