- java.lang.Object
- 
- jdk.management.resource.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 commonResourceTypes are defined.ResourceTypes may also be created byof(java.lang.String).- Since:
- 8u40
 
- 
- 
Field SummaryFields Modifier and Type Field Description static ResourceTypeDATAGRAM_OPENDATAGRAM_OPEN - number of open datagram sockets.static ResourceTypeDATAGRAM_READDATAGRAM_READ - number of bytes of datagrams read.static ResourceTypeDATAGRAM_RECEIVEDDATAGRAM_RECIEVED - number of datagrams received.static ResourceTypeDATAGRAM_SENTDATAGRAM_SENT - number of datagrams sent.static ResourceTypeDATAGRAM_WRITEDATAGRAM_WRITE - number of bytes of datagrams written.static ResourceTypeFILE_OPENFILE_OPEN - number of open files.static ResourceTypeFILE_READFILE_READ - number of bytes read from files.static ResourceTypeFILE_WRITEFILE_WRITE - number of bytes written to files.static ResourceTypeFILEDESCRIPTOR_OPENFILEDESCRIPTOR_OPEN - number of open file descriptors.static ResourceTypeHEAP_ALLOCATEDHEAP_ALLOCATED - running total of heap allocations in bytes.static ResourceTypeHEAP_RETAINEDHEAP_RETAINED - number of bytes of heap memory in use.static ResourceTypeSOCKET_OPENSOCKET_OPEN - number of open sockets.static ResourceTypeSOCKET_READSOCKET_READ - number of bytes read from sockets.static ResourceTypeSOCKET_WRITESOCKET_WRITE - number of bytes written to sockets.static ResourceTypeSTDERR_WRITESTDERR_WRITE - number of bytes written to the standard error stream.static ResourceTypeSTDIN_READSTDIN_READ - number of bytes read from the standard input stream.static ResourceTypeSTDOUT_WRITESTDOUT_WRITE - number of bytes written to the standard output stream.static ResourceTypeTHREAD_CPUTHREAD_CPU - amount of cpu time used by threads, in nanoseconds.static ResourceTypeTHREAD_CREATEDTHREAD_CREATED - number of threads created and active.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Indicates whether some other object is "equal to" this one based on the name.StringgetName()Returns the name of the resource.inthashCode()Returns a hash code value for this ResourceType based on the name.static ResourceTypeof(String name)Returns a ResourceType for the named resource.StringtoString()Returns a string representation of the object.
 
- 
- 
- 
Field Detail- 
FILE_OPENpublic static final ResourceType FILE_OPEN FILE_OPEN - number of open files.
 - 
FILE_READpublic static final ResourceType FILE_READ FILE_READ - number of bytes read from files.
 - 
FILE_WRITEpublic static final ResourceType FILE_WRITE FILE_WRITE - number of bytes written to files.
 - 
STDERR_WRITEpublic static final ResourceType STDERR_WRITE STDERR_WRITE - number of bytes written to the standard error stream.
 - 
STDIN_READpublic static final ResourceType STDIN_READ STDIN_READ - number of bytes read from the standard input stream.
 - 
STDOUT_WRITEpublic static final ResourceType STDOUT_WRITE STDOUT_WRITE - number of bytes written to the standard output stream.
 - 
SOCKET_OPENpublic static final ResourceType SOCKET_OPEN SOCKET_OPEN - number of open sockets.
 - 
SOCKET_READpublic static final ResourceType SOCKET_READ SOCKET_READ - number of bytes read from sockets.
 - 
SOCKET_WRITEpublic static final ResourceType SOCKET_WRITE SOCKET_WRITE - number of bytes written to sockets.
 - 
DATAGRAM_OPENpublic static final ResourceType DATAGRAM_OPEN DATAGRAM_OPEN - number of open datagram sockets.
 - 
DATAGRAM_RECEIVEDpublic static final ResourceType DATAGRAM_RECEIVED DATAGRAM_RECIEVED - number of datagrams received.
 - 
DATAGRAM_SENTpublic static final ResourceType DATAGRAM_SENT DATAGRAM_SENT - number of datagrams sent.
 - 
DATAGRAM_READpublic static final ResourceType DATAGRAM_READ DATAGRAM_READ - number of bytes of datagrams read.
 - 
DATAGRAM_WRITEpublic static final ResourceType DATAGRAM_WRITE DATAGRAM_WRITE - number of bytes of datagrams written.
 - 
THREAD_CREATEDpublic static final ResourceType THREAD_CREATED THREAD_CREATED - number of threads created and active.
 - 
THREAD_CPUpublic static final ResourceType THREAD_CPU THREAD_CPU - amount of cpu time used by threads, in nanoseconds.
 - 
HEAP_RETAINEDpublic static final ResourceType HEAP_RETAINED HEAP_RETAINED - number of bytes of heap memory in use.
 - 
HEAP_ALLOCATEDpublic static final ResourceType HEAP_ALLOCATED HEAP_ALLOCATED - running total of heap allocations in bytes.
 - 
FILEDESCRIPTOR_OPENpublic static final ResourceType FILEDESCRIPTOR_OPEN FILEDESCRIPTOR_OPEN - number of open file descriptors.
 
- 
 - 
Method Detail- 
ofpublic static ResourceType of(String name) Returns a ResourceType for the named resource.- Parameters:
- name- the resource name
- Returns:
- a ResourceType for the named resource
- Throws:
- IllegalArgumentException- if the length of the name is zero
 
 - 
getNamepublic String getName() Returns the name of the resource. Resource names are opaque strings that are not localized.- Returns:
- the name of the resource
 
 - 
toStringpublic String toString() Description copied from class:ObjectReturns a string representation of the object. In general, thetoStringmethod 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 toStringmethod for classObjectreturns 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()) 
 - 
hashCodepublic int hashCode() Returns a hash code value for this ResourceType based on the name.- Overrides:
- hashCodein class- Object
- Returns:
- Returns a hash code value based on the hashCode of the name.
- See Also:
- Object.equals(java.lang.Object),- System.identityHashCode(java.lang.Object)
 
 - 
equalspublic boolean equals(Object obj) Indicates whether some other object is "equal to" this one based on the name.- Overrides:
- equalsin class- Object
- Parameters:
- obj- the reference object with which to compare
- Returns:
- 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
 
 
- 
 
-