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


Java ObjectName.apply方法代码示例

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


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

示例1: mbeanRegistered

import javax.management.ObjectName; //导入方法依赖的package包/类
@Override
public void mbeanRegistered(JmxConnectionEvent event) {
    ObjectName objectName = event.getObjectName();
    List<DomainModel> domainModels = _DomainModelManager.getManagedModels();
    if (domainModels == null) {
        return;
    }

    for (DomainModel domainModel : domainModels) {
        Domain domain = domainModel.getData();
        ObjectName domainPattern = domain.getDomainPatternObjectName();
        if (domainPattern.apply(objectName)) {
            domainModel.refreshData();
            return;
        }
    }
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:18,代码来源:JmxConnectionModel.java

示例2: mbeanUnregistered

import javax.management.ObjectName; //导入方法依赖的package包/类
@Override
public void mbeanUnregistered(JmxConnectionEvent event) {
    ObjectName objectName = event.getObjectName();
    List<DomainModel> domainModels = _DomainModelManager.getManagedModels();
    if (domainModels == null) {
        return;
    }

    for (DomainModel domainModel : domainModels) {
        Domain domain = domainModel.getData();
        ObjectName domainPattern = domain.getDomainPatternObjectName();
        if (domainPattern.apply(objectName)) {
            MBeanModel mbeanModel = domainModel.getMBeanModel(objectName);
            if (mbeanModel != null) {
                mbeanModel.destroy();
                return;
            }
        }
    }
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:21,代码来源:JmxConnectionModel.java

示例3: runPositiveTests

import javax.management.ObjectName; //导入方法依赖的package包/类
private static int runPositiveTests() {
    int error = 0;
    for (int i = 0; i < positiveTests.length; i++) {
        System.out.println("----------------------------------------------");
        try {
            ObjectName on1 = ObjectName.getInstance(positiveTests[i][0]);
            ObjectName on2 = ObjectName.getInstance(positiveTests[i][1]);
            System.out.println("\"" + on1 + "\".apply(\"" + on2 + "\")");
            boolean result = on1.apply(on2);
            System.out.println("Result = " + result);
            if (result == false) {
                error++;
                System.out.println("Test failed!");
            } else {
                System.out.println("Test passed!");
            }
        } catch (Exception e) {
            error++;
            System.out.println("Got Unexpected Exception = " + e.toString());
            System.out.println("Test failed!");
        }
        System.out.println("----------------------------------------------");
    }
    return error;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:ApplyWildcardTest.java

示例4: runNegativeTests

import javax.management.ObjectName; //导入方法依赖的package包/类
private static int runNegativeTests() {
    int error = 0;
    for (int i = 0; i < negativeTests.length; i++) {
        System.out.println("----------------------------------------------");
        try {
            ObjectName on1 = ObjectName.getInstance(negativeTests[i][0]);
            ObjectName on2 = ObjectName.getInstance(negativeTests[i][1]);
            System.out.println("\"" + on1 + "\".apply(\"" + on2 + "\")");
            boolean result = on1.apply(on2);
            System.out.println("Result = " + result);
            if (result == true) {
                error++;
                System.out.println("Test failed!");
            } else {
                System.out.println("Test passed!");
            }
        } catch (Exception e) {
            error++;
            System.out.println("Got Unexpected Exception = " + e.toString());
            System.out.println("Test failed!");
        }
        System.out.println("----------------------------------------------");
    }
    return error;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:ApplyWildcardTest.java

示例5: queryMBeans

import javax.management.ObjectName; //导入方法依赖的package包/类
public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) {
    Set<ObjectInstance> instances = newSet();
    if (name == null)
        name = ObjectName.WILDCARD;
    if (query == null)
        query = trueQuery;
    MBeanServer oldMBS = QueryEval.getMBeanServer();
    try {
        query.setMBeanServer(this);
        for (ObjectName n : mbeans.keySet()) {
            if (name.apply(n)) {
                try {
                    if (query.apply(n))
                        instances.add(getObjectInstance(n));
                } catch (Exception e) {
                    // OK: Ignore this MBean in the result
                }
            }
        }
    } finally {
        query.setMBeanServer(oldMBS);
    }
    return instances;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:OldMBeanServerTest.java

示例6: listGatewaySenderObjectNames

import javax.management.ObjectName; //导入方法依赖的package包/类
public ObjectName[] listGatewaySenderObjectNames(String member) throws Exception {

    validateMember(member);
    DistributedMember distributedMember = BeanUtilFuncs.getDistributedMemberByNameOrId(member);


    List<ObjectName> listName = null;


    ObjectName pattern = new ObjectName(ManagementConstants.GATEWAY_SENDER_PATTERN);

    Set<ObjectName> mbeanSet = service.queryMBeanNames(distributedMember);

    if (mbeanSet != null && mbeanSet.size() > 0) {
      listName = new ArrayList<ObjectName>();
      for (ObjectName name : mbeanSet) {
        if (pattern.apply(name)) {
          listName.add(name);
        }
      }
    }

    if (listName != null && listName.size() > 0) {
      ObjectName[] arry = new ObjectName[listName.size()];
      return listName.toArray(arry);
    }
    return ManagementConstants.NO_DATA_OBJECTNAME;
  }
 
开发者ID:ampool,项目名称:monarch,代码行数:29,代码来源:DistributedSystemBridge.java

示例7: makeFilter

import javax.management.ObjectName; //导入方法依赖的package包/类
private static NotificationBufferFilter makeFilter(final Integer id,
                                                   final ObjectName pattern,
                                                   final NotificationFilter filter) {
    return new NotificationBufferFilter() {
        public void apply(List<TargetedNotification> notifs,
                          ObjectName source, Notification notif) {
            if (pattern.apply(source)) {
                if (filter == null || filter.isNotificationEnabled(notif))
                    notifs.add(new TargetedNotification(notif, id));
            }
        }
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:NotificationBufferTest.java


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