@Override public Object getAttribute(String arg0) throws AttributeNotFoundException, MBeanException, ReflectionException { synchronized(metricsMap) { if (metricsMap.containsKey(arg0)) { return metricsMap.get(arg0); } else { throw new AttributeNotFoundException("Key [" + arg0 + "] not found/tracked"); } } }
@Override public Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException { if (this.metrics.containsKey(name)) return this.metrics.get(name).metricValue(); else throw new AttributeNotFoundException("Could not find attribute " + name); }
@Override public synchronized Object getAttribute(String name) throws AttributeNotFoundException { Field field = attributes.get(name); if (field == null) { throw new AttributeNotFoundException("No such property: " + name); } return getFieldValue(field); }
throw(new AttributeNotFoundException("Cannot find " + attributeName + " attribute in " + dClassName));
throw(new AttributeNotFoundException("Cannot find " + attributeName + " attribute in " + dClassName));
@Override public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException { updateJmxCache(); synchronized(this) { Attribute a = attrCache.get(attribute); if (a == null) { throw new AttributeNotFoundException(attribute +" not found"); } if (LOG.isDebugEnabled()) { LOG.debug(attribute +": "+ a); } return a.getValue(); } }
throw(new AttributeNotFoundException("Cannot find " + attributeName + " attribute in " + dClassName));
throw(new AttributeNotFoundException("Attribute " + name + " not found in " + this.getClass().getName()));
throw(new AttributeNotFoundException("Attribute " + name + " not found in " + this.getClass().getName()));
throw(new AttributeNotFoundException("Attribute " + name + " not found in " + this.getClass().getName()));
throw(new AttributeNotFoundException("Cannot find " + attributeName + " attribute in " + dClassName));
@Override public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException { throw new AttributeNotFoundException("EndpointMBeans do not support attributes"); }
@Override public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException { throw new AttributeNotFoundException("EndpointMBeans do not support attributes"); }
throw new AttributeNotFoundException( "ModelMBeanInfo is null"); if (logger.isEnabledFor(Logger.DEBUG)) throw new AttributeNotFoundException( String.format("Cannot find ModelMBeanAttributeInfo for attribute %s", attrName)); throw new AttributeNotFoundException( String.format("Attribute %s is not writable", attrName)); throw new AttributeNotFoundException( "MBean descriptor cannot be null"); if (logger.isEnabledFor(Logger.DEBUG)) throw new AttributeNotFoundException( String.format("Attribute descriptor for attribute %s cannot be null", attrName));
throw new AttributeNotFoundException( "ModelMBeanInfo is null"); if (logger.isEnabledFor(Logger.DEBUG)) throw new AttributeNotFoundException( String.format("Cannot find ModelMBeanAttributeInfo for attribute %s", attribute)); logger.debug("Attribute info is: " + attrInfo); if (!attrInfo.isReadable()) throw new AttributeNotFoundException( String.format("Attribute %s is not readable", attribute)); throw new AttributeNotFoundException( "MBean descriptor cannot be null"); if (logger.isEnabledFor(Logger.DEBUG)) throw new AttributeNotFoundException( String.format("Attribute descriptor for attribute %s cannot be null", attribute));
@Override public synchronized Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException { if (_propMap != null) { return _propMap.get(name); } throw new AttributeNotFoundException("No such property " + name); }
private void checkPathFitsIndexNames(Stack<String> pPathStack, List<String> pIndexNames) throws AttributeNotFoundException { if (pIndexNames.size() > pPathStack.size()) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < pIndexNames.size(); i++) { buf.append(pIndexNames.get(i)); if (i < pIndexNames.size() - 1) { buf.append(","); } } throw new AttributeNotFoundException("No enough keys on path stack provided for accessing tabular data with index names " + buf.toString()); } }
private Object extractWithPath(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts, boolean jsonify, String pPath, ValueFaultHandler pFaultHandler) throws AttributeNotFoundException { AttributeExtractor<T> extractor = extractorMap.get(pPath); if (extractor == null) { return pFaultHandler.handleException(new AttributeNotFoundException("Illegal path element " + pPath + " for object " + pValue)); } try { Object attributeValue = extractor.extract((T) pValue); return pConverter.extractObject(attributeValue, pPathParts, jsonify); } catch (AttributeExtractor.SkipAttributeException e) { return pFaultHandler.handleException(new AttributeNotFoundException("Illegal path element " + pPath + " for object " + pValue)); } }
private Object extractWithPath(ObjectToJsonConverter pConverter, List pList, Stack<String> pStack, boolean jsonify, String pPathPart) throws AttributeNotFoundException { try { int idx = Integer.parseInt(pPathPart); return pConverter.extractObject(pList.get(idx), pStack, jsonify); } catch (NumberFormatException exp) { ValueFaultHandler faultHandler = pConverter.getValueFaultHandler(); return faultHandler.handleException( new AttributeNotFoundException("Index '" + pPathPart + "' is not numeric for accessing list")); } catch (IndexOutOfBoundsException exp) { ValueFaultHandler faultHandler = pConverter.getValueFaultHandler(); return faultHandler.handleException( new AttributeNotFoundException("Index '" + pPathPart + "' is out-of-bound for a list of size " + pList.size())); } }
private Object extractWithPath(ObjectToJsonConverter pConverter, Collection pCollection, Stack<String> pPathParts, boolean pJsonify, String pPathPart,int pLength) throws AttributeNotFoundException { try { int idx = Integer.parseInt(pPathPart); return pConverter.extractObject(getElement(pCollection,idx,pLength), pPathParts, pJsonify); } catch (NumberFormatException exp) { ValueFaultHandler faultHandler = pConverter.getValueFaultHandler(); return faultHandler.handleException( new AttributeNotFoundException("Index '" + pPathPart + "' is not numeric for accessing list")); } catch (IndexOutOfBoundsException exp) { ValueFaultHandler faultHandler = pConverter.getValueFaultHandler(); return faultHandler.handleException( new AttributeNotFoundException("Index '" + pPathPart + "' is out-of-bound for a list of size " + pLength)); } }