This section describes the notes on using the annotations.
With Application Server, only the mapped-name attribute specified in @Resource is processed. The mapped-name attribute specified in @Resource is processed as an attribute corresponding to the <linked-to> tag beneath the <resource-ref> tag, <linked-to> tag beneath the <resource-env-ref> tag, and <linked-queue> tag beneath the <resource-env-ref> tag in the property file. However, if both, the <linked-to> tag and <linked-queue> tag of the property file and the mapped-name attribute are specified, the value specified in the <linked-to> tag and <linked-queue> tag is given priority.
With Application Server, the interface that forms the return value type of the create method of the home interface specified in @RemoteHome or @LocalHome is considered as the component interface. @RemoteHome and @LocalHome cannot be used with a combination of the home interface and business interface.
Table 12-19 Specifications for defining the methods specifying @PostConstruct or @PreDestroy
Specifications for method definition | Differences from the Java EE specifications | Explanation |
---|---|---|
Argument cannot be specified. | -- | For a method with argument, the message KDJE39328-E is output and an error occurs when the Web application starts. |
Checked exception can be thrown. Handled like a non-checked exception. | With the Java EE specifications, a checked exception cannot be thrown. | For a method containing the throws definition, the message KDJE39329-W is output when the Web application starts. |
Can be used in the instance method and class (static) method. | With the Java EE specifications, the definition cannot be specified with the static method. | For the static method, the message KDJE39330-W is output when the Web application starts. |
A method with a return value can be used. | With the Java EE specifications, the return value must be limited to void. | For a method with a return value, the message KDJE39331-W is output when the Web application starts. |
Either public, protected, package private, or private can be specified. | -- | -- |
Can be declared as final. | -- | -- |