code: public static <T> ObjectName getObjectName(final Class<T> clazz)
          {
          final String domain = clazz.getPackage().getName();
          final String className = clazz.getSimpleName();
          final String objectName = domain+":type="+className;
          LOG.debug("Returning object name: {}", objectName);
          try
              {
              return new ObjectName(objectName);
              }
          catch (final MalformedObjectNameException e)
              {
              // This should never, ever happen.
              LOG.error("Invalid ObjectName: "+objectName, e);
              throw new RuntimeException("Could not create ObjectName?", e);
              }
          }
docs: Returns an {@link ObjectName} for the specified object in standard
  format, using the package as the domain.
  
  @param <T> The type of class.
  @param clazz The {@link Class} to create an {@link ObjectName} for.
  @return The new {@link ObjectName}.