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


Java MBeanServerDelegate类代码示例

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


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

示例1: DefaultMBeanServerInterceptor

import javax.management.MBeanServerDelegate; //导入依赖的package包/类
/**
 * Creates a DefaultMBeanServerInterceptor with the specified
 * repository instance.
 * <p>Do not forget to call <code>initialize(outer,delegate)</code>
 * before using this object.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param repository The repository to use for this MBeanServer.
 */
public DefaultMBeanServerInterceptor(MBeanServer         outer,
                                     MBeanServerDelegate delegate,
                                     MBeanInstantiator   instantiator,
                                     Repository          repository) {
    if (outer == null) throw new
        IllegalArgumentException("outer MBeanServer cannot be null");
    if (delegate == null) throw new
        IllegalArgumentException("MBeanServerDelegate cannot be null");
    if (instantiator == null) throw new
        IllegalArgumentException("MBeanInstantiator cannot be null");
    if (repository == null) throw new
        IllegalArgumentException("Repository cannot be null");

    this.server   = outer;
    this.delegate = delegate;
    this.instantiator = instantiator;
    this.repository   = repository;
    this.domain       = repository.getDefaultDomain();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:DefaultMBeanServerInterceptor.java

示例2: sendNotification

import javax.management.MBeanServerDelegate; //导入依赖的package包/类
/**
 * 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,代码行数:24,代码来源:DefaultMBeanServerInterceptor.java

示例3: destroyListeners

import javax.management.MBeanServerDelegate; //导入依赖的package包/类
private void destroyListeners() {
    checkNoLocks();
    logger.debug("destroyListeners", "starts");
    try {
        removeNotificationListener(MBeanServerDelegate.DELEGATE_NAME,
                                   creationListener);
    } catch (Exception e) {
        logger.warning("remove listener from MBeanServer delegate", e);
    }
    Set<ObjectName> names = queryNames(null, broadcasterQuery);
    for (final ObjectName name : names) {
        if (logger.debugOn())
            logger.debug("destroyListeners",
                         "remove listener from " + name);
        removeBufferListener(name);
    }
    logger.debug("destroyListeners", "ends");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:ArrayNotificationBuffer.java

示例4: removeListenerForMBeanRemovedNotif

import javax.management.MBeanServerDelegate; //导入依赖的package包/类
protected void removeListenerForMBeanRemovedNotif(Integer id)
throws IOException, InstanceNotFoundException,
        ListenerNotFoundException {
    try {
        connection.removeNotificationListeners(
                MBeanServerDelegate.DELEGATE_NAME,
                new Integer[] {id},
                null);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        connection.removeNotificationListeners(
                MBeanServerDelegate.DELEGATE_NAME,
                new Integer[] {id},
                null);
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:RMIConnector.java

示例5: main

import javax.management.MBeanServerDelegate; //导入依赖的package包/类
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,代码行数:27,代码来源:DelegateNameWildcardNameTest.java

示例6: sendNotification

import javax.management.MBeanServerDelegate; //导入依赖的package包/类
/**
 * 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,代码行数:22,代码来源:DefaultMBeanServerInterceptor.java


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