code: 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();
          }
      }
docs: 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