DeployableObject (Java EE 5)

Java EE API


javax.enterprise.deploy.model Interface DeployableObject

All Known Subinterfaces:
J2eeApplicationObject

public interface DeployableObject

Implemented by: J2eeApplicationObject

DeployableObject 接口是 J2EE 可部署模块(JAR、WAR、RAR、EAR)的抽象表示形式。DeployableObject 提供对模块的部署描述符和类文件的访问。
英文文档:

The DeployableObject interface is an abstract representation of a J2EE deployable module (JAR, WAR, RAR, EAR). A DeployableObject provides access to the module's deployment descriptor and class files.

Version:
0.1
Author:
gfink

Method Summary
 Enumeration
 DDBean[]
 Class
 DDBeanRoot
 DDBeanRoot
 InputStream
 String
 String[]
 ModuleType
 

Method Detail

public ModuleType getType()
返回由此可部署对象表示的部署描述符的 ModuleType(即 EAR、JAR、WAR、RAR)。值存在于 DeploymentManager 中。
return 可部署对象的 ModuleType。
英文文档:

getType

ModuleType getType()
Return the ModuleType of deployment descriptor (i.e., EAR, JAR, WAR, RAR) this deployable object represents. Values are found in DeploymentManager.

Returns:
The ModuleType of deployable object

public DDBeanRoot getDDBeanRoot()
返回表示部署描述符的根的顶级标准 Bean。
return 表示部署描述符的标准 Bean。
英文文档:

getDDBeanRoot

DDBeanRoot getDDBeanRoot()
Return the top level standard bean representing the root of the deployment descriptor.

Returns:
A standard bean representing the deployment descriptor.

public DDBean[] getChildBean(String xpath)
返回一个标准 Bean 数组,这些 Bean 表示基于 XPath 返回的 XML 内容。
xpath 一个 XPath 字符串,标识从部署描述符中提取的数据。
return DDBean 数组;如果未找到任何匹配的数据,则返回 'null'。
英文文档:

getChildBean

DDBean[] getChildBean(String xpath)
Return an array of standard beans representing the XML content returned based upon the XPath.

Parameters:
xpath - An XPath string identifying the data to be extracted from the deployment descriptor.
Returns:
a array of DDBeans or 'null' if no matching data found.

public String[] getText(String xpath)
返回与部署描述符中的 XPath 关联的 XML 内容。
xpath 引用部署描述符中某个位置的 xpath 字符串。
return XML 内容列表;如果未找到任何匹配的数据,则返回 'null'。
英文文档:

getText

String[] getText(String xpath)
Return the XML content associated with the XPath from a deployment descriptor.

Parameters:
xpath - An xpath string referring to a location in the deployment descriptor
Returns:
a list XML content or 'null' if no matching data found.

public Class<T> getClassFromScope(String className)
从此可部署模块中获取特定的类。

用途一:获取所有来自 EJB 的查找方法。 如果工具尝试打包某个模块并从此包获取类,则类请求可能失败。可能还不能使用类。该工具应该遵守清单 cross-path 条目。

className 要获取的类。
return 类的表示形式 (Class)。

英文文档:

getClassFromScope

Class getClassFromScope(String className)
Retrieve the specified class from this deployable module.

One use: to get all finder methods from an EJB If the tool is attempting to package an module and retrieve a class from the package, the class request may fail. The class may not yet be available. The tool should respect the manifest cross-path entries.

Parameters:
className - Class to retrieve.
Returns:
Class representation of the class

public String getModuleDTDVersion()
返回在 XML DOCTYPE 文本中指定的 DTD 版本号,每个标准的 J2EE 模块部署描述符文件都提供了 XML DOCTYPE 文本。
return 包含 DTD 版本号的字符串
模块的部署描述符文件总是包含
文档类型标识符 DOCTYPE。DOCTYPE 语句
在语句的标签中包含模块 DTD 版本号
。

	DOCTYPE 语句的格式为:
    <!DOCTYPE root_element PUBLIC "-//organization//label//language" "location">
root_element - DTD 中根文档的名称。 organization - 负责创建和维护被引用的 DTD 的组织的名称 。 label - 被引用的公共文本的唯一描述性名称 。 language - ISO 639 语言 id, 表示 DTD 的自然语言编码。 location - DTD 的 URL。 J2EE 部署描述符的 DOCTYPE 语句示例如下:
    <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN" "http://java.sun.com/dtd/application-client_1_3.dtd">
在本例中,标签为 "DTD J2EE Application Client 1.3", DTD 版本号是 1.3。调用 getModuleDTDVersion 将返回一个包含 "1.3" 的字符串。
此方法已过时。J2EE 1.4 除了在组件中添加了多个部署描述符之外,还使用 DDBeanRoot.getDDBeanRootVersion 取代了此方法。
deprecated 从 1.1 版本开始,用 DDBeanRoot.getDDBeanRootVersion() 取代
英文文档:

getModuleDTDVersion

String getModuleDTDVersion()
Deprecated. As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion()

Returns the DTD version number given in the XML DOCTYPE text provided in every standard J2EE module's deployment descriptor file.

Returns:
a string containing the DTD version number
 A module's deployment descriptor file always contains
 a document type identifier, DOCTYPE.  The DOCTYPE statement 
 contains the module DTD version number in the label of the 
 statement.

        The format of the DOCTYPE statement is:
    <!DOCTYPE root_element PUBLIC "-//organization//label//language" "location">
root_element - is the name of the root document in the DTD. organization - is the name of the organization responsible for the creation and maintenance of the DTD being referenced. label - is a unique descriptive name for the public text being referenced. language - is the ISO 639 language id representing the natural language encoding of th DTD. location - is the URL of the DTD. An example J2EE deployment descriptor DOCTYPE statement is:
    <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN" "http://java.sun.com/dtd/application-client_1_3.dtd">
In this example the label is, "DTD J2EE Application Client 1.3", and the DTD version number is 1.3. A call to getModuleDTDVersion would return a string containing, "1.3".
This method is being deprecated. With the addition of multiple deployment descritors in components for J2EE 1.4 this method is being replaced by DDBeanRoot.getDDBeanRootVersion.

public DDBeanRoot getDDBeanRoot(String filename) throws java.io.FileNotFoundException, DDBeanCreateException
返回指定 XML 实例文档的 DDBeanRoot 对象。此方法应该用于返回非部署描述符 XML 实例文档(如 WSDL 文件)的 DDBeanRoot 对象。
return XML 数据的 DDBeanRoot 对象。
Throwsjava.io.FileNotFoundException,: 如果找不到指定的文件
ThrowsDDBeanCreateException: 如果在创建 DDBeanRoot 对象时遇到错误。
英文文档:

getDDBeanRoot

DDBeanRoot getDDBeanRoot(String filename)
                         throws FileNotFoundException,
                                DDBeanCreateException
Returns a DDBeanRoot object for the XML instance document named. This method should be used to return DDBeanRoot objects for non deployment descriptor XML instance documents such as WSDL files.

Returns:
a DDBeanRoot object for the XML data.
Throws:
java.io.FileNotFoundException, - if the named file can not be found
DDBeanCreateException - if an error is encountered creating the DDBeanRoot object.
FileNotFoundException

public java.util.Enumeration<E> entries()
返回模块文件条目的枚举。该枚举中的所有元素都是 String 类型。每个 String 表示一个与模块的根相对的文件名称。
return 归档文件条目的枚举。
英文文档:

entries

Enumeration entries()
Returns an enumeration of the module file entries. All elements in the enumeration are of type String. Each String represents a file name relative to the root of the module.

Returns:
an enumeration of the archive file entries.

public java.io.InputStream getEntry(String name)
返回给定条目名称的 InputStream。文件名称必须与模块的根相对。
name 相对于模块的根的文件名称。
return 给定条目名称的 InputStream;如果未找到,则返回 null。
英文文档:

getEntry

InputStream getEntry(String name)
Returns the InputStream for the given entry name The file name must be relative to the root of the module.

Parameters:
name - the file name relative to the root of the module.
Returns:
the InputStream for the given entry name or null if not found.


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!