javax.management.ObjectName.equals()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(86)

本文整理了Java中javax.management.ObjectName.equals()方法的一些代码示例,展示了ObjectName.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectName.equals()方法的具体详情如下:
包路径:javax.management.ObjectName
类名称:ObjectName
方法名:equals

ObjectName.equals介绍

暂无

代码示例

代码示例来源:origin: apache/geode

public boolean equals(Object anObject) {
 if (this == anObject) {
  return true;
 }
 if (anObject instanceof NotificationKey) {
  NotificationKey anotherFedComp = (NotificationKey) anObject;
  if (anotherFedComp.objectName.equals(this.objectName)
    && anotherFedComp.currentTime == this.currentTime)
   return true;
 }
 return false;
}

代码示例来源:origin: ch.qos.logback/logback-classic

private boolean previouslyRegisteredListenerWithSameObjectName() {
  List<LoggerContextListener> lcll = loggerContext.getCopyOfListenerList();
  for (LoggerContextListener lcl : lcll) {
    if (lcl instanceof JMXConfigurator) {
      JMXConfigurator jmxConfigurator = (JMXConfigurator) lcl;
      if (objectName.equals(jmxConfigurator.objectName)) {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: apache/activemq

public Subscription getSubscriber(ObjectName key) {
  Subscription sub = null;
  for (Entry<Subscription, ObjectName> entry: subscriptionMap.entrySet()) {
    if (entry.getValue().equals(key)) {
      sub = entry.getKey();
      break;
    }
  }
  return sub;
}

代码示例来源:origin: wildfly/wildfly

private synchronized int[] matchToRemove(ObjectName name, NotificationListener listener) {
  List<Integer> toRemove = new ArrayList<Integer>();
  for (Integer current : listeners.keySet()) {
    Association association = listeners.get(current);
    if ((name == association.target || name.equals(association.target) && listener == association.listener)) {
      toRemove.add(current);
    }
  }
  int[] response = new int[toRemove.size()];
  for (int i = 0; i < response.length; i++) {
    response[i] = toRemove.get(i);
    listeners.remove(response[i]);
  }
  return response;
}

代码示例来源:origin: wildfly/wildfly

private synchronized int[] matchToRemove(ObjectName name, NotificationListener listener) {
  List<Integer> toRemove = new ArrayList<Integer>();
  for (Integer current : listeners.keySet()) {
    Association association = listeners.get(current);
    if ((name == association.target || name.equals(association.target) && listener == association.listener)) {
      toRemove.add(current);
    }
  }
  int[] response = new int[toRemove.size()];
  for (int i = 0; i < response.length; i++) {
    response[i] = toRemove.get(i);
    listeners.remove(response[i]);
  }
  return response;
}

代码示例来源:origin: wildfly/wildfly

private synchronized int[] matchToRemove(ObjectName name, NotificationListener listener, NotificationFilter filter,
    Object handback) {
  List<Integer> toRemove = new ArrayList<Integer>();
  for (Integer current : listeners.keySet()) {
    Association association = listeners.get(current);
    if ((name == association.target || name.equals(association.target)) && listener == association.listener
        && filter == association.filter && handback == association.handBack) {
      toRemove.add(current);
    }
  }
  int[] response = new int[toRemove.size()];
  for (int i = 0; i < response.length; i++) {
    response[i] = toRemove.get(i);
    listeners.remove(response[i]);
  }
  return response;
}

代码示例来源:origin: wildfly/wildfly

private synchronized int[] matchToRemove(ObjectName name, NotificationListener listener, NotificationFilter filter,
    Object handback) {
  List<Integer> toRemove = new ArrayList<Integer>();
  for (Integer current : listeners.keySet()) {
    Association association = listeners.get(current);
    if ((name == association.target || name.equals(association.target)) && listener == association.listener
        && filter == association.filter && handback == association.handBack) {
      toRemove.add(current);
    }
  }
  int[] response = new int[toRemove.size()];
  for (int i = 0; i < response.length; i++) {
    response[i] = toRemove.get(i);
    listeners.remove(response[i]);
  }
  return response;
}

代码示例来源:origin: apache/geode

FederationComponent oldState) {
if (thisMemberName.equals(objectName)) {
 ObjectName distrObjectName = MBeanJMXAdapter.getDistributedSystemName();
 service.unregisterMBean(distrObjectName);

代码示例来源:origin: apache/geode

/**
 * Add a proxy to the map to be used by bridge.
 *
 * @param objectName object name of the proxy
 * @param proxy actual proxy instance
 */
public void addMemberToSystem(ObjectName objectName, MemberMXBean proxy,
  FederationComponent newState) {
 if (objectName.equals(thisMemberName)) {
  ObjectName distrObjectName = MBeanJMXAdapter.getDistributedSystemName();
  DistributedSystemMXBean systemMBean = new DistributedSystemMBean(this);
  service.registerInternalMBean(systemMBean, distrObjectName);
  this.systemLevelNotifEmitter = (DistributedSystemMBean) service.getDistributedSystemMXBean();
  this.distListener = new DistributedSystemNotifListener();
 }
 if (mapOfMembers != null) {
  mapOfMembers.put(objectName, proxy);
  memberSetSize = mapOfMembers.values().size();
 }
 updateMember(objectName, newState, null);
 try {
  mbeanServer.addNotificationListener(objectName, distListener, null, null);
 } catch (InstanceNotFoundException e) {
  if (logger.isDebugEnabled()) {
   logger.debug(e.getMessage());
  }
  logger.info("{} Instance Not Found in Platform MBean Server", objectName);
 }
}

代码示例来源:origin: apache/geode

if (objectName.equals(memberObjectName)) {
 continue;

代码示例来源:origin: apache/geode

if (objectName.equals(memberObjectName)) {
 continue;

代码示例来源:origin: glowroot/glowroot

private boolean equalTo(ImmutableObjectNamePair another) {
 return object.equals(another.object)
   && name.equals(another.name);
}

代码示例来源:origin: camunda/camunda-bpm-platform

private boolean previouslyRegisteredListenerWithSameObjectName() {
 List<LoggerContextListener> lcll = loggerContext.getCopyOfListenerList();
 for (LoggerContextListener lcl : lcll) {
  if (lcl instanceof JMXConfigurator) {
   JMXConfigurator jmxConfigurator = (JMXConfigurator) lcl;
   if (objectName.equals(jmxConfigurator.objectName)) {
    return true;
   }
  }
 }
 return false;
}

代码示例来源:origin: rhuss/jolokia

/** {@inheritDoc} */
@Override
@SuppressWarnings("PMD.IfStmtsMustUseBraces")
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  HistoryKey that = (HistoryKey) o;
  if (!mBean.equals(that.mBean)) return false;
  if (path != null ? !path.equals(that.path) : that.path != null) return false;
  if (!secondary.equals(that.secondary)) return false;
  if (target != null ? !target.equals(that.target) : that.target != null)
    return false;
  if (!type.equals(that.type)) return false;
  return true;
}
// CHECKSTYLE:ON

代码示例来源:origin: rhuss/jolokia

/**
 * Get the name of all attributes fetched for a certain MBean name. If the request was
 * performed for a single MBean, then the given name must match that of the MBean name
 * provided in the request. If <code>null</code> is given as argument, then this method
 * will return all attributes for the single MBean given in the request
 *
 * @param pObjectName MBean for which to get the attribute names,
 * @return a collection of attribute names
 */
public Collection<String> getAttributes(ObjectName pObjectName) {
  ObjectName requestMBean = getRequest().getObjectName();
  if (requestMBean.isPattern()) {
    // We need to got down one level in the returned values
    JSONObject attributes = getAttributesForObjectNameWithPatternRequest(pObjectName);
    return attributes.keySet();
  } else {
    if (pObjectName != null && !pObjectName.equals(requestMBean)) {
      throw new IllegalArgumentException("Given ObjectName " + pObjectName + " doesn't match with" +
          " the single ObjectName " + requestMBean + " given in the request");
    }
    return getAttributes();
  }
}

代码示例来源:origin: org.apache.activemq/activemq-all

public Subscription getSubscriber(ObjectName key) {
  Subscription sub = null;
  for (Entry<Subscription, ObjectName> entry: subscriptionMap.entrySet()) {
    if (entry.getValue().equals(key)) {
      sub = entry.getKey();
      break;
    }
  }
  return sub;
}

代码示例来源:origin: tomcat-slf4j-logback/tomcat-slf4j-logback

private boolean previouslyRegisteredListenerWithSameObjectName() {
  List<LoggerContextListener> lcll = loggerContext.getCopyOfListenerList();
  for (LoggerContextListener lcl : lcll) {
    if (lcl instanceof JMXConfigurator) {
      JMXConfigurator jmxConfigurator = (JMXConfigurator) lcl;
      if (objectName.equals(jmxConfigurator.objectName)) {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: org.ow2.sirocco.vmm/sirocco-vmm-agent-core

protected ResourcePartition getSubPartitionByObjectName(final ObjectName objectName) {
  for (ResourcePartition rp : this.subPartitions) {
    if (rp.getObjectName().equals(objectName)) {
      return rp;
    }
    ResourcePartition rp2 = rp.getSubPartitionByObjectName(objectName);
    if (rp2 != null) {
      return rp2;
    }
  }
  return null;
}

代码示例来源:origin: org.jppf/jppf-jmxremote_optional

/**
 * 
 * @param name .
 * @param listener .
 * @return .
 */
public boolean sameAs(final ObjectName name, final NotificationListener listener) {
 return (getObjectName().equals(name) && getListener() == listener);
}

代码示例来源:origin: apache/helix

@Override
 public void onMBeanUnRegistered(MBeanServerConnection server,
   MBeanServerNotification mbsNotification) {
  if (mbsNotification.getMBeanName().equals(_objectName)) {
   _unregisterLatch.countDown();
  }
 }
}

相关文章