code: private ObjectName objectNameFromPath(Stack<String> pPathStack) throws MalformedObjectNameException {
          if (pPathStack.empty()) {
              return null;
          }
          Stack<String> path = (Stack<String>) pPathStack.clone();
          String domain = path.pop();
          if (path.empty()) {
              return new ObjectName(domain + ":*");
          }
          String props = path.pop();
          ObjectName mbean = new ObjectName(domain + ":" + props);
          if (mbean.isPattern()) {
              throw new IllegalArgumentException("Cannot use an MBean pattern as path (given MBean: " + mbean + ")");
          }
          return mbean;
      }
docs: Prepare an objectname patttern from a path (or "null" if no path is given)
  @param pPathStack path
  @return created object name (either plain or a pattern)