本文整理汇总了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;
}
}
}
示例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;
}
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
}
};
}