@Target(value={TYPE,FIELD,METHOD}) @Retention(value=RUNTIME) public @interface Resource
尽管这个注释没有标记遗传,部署工具都需要检查所有的超类的任何组件类发现在所有父类的所有这些注释使用。所有这些注释实例都指定应用程序组件所需的资源。注意,这个注释可以出现在父类的私有字段和方法;容器需要进行注射在这些情况下,以及。
Modifier and Type | Optional Element and Description |
---|---|
Resource.AuthenticationType |
authenticationType
用于此资源的验证类型。
|
String |
description
这个资源的描述。
|
String |
lookup
引用指向的资源的名称。
|
String |
mappedName
该资源应该映射到的特定产品名称。
|
String |
name
资源的JNDI名称。
|
boolean |
shareable
指示该资源是否可以在该组件和其他组件之间共享。
|
类<?> |
type
资源的java类型。
|
public abstract String name
public abstract String lookup
public abstract 类<?> type
public abstract Resource.AuthenticationType authenticationType
public abstract boolean shareable
public abstract String mappedName
name
元或违约,是出了名的地方使用资源的应用组件。(这是在JNDI
java:comp/env
命名空间。名字)许多应用服务器提供了一种方法来映射这些地方名称资源已知的应用程序服务器名称。这个映射的名称通常是一个全球的JNDI名称,但可以是任何形式的名字。
应用程序服务器不需要支持任何特定形式或类型的映射名称,也不需要使用映射名称的能力。映射的名称是依赖于产品的,并且经常依赖于安装。没有映射的名称的使用是便携式的。
public abstract String description
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.