Class ResourceType

  • public class ResourceType
    extends Object
    A ResourceType with a name. The resource name is an opaque string and is not localized. A number of common ResourceTypes are defined. ResourceTypes may also be created by of(java.lang.String).
    • Field Detail

      • FILE_OPEN

        public static final ResourceType FILE_OPEN
        FILE_OPEN - number of open files.
      • FILE_READ

        public static final ResourceType FILE_READ
        FILE_READ - number of bytes read from files.
      • FILE_WRITE

        public static final ResourceType FILE_WRITE
        FILE_WRITE - number of bytes written to files.

        public static final ResourceType STDERR_WRITE
        STDERR_WRITE - number of bytes written to the standard error stream.
      • STDIN_READ

        public static final ResourceType STDIN_READ
        STDIN_READ - number of bytes read from the standard input stream.

        public static final ResourceType STDOUT_WRITE
        STDOUT_WRITE - number of bytes written to the standard output stream.

        public static final ResourceType SOCKET_OPEN
        SOCKET_OPEN - number of open sockets.

        public static final ResourceType SOCKET_READ
        SOCKET_READ - number of bytes read from sockets.

        public static final ResourceType SOCKET_WRITE
        SOCKET_WRITE - number of bytes written to sockets.

        public static final ResourceType DATAGRAM_OPEN
        DATAGRAM_OPEN - number of open datagram sockets.

        public static final ResourceType DATAGRAM_RECEIVED
        DATAGRAM_RECIEVED - number of datagrams received.

        public static final ResourceType DATAGRAM_SENT
        DATAGRAM_SENT - number of datagrams sent.

        public static final ResourceType DATAGRAM_READ
        DATAGRAM_READ - number of bytes of datagrams read.

        public static final ResourceType DATAGRAM_WRITE
        DATAGRAM_WRITE - number of bytes of datagrams written.

        public static final ResourceType THREAD_CREATED
        THREAD_CREATED - number of threads created and active.
      • THREAD_CPU

        public static final ResourceType THREAD_CPU
        THREAD_CPU - amount of cpu time used by threads, in nanoseconds.

        public static final ResourceType HEAP_RETAINED
        HEAP_RETAINED - number of bytes of heap memory in use.

        public static final ResourceType HEAP_ALLOCATED
        HEAP_ALLOCATED - running total of heap allocations in bytes.

        public static final ResourceType FILEDESCRIPTOR_OPEN
        FILEDESCRIPTOR_OPEN - number of open file descriptors.
    • Method Detail

      • of

        public static ResourceType of​(String name)
        Returns a ResourceType for the named resource.
        name - the resource name
        a ResourceType for the named resource
        IllegalArgumentException - if the length of the name is zero
      • getName

        public String getName​()
        Returns the name of the resource. Resource names are opaque strings that are not localized.
        the name of the resource
      • toString

        public String toString​()
        Description copied from class: Object
        Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

        The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

         getClass().getName() + '@' + Integer.toHexString(hashCode())
        toString in class Object
        a string representation of the object.
      • equals

        public boolean equals​(Object obj)
        Indicates whether some other object is "equal to" this one based on the name.
        equals in class Object
        obj - the reference object with which to compare
        true if the pother object is a ResourceType and name of this ResourceType is the same as the name of the other ResourceType; false otherwise.
        See Also:
        Object.hashCode(), HashMap