uCosminexus Application Server, Web Service Development Guide

[Contents][Glossary][Index][Back][Next]

17.1 Resource classes

This section describes the difference between the resource methods, sub-resource methods, and the sub-resource locators of a resource class. This chapter also describes the difference between the root resource and sub-resource classes.

The resource methods, sub-resource methods, and the sub-resource locators of a resource class are defined depending on the availability of Path annotations and request method identifiers. The following table describes the respective definitions.

Table 17-1 Definition of resource and sub-resource methods, and sub-resource locator

No. Method or locator Path annotation Request method designator
1 Resource method N Y
2 Sub-resource method Y Y
3 Sub-resource locator Y N

Legends:
Y: Indicates availability
N: Indicates non-availability

Use a JAX-RS engine for generating the instances of root resource classes. When generating an instance, an injection is performed to constructor parameters, fields, and bean properties according to the JAX-RS specifications.

On the other hand, the JAX-RS engine is not used for generating an instance of a sub-resource class. A sub-resource class must be instantiated by a corresponding sub-resource locator. Therefore, you are required to use a sub-resource locator or a sub-resource class to initialize constructor parameters, fields, and bean properties.

Organization of this section
17.1.1 Root resource classes
17.1.2 Entity parameters
17.1.3 Return values
17.1.4 Parameter types
17.1.5 Exception mapping
17.1.6 URI template
17.1.7 Sub-resource class
17.1.8 Exception handling
17.1.9 Media type declaration
17.1.10 Disabling URL decoding
17.1.11 Inheriting annotations