当前位置: 首页>>代码示例>>Java>>正文


Java MBeanServerDelegate.DELEGATE_NAME属性代码示例

本文整理汇总了Java中javax.management.MBeanServerDelegate.DELEGATE_NAME属性的典型用法代码示例。如果您正苦于以下问题:Java MBeanServerDelegate.DELEGATE_NAME属性的具体用法?Java MBeanServerDelegate.DELEGATE_NAME怎么用?Java MBeanServerDelegate.DELEGATE_NAME使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.management.MBeanServerDelegate的用法示例。


在下文中一共展示了MBeanServerDelegate.DELEGATE_NAME属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendNotification

/**
 * Sends an MBeanServerNotifications with the specified type for the
 * MBean with the specified ObjectName
 */
private void sendNotification(String NotifType, ObjectName name) {

    // ------------------------------
    // ------------------------------

    // ---------------------
    // Create notification
    // ---------------------
    MBeanServerNotification notif = new MBeanServerNotification(
        NotifType,MBeanServerDelegate.DELEGATE_NAME,0,name);

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "sendNotification", NotifType + " " + name);
    }

    delegate.sendNotification(notif);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:DefaultMBeanServerInterceptor.java

示例2: main

public static void main(String[] args) throws Exception {

        System.out.println(
            "Test that <MBeanServerDelegate.DELEGATE_NAME> equals " +
            "<new ObjectName(\"JMImplementation:type=MBeanServerDelegate\")>");
        final ObjectName delegateName =
                new ObjectName("JMImplementation:type=MBeanServerDelegate");
        if (!delegateName.equals(MBeanServerDelegate.DELEGATE_NAME))
            throw new AssertionError("Unexpected value: " +
                    "MBeanServerDelegate.DELEGATE_NAME = " +
                    MBeanServerDelegate.DELEGATE_NAME);
        System.out.println("MBeanServerDelegate.DELEGATE_NAME = " +
                "new ObjectName(\"" + delegateName + "\")");

        System.out.println("Test that <ObjectName.WILDCARD> " +
                           "equals <new ObjectName(\"*:*\")>");
        final ObjectName wildcardName = new ObjectName("*:*");
        if (!wildcardName.equals(ObjectName.WILDCARD))
            throw new AssertionError("Unexpected value: " +
                    "ObjectName.WILDCARD = " +
                    ObjectName.WILDCARD);
        System.out.println("ObjectName.WILDCARD = " +
                "new ObjectName(\"" + wildcardName + "\")");

        System.out.println("Test passes: constants were initialized properly");
    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:DelegateNameWildcardNameTest.java

示例3: sendNotification

/**
 * Sends an MBeanServerNotifications with the specified type for the
 * MBean with the specified ObjectName
 */
private void sendNotification(String NotifType, ObjectName name) {

    // ------------------------------
    // ------------------------------

    // ---------------------
    // Create notification
    // ---------------------
    MBeanServerNotification notif = new MBeanServerNotification(
        NotifType,MBeanServerDelegate.DELEGATE_NAME,0,name);

    if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
        MBEANSERVER_LOGGER.log(Level.TRACE, NotifType + " " + name);
    }

    delegate.sendNotification(notif);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:DefaultMBeanServerInterceptor.java

示例4: addListenerForMBeanRemovedNotif

protected Integer addListenerForMBeanRemovedNotif()
throws IOException, InstanceNotFoundException {
    NotificationFilterSupport clientFilter =
            new NotificationFilterSupport();
    clientFilter.enableType(
            MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
    MarshalledObject<NotificationFilter> sFilter =
        new MarshalledObject<NotificationFilter>(clientFilter);

    Integer[] listenerIDs;
    final ObjectName[] names =
        new ObjectName[] {MBeanServerDelegate.DELEGATE_NAME};
    final MarshalledObject<NotificationFilter>[] filters =
        Util.cast(new MarshalledObject<?>[] {sFilter});
    final Subject[] subjects = new Subject[] {null};
    try {
        listenerIDs =
                connection.addNotificationListeners(names,
                filters,
                subjects);

    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        listenerIDs =
                connection.addNotificationListeners(names,
                filters,
                subjects);
    }
    return listenerIDs[0];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:RMIConnector.java

示例5: unregisterMBean

public void unregisterMBean(ObjectName name)
throws InstanceNotFoundException, MBeanRegistrationException {

    forbidJMImpl(name);

    DynamicMBean mbean = getMBean(name);
    if (mbean == null)
        throw new InstanceNotFoundException(name.toString());

    MBeanRegistration reg = mbeanRegistration(mbean);
    try {
        reg.preDeregister();
    } catch (Exception e) {
        throw new MBeanRegistrationException(e);
    }
    if (!mbeans.remove(name, mbean))
        throw new InstanceNotFoundException(name.toString());
        // This is incorrect because we've invoked preDeregister

    Object userMBean = getUserMBean(mbean);
    if (userMBean instanceof ClassLoader)
        clr.removeLoader((ClassLoader) userMBean);

    Notification n = new MBeanServerNotification(
            MBeanServerNotification.REGISTRATION_NOTIFICATION,
            MBeanServerDelegate.DELEGATE_NAME,
            0,
            name);
    delegate.sendNotification(n);

    reg.postDeregister();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:32,代码来源:OldMBeanServerTest.java

示例6: handleNotification

@Override
public void handleNotification(Notification notification) {
    String jmxType = notification.getType().equals(RESOURCE_ADDED_NOTIFICATION) ? MBeanServerNotification.REGISTRATION_NOTIFICATION : MBeanServerNotification.UNREGISTRATION_NOTIFICATION;
    ObjectName mbeanName = ObjectNameAddressUtil.createObjectName(domain, notification.getSource());
    javax.management.Notification jmxNotification = new MBeanServerNotification(jmxType, MBeanServerDelegate.DELEGATE_NAME, sequence.incrementAndGet(), mbeanName);
    delegate.sendNotification(jmxNotification);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:7,代码来源:ModelControllerMBeanServerPlugin.java

示例7: registerMBean

public ObjectInstance registerMBean(Object object, ObjectName name)
throws InstanceAlreadyExistsException, MBeanRegistrationException,
        NotCompliantMBeanException {
    forbidJMImpl(name);
    if (name.isPattern())
        throw new IllegalArgumentException(name.toString());
    // This is the only place we check for wildcards.  Since you
    // can't register a wildcard name, other operations that supply
    // one will get InstanceNotFoundException when they look it up.

    DynamicMBean mbean;
    if (object instanceof DynamicMBean)
        mbean = (DynamicMBean) object;
    else
        mbean = standardToDynamic(object);
    MBeanRegistration reg = mbeanRegistration(object);
    try {
        name = reg.preRegister(this, name);
    } catch (Exception e) {
        throw new MBeanRegistrationException(e);
    }
    DynamicMBean put = mbeans.putIfAbsent(name, mbean);
    if (put != null) {
        reg.postRegister(false);
        throw new InstanceAlreadyExistsException(name.toString());
    }
    reg.postRegister(true);

    if (object instanceof ClassLoader)
        clr.addLoader((ClassLoader) object);

    Notification n = new MBeanServerNotification(
            MBeanServerNotification.REGISTRATION_NOTIFICATION,
            MBeanServerDelegate.DELEGATE_NAME,
            0,
            name);
    delegate.sendNotification(n);

    String className = mbean.getMBeanInfo().getClassName();
    return new ObjectInstance(name, className);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:41,代码来源:OldMBeanServerTest.java


注:本文中的javax.management.MBeanServerDelegate.DELEGATE_NAME属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。