uCosminexus Application Server, Web Service Development Guide
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 |
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.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.