Java News from Saturday, January 24, 2009

Google has released the finished version final draft review of JSR-284 Resource Consumption Management API along with a refreshingly open (Apache License 2.0) reference implementation and compatibility kit. According to the spec,

The javax.rcm package supports resource management for Java applications. Resource management is necessary for load balancing in systems, monitoring and accounting of resources, ensuring graceful degradation in the event of resource shortages, and for thwarting denial of service attacks.

The resource management API allows programmers to define resources as well as resource management policies that control usage of these resources at execution by resource consumers.

A resource management policy can restrict the number of resources consumed by an application or throttle the rate of consumption. Further, a policy can specify actions to take following consumption in order to implement monitoring and accounting, and also define reservations for an application that guarantee resource availability at execution.

A resource consumer is a programmable entity whose resource usage needs to be controled. A thread is always a valid resource consumer, but implementations of this JSR may define other types of resource consumers. For instance, an implementation may consider the JVM itself to be a valid resource consumer, thus allowing resource management for the whole JVM.

Implementations of the JSR are also free to define new types of platform resources, as the JSR is extensible in this respect. Thus, in addition to well-known resources such as the CPU time, heap memory, disk space, network resources, etc., the API can support resources such as the number of JDBC connections, the rate of successful transactions, the number of requests in progress, etc. Consult the compliance section of this document to see what resources are required by compliant implementations of the JSR 284.

The motivation and justification of some design choices of this JSR are given in this technical report. Note however that this technical report is not part of this specification.