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; }
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; }
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; }
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; }
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; }
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; }
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; }
FederationComponent oldState) { if (thisMemberName.equals(objectName)) { ObjectName distrObjectName = MBeanJMXAdapter.getDistributedSystemName(); service.unregisterMBean(distrObjectName);
/** * 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); } }
if (objectName.equals(memberObjectName)) { continue;
if (objectName.equals(memberObjectName)) { continue;
private boolean equalTo(ImmutableObjectNamePair another) { return object.equals(another.object) && name.equals(another.name); }
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; }
/** {@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
/** * 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(); } }
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; }
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; }
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; }
/** * * @param name . * @param listener . * @return . */ public boolean sameAs(final ObjectName name, final NotificationListener listener) { return (getObjectName().equals(name) && getListener() == listener); }
@Override public void onMBeanUnRegistered(MBeanServerConnection server, MBeanServerNotification mbsNotification) { if (mbsNotification.getMBeanName().equals(_objectName)) { _unregisterLatch.countDown(); } } }