DeploymentManager (Java EE 5)

Java EE API


javax.enterprise.deploy.spi Interface DeploymentManager


public interface DeploymentManager


DeploymentManager 对象为 J2EE 应用程序部署提供 J2EE 平台所必须提供的一组核心功能。它提供与服务器相关的信息,如部署目标列表和供应商特有的运行时配置信息。
英文文档:

The DeploymentManager object provides the core set of functions a J2EE platform must provide for J2EE application deployment. It provides server related information, such as, a list of deployment targets, and vendor unique runtime configuration information.


Method Summary
 DeploymentConfiguration
 ProgressObject
 ProgressObject
 ProgressObject
 TargetModuleID[]
 Locale
 DConfigBeanVersionType
 Locale
 TargetModuleID[]
 TargetModuleID[]
 Locale[]
 Target[]
 boolean
 boolean
 boolean
 ProgressObject
 ProgressObject
 void
 void
 void
 ProgressObject
 ProgressObject
 ProgressObject
 

Method Detail

public Target[] getTargets() throws IllegalStateException
获取此 DeploymentManager 支持的部署目标列表。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
return 用户可以为应用程序部署选择的部署 Target 标志符列表;如果没有,则返回 'null'。
英文文档:

getTargets

Target[] getTargets()
                    throws IllegalStateException
Retrieve the list of deployment targets supported by this DeploymentManager.

Returns:
A list of deployment Target designators the user may select for application deployment or 'null' if there are none.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public TargetModuleID[] getRunningModules(ModuleType moduleType, Target[] targetList) throws TargetException, IllegalStateException
获取分发给标识目标的 J2EE 应用程序模块列表,它们当前运行在关联的服务器上。
moduleType J2EE 模块类型的预定义标志符。
targetList 用户想要了解模块运行状态时查看的部署 Target 标志符列表。
return 表示运行模块的 TargetModuleID 对象数组;如果没有,则返回 'null'。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
ThrowsTargetException: 遇到无效的 Target 标志符。
英文文档:

getRunningModules

TargetModuleID[] getRunningModules(ModuleType moduleType,
                                   Target[] targetList)
                                   throws TargetException,
                                          IllegalStateException
Retrieve the list of J2EE application modules distributed to the identified targets and that are currently running on the associated server or servers.

Parameters:
moduleType - A predefined designator for a J2EE module type.
targetList - A list of deployment Target designators the user wants checked for module run status.
Returns:
An array of TargetModuleID objects representing the running modules or 'null' if there are none.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.
TargetException - An invalid Target designator encountered.

public TargetModuleID[] getNonRunningModules(ModuleType moduleType, Target[] targetList) throws TargetException, IllegalStateException
获取分发给标识目标的 J2EE 应用程序模块列表,它们当前运行在关联的服务器上。
moduleType J2EE 模块类型的预定义标志符。
targetList 用户想要了解模块非运行状态时查看的部署 Target 标志符列表。
return 表示非运行模块的 TargetModuleID 对象数组;如果没有,则返回 'null'。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
ThrowsTargetException: 遇到无效的 Target 标志符。
英文文档:

getNonRunningModules

TargetModuleID[] getNonRunningModules(ModuleType moduleType,
                                      Target[] targetList)
                                      throws TargetException,
                                             IllegalStateException
Retrieve the list of J2EE application modules distributed to the identified targets and that are currently not running on the associated server or servers.

Parameters:
moduleType - A predefined designator for a J2EE module type.
targetList - A list of deployment Target designators the user wants checked for module not running status.
Returns:
An array of TargetModuleID objects representing the non-running modules or 'null' if there are none.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.
TargetException - An invalid Target designator encountered.

public TargetModuleID[] getAvailableModules(ModuleType moduleType, Target[] targetList) throws TargetException, IllegalStateException
获取运行或没有运行在标识目标上的所有 J2EE 应用程序模块列表。
moduleType J2EE 模块类型的预定义标志符。
targetList 用户想要了解模块非运行状态时查看的部署 Target 标志符列表。
return 表示所有运行或未运行部署模块的 TargetModuleID 对象数组;如果没有部署模块,则返回 'null'。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
ThrowsTargetException: 遇到无效的 Target 标志符。
英文文档:

getAvailableModules

TargetModuleID[] getAvailableModules(ModuleType moduleType,
                                     Target[] targetList)
                                     throws TargetException,
                                            IllegalStateException
Retrieve the list of all J2EE application modules running or not running on the identified targets.

Parameters:
moduleType - A predefined designator for a J2EE module type.
targetList - A list of deployment Target designators the user wants checked for module not running status.
Returns:
An array of TargetModuleID objects representing all deployed modules running or not or 'null' if there are no deployed modules.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.
TargetException - An invalid Target designator encountered.

public DeploymentConfiguration createConfiguration(DeployableObject dObj) throws InvalidModuleException
获取为 J2EE 可部署组件提供特定于服务器的部署配置信息的对象。
dObj 表示 J2EE 可部署组件的对象。
ThrowsInvalidModuleException: DeployableObject 未知或不是此配置工具支持的组件。
英文文档:

createConfiguration

DeploymentConfiguration createConfiguration(DeployableObject dObj)
                                            throws InvalidModuleException
Retrieve the object that provides server-specific deployment configuration information for the J2EE deployable component.

Parameters:
dObj - An object representing a J2EE deployable component.
Throws:
InvalidModuleException - The DeployableObject is an unknown or unsupport component for this configuration tool.

public ProgressObject distribute(Target[] targetList, java.io.File moduleArchive, java.io.File deploymentPlan) throws IllegalStateException
此分发方法执行三个任务:验证部署配置数据;生成所有特定于容器的类和接口;将完整备份的归档移动到指定的部署目标。
targetList 用户指定将部署此应用程序的服务器目标列表。
moduleArchive 要分发的应用程序归档文件的文件名称。
deploymentPlan 包含与此应用程序归档文件关联的运行时配置信息的 XML 文件。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
return ProgressObject 追踪和报告分发过程状态的对象。
英文文档:

distribute

ProgressObject distribute(Target[] targetList,
                          File moduleArchive,
                          File deploymentPlan)
                          throws IllegalStateException
The distribute method performs three tasks; it validates the deployment configuration data, generates all container specific classes and interfaces, and moves the fully baked archive to the designated deployment targets.

Parameters:
targetList - A list of server targets the user is specifying this application be deployed to.
moduleArchive - The file name of the application archive to be disrtibuted.
deploymentPlan - The XML file containing the runtime configuration information associated with this application archive.
Returns:
ProgressObject an object that tracks and reports the status of the distribution process.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public ProgressObject distribute(Target[] targetList, java.io.InputStream moduleArchive, java.io.InputStream deploymentPlan) throws IllegalStateException
此分发方法执行三个任务:验证部署配置数据;生成所有特定于容器的类和接口;将完整备份的归档移动到指定的部署目标。
targetList 用户指定将部署此应用程序的服务器目标列表。
moduleArchive 包含要分发的应用程序归档文件的输入流。
deploymentPlan 包含与此应用程序归档文件关联的部署配置信息的输入流。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
return ProgressObject 追踪和报告分发过程状态的对象。
deprecated 从 Java EE 5 开始,由 #distribute(Target[], ModuleType, InputStream, InputStream) 取代。
英文文档:

distribute

ProgressObject distribute(Target[] targetList,
                          InputStream moduleArchive,
                          InputStream deploymentPlan)
                          throws IllegalStateException
Deprecated. as of Java EE 5, replaced with distribute(Target[], ModuleType, InputStream, InputStream)

The distribute method performs three tasks; it validates the deployment configuration data, generates all container specific classes and interfaces, and moves the fully baked archive to the designated deployment targets.

Parameters:
targetList - A list of server targets the user is specifying this application be deployed to.
moduleArchive - The input stream containing the application archive to be disrtibuted.
deploymentPlan - The input stream containing the deployment configuration information associated with this application archive.
Returns:
ProgressObject an object that tracks and reports the status of the distribution process.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public ProgressObject distribute(Target[] targetList, ModuleType type, java.io.InputStream moduleArchive, java.io.InputStream deploymentPlan) throws IllegalStateException
此分发方法执行三个任务:验证部署配置数据;生成所有特定于容器的类和接口;将完整备份的归档移动到指定的部署目标。
targetList 用户指定将部署此应用程序的服务器目标列表。
moduleType 此应用程序归档文件的模块类型。
moduleArchive 包含要分发的应用程序归档文件的输入流。
deploymentPlan 包含与此应用程序归档文件关联的部署配置信息的输入流。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
return ProgressObject 追踪和报告分发过程状态的对象。
英文文档:

distribute

ProgressObject distribute(Target[] targetList,
                          ModuleType type,
                          InputStream moduleArchive,
                          InputStream deploymentPlan)
                          throws IllegalStateException
The distribute method performs three tasks; it validates the deployment configuration data, generates all container specific classes and interfaces, and moves the fully baked archive to the designated deployment targets.

Parameters:
targetList - A list of server targets the user is specifying this application be deployed to.
moduleType - The module type of this application archive.
moduleArchive - The input stream containing the application archive to be disrtibuted.
deploymentPlan - The input stream containing the deployment configuration information associated with this application archive.
Returns:
ProgressObject an object that tracks and reports the status of the distribution process.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public ProgressObject start(TargetModuleID[] moduleIDList) throws IllegalStateException
启动应用程序运行。

只有表示根模块的 TargetModuleID 才能有效启动。根 TargetModuleID 没有父级。有父级的 TargetModuleID 无法单独启动。根 TargetModuleID 模块及其所有子模块都将被启动。

moduleIDList 表示要启动的模块的 TargetModuleID 对象数组。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
return ProgressObject 追踪和报告启动操作状态的对象。

英文文档:

start

ProgressObject start(TargetModuleID[] moduleIDList)
                     throws IllegalStateException
Start the application running.

Only the TargetModuleIDs which represent a root module are valid for being started. A root TargetModuleID has no parent. A TargetModuleID with a parent can not be individually started. A root TargetModuleID module and all its child modules will be started.

Parameters:
moduleIDList - A array of TargetModuleID objects representing the modules to be started.
Returns:
ProgressObject an object that tracks and reports the status of the start operation.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public ProgressObject stop(TargetModuleID[] moduleIDList) throws IllegalStateException
停止应用程序运行。

只有表示根模块的 TargetModuleID 才能有效停止。根 TargetModuleID 没有父级。有父级的 TargetModuleID 无法单独停止。根 TargetModuleID 模块及其所有子模块都将被停止。

moduleIDList 表示要停止的模块的 TargetModuleID 对象数组。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
return ProgressObject 追踪和报告停止操作状态的对象。

英文文档:

stop

ProgressObject stop(TargetModuleID[] moduleIDList)
                    throws IllegalStateException
Stop the application running.

Only the TargetModuleIDs which represent a root module are valid for being stopped. A root TargetModuleID has no parent. A TargetModuleID with a parent can not be individually stopped. A root TargetModuleID module and all its child modules will be stopped.

Parameters:
moduleIDList - A array of TargetModuleID objects representing the modules to be stopped.
Returns:
ProgressObject an object that tracks and reports the status of the stop operation.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public ProgressObject undeploy(TargetModuleID[] moduleIDList) throws IllegalStateException
从目标服务器移除应用程序。

只有表示根模块的 TargetModuleID 才能有效地取消部署。根 TargetModuleID 没有父级。有父级的 TargetModuleID 无法取消部署。根 TargetModuleID 模块及其所有子模块都将被取消部署。根 TargetModuleID 模块及其所有子模块都必须在取消部署之前停止。

moduleIDList 表示要停止的根模块的 TargetModuleID 对象数组。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
return ProgressObject 追踪和报告停止操作状态的对象。

英文文档:

undeploy

ProgressObject undeploy(TargetModuleID[] moduleIDList)
                        throws IllegalStateException
Remove the application from the target server.

Only the TargetModuleIDs which represent a root module are valid for undeployment. A root TargetModuleID has no parent. A TargetModuleID with a parent can not be undeployed. A root TargetModuleID module and all its child modules will be undeployed. The root TargetModuleID module and all its child modules must stopped before they can be undeployed.

Parameters:
moduleIDList - An array of TargetModuleID objects representing the root modules to be stopped.
Returns:
ProgressObject an object that tracks and reports the status of the stop operation.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public boolean isRedeploySupported()
此方法指定此平台供应商是否提供应用程序重新部署功能。值为 true 表示支持。为 false 表示不支持。
return 值为 true 表示此供应商的 DeploymentManager 支持重新部署。为 false 表示不支持。
英文文档:

isRedeploySupported

boolean isRedeploySupported()
This method designates whether this platform vendor provides application redeployment functionality. A value of true means it is supported. False means it is not.

Returns:
A value of true means redeployment is supported by this vendor's DeploymentManager. False means it is not.

public ProgressObject redeploy(TargetModuleID[] moduleIDList, java.io.File moduleArchive, java.io.File deploymentPlan) throws UnsupportedOperationException, IllegalStateException
(可选)此重新部署方法提供一种更新当前部署的 J2EE 应用程序的手段。对于供应商实现,这是一种可选的方法。 重新部署使用更新的版本替换当前部署的应用程序。更新应用程序的运行时配置信息必须仍然与它所更新的应用程序相同。 重新部署应用程序更新时,不得中断任何现有客户端到原运行应用程序的连接,新的客户端将连接到应用程序更新。 此操作对于表示根模块的 TargetModuleID 有效。根 TargetModuleID 没有父级。根 TargetModuleID 模块及其所有子模块都将重新部署。子 TargetModuleID 无法单独重新部署。仅当完成了所有模块的重新部署操作时,此操作才算完成。
moduleIDList 要更新的应用程序标志符数组。
moduleArchive 要分发的应用程序归档文件的文件名称。
deploymentPlan 与此应用程序归档文件关联的部署配置信息。
return ProgressObject 追踪和报告重新部署操作状态的对象。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
ThrowsUnsupportedOperationException: 此实现不支持此可选命令。
英文文档:

redeploy

ProgressObject redeploy(TargetModuleID[] moduleIDList,
                        File moduleArchive,
                        File deploymentPlan)
                        throws UnsupportedOperationException,
                               IllegalStateException
(optional) The redeploy method provides a means for updating currently deployed J2EE applications. This is an optional method for vendor implementation. Redeploy replaces a currently deployed application with an updated version. The runtime configuration information for the updated application must remain identical to the application it is updating. When an application update is redeployed, all existing client connections to the original running application must not be disrupted; new clients will connect to the application update. This operation is valid for TargetModuleIDs that represent a root module. A root TargetModuleID has no parent. A root TargetModuleID module and all its child modules will be redeployed. A child TargetModuleID module cannot be individually redeployed. The redeploy operation is complete only when this action for all the modules has completed.

Parameters:
moduleIDList - An array of designators of the applications to be updated.
moduleArchive - The file name of the application archive to be disrtibuted.
deploymentPlan - The deployment configuration information associated with this application archive.
Returns:
ProgressObject an object that tracks and reports the status of the redeploy operation.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.
UnsupportedOperationException - this optional command is not supported by this implementation.

public ProgressObject redeploy(TargetModuleID[] moduleIDList, java.io.InputStream moduleArchive, java.io.InputStream deploymentPlan) throws UnsupportedOperationException, IllegalStateException
(可选)此重新部署方法提供一种更新当前部署的 J2EE 应用程序的手段。对于供应商实现,这是一种可选的方法。 重新部署使用更新的版本替换当前部署的应用程序。更新应用程序的运行时配置信息必须仍然与它所更新的应用程序相同。 重新部署应用程序更新时,不得中断任何现有客户端到原运行应用程序的连接,新的客户端将连接到应用程序更新。 此操作对于表示根模块的 TargetModuleID 有效。根 TargetModuleID 没有父级。根 TargetModuleID 模块及其所有子模块都将重新部署。子 TargetModuleID 无法单独重新部署。仅当完成了所有模块的重新部署操作时,此操作才算完成。
moduleIDList 要更新的应用程序标志符数组。
moduleArchive 包含要分发的应用程序归档文件的输入流。
deploymentPlan 包含与此应用程序归档文件关联的运行时配置信息的输入流。
return ProgressObject 追踪和报告重新部署操作状态的对象。
ThrowsIllegalStateException: 运行在断开连接模式下调用该方法时,抛出该异常。
ThrowsUnsupportedOperationException: 此实现不支持此可选命令。
英文文档:

redeploy

ProgressObject redeploy(TargetModuleID[] moduleIDList,
                        InputStream moduleArchive,
                        InputStream deploymentPlan)
                        throws UnsupportedOperationException,
                               IllegalStateException
(optional) The redeploy method provides a means for updating currently deployed J2EE applications. This is an optional method for vendor implementation. Redeploy replaces a currently deployed application with an updated version. The runtime configuration information for the updated application must remain identical to the application it is updating. When an application update is redeployed, all existing client connections to the original running application must not be disrupted; new clients will connect to the application update. This operation is valid for TargetModuleIDs that represent a root module. A root TargetModuleID has no parent. A root TargetModuleID module and all its child modules will be redeployed. A child TargetModuleID module cannot be individually redeployed. The redeploy operation is complete only when this action for all the modules has completed.

Parameters:
moduleIDList - An array of designators of the applications to be updated.
moduleArchive - The input stream containing the application archive to be disrtibuted.
deploymentPlan - The input stream containing the runtime configuration information associated with this application archive.
Returns:
ProgressObject an object that tracks and reports the status of the redeploy operation.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.
UnsupportedOperationException - this optional command is not supported by this implementation.

public void release()
release 方法是一种机制,工具采用该机制通知 DeploymentManager 无需继续连接到平台。 工具可以发出通知表示它要在断开连接模式下运行,或者它计划关闭。 调用 release 方法时,DeploymentManager 会关闭部署配置时连接的所有 J2EE 资源,并释放其他相关资源。它将不会接受任何新的操作请求(即分发、启动、停止、取消部署、重新部署)。它将完成所有当前正在处理的操作。每个与运行操作关联的 ProgressObject 都将标记为已释放(请参阅 ProgressObject)。
英文文档:

release

void release()
The release method is the mechanism by which the tool signals to the DeploymentManager that the tool does not need it to continue running connected to the platform. The tool may be signaling it wants to run in a disconnected mode or it is planning to shutdown. When release is called the DeploymentManager may close any J2EE resource connections it had for deployment configuration and perform other related resource cleanup. It should not accept any new operation requests (i.e., distribute, start stop, undeploy, redeploy. It should finish any operations that are currently in process. Each ProgressObject associated with a running operation should be marked as released (see the ProgressObject).


public java.util.Locale getDefaultLocale()
返回此 javax.enterprise.deploy.spi 子包实现所支持的默认语言环境。
return 此实现的默认语言环境 (Locale)。
英文文档:

getDefaultLocale

Locale getDefaultLocale()
Returns the default locale supported by this implementation of javax.enterprise.deploy.spi subpackages.

Returns:
Locale the default locale for this implementation.

public java.util.Locale getCurrentLocale()
返回此 javax.enterprise.deploy.spi 子包实现运行的活动语言环境。
return 此实现的活动语言环境 (Locale)。
英文文档:

getCurrentLocale

Locale getCurrentLocale()
Returns the active locale this implementation of javax.enterprise.deploy.spi subpackages is running.

Returns:
Locale the active locale of this implementation.

public void setLocale(java.util.Locale locale) throws UnsupportedOperationException
为要运行的此 javax.enterprise.deploy.spi 子包实现设置活动语言环境。
ThrowsUnsupportedOperationException: 提供的语言环境不受支持。
英文文档:

setLocale

void setLocale(Locale locale)
               throws UnsupportedOperationException
Set the active locale for this implementation of javax.enterprise.deploy.spi subpackages to run.

Throws:
UnsupportedOperationException - the provide locale is not supported.

public java.util.Locale[] getSupportedLocales()
返回此实现支持的语言环境数组。
return 支持的语言环境列表 (Locale[])。
英文文档:

getSupportedLocales

Locale[] getSupportedLocales()
Returns an array of supported locales for this implementation.

Returns:
Locale[] the list of supported locales.

public boolean isLocaleSupported(java.util.Locale locale)
报告此实现是否支持指定的语言环境。
return 值为 'true' 表示它支持;为 'false' 表示不支持。
英文文档:

isLocaleSupported

boolean isLocaleSupported(Locale locale)
Reports if this implementation supports the designated locale.

Returns:
A value of 'true' means it is support and 'false' it is not.

public DConfigBeanVersionType getDConfigBeanVersion()
返回提供配置 Bean 的 J2EE 平台版本号。这些 Bean 必须使用 J2EE 平台要求的 J2SE 版本进行了编译。
return 表示提供这些 Bean 的平台版本号的 DConfigBeanVersionType 对象。
英文文档:

getDConfigBeanVersion

DConfigBeanVersionType getDConfigBeanVersion()
Returns the J2EE platform version number for which the configuration beans are provided. The beans must have been compiled with the J2SE version required by the J2EE platform.

Returns:
a DConfigBeanVersionType object representing the platform version number for which these beans are provided.

public boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version)
如果配置 Bean 支持指定的 J2EE 平台版本,则返回 'true'。如果版本不受支持,则返回 'false'。
version 表示请求支持的 J2EE 平台版本的 DConfigBeanVersionType 对象。
return 如果版本受支持,则返回 'true';如果不受支持,则返回 'false'。
英文文档:

isDConfigBeanVersionSupported

boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version)
Returns 'true' if the configuration beans support the J2EE platform version specified. It returns 'false' if the version is not supported.

Parameters:
version - a DConfigBeanVersionType object representing the J2EE platform version for which support is requested.
Returns:
'true' if the version is supported and 'false if not.

public void setDConfigBeanVersion(DConfigBeanVersionType version) throws DConfigBeanVersionUnsupportedException
设置要用于指定 J2EE 平台版本的配置 Bean。
version 表示请求支持的 J2EE 平台版本的 DConfigBeanVersionType 对象。
ThrowsDConfigBeanVersionUnsupportedException: 如果不支持请求的 Bean 版本。
英文文档:

setDConfigBeanVersion

void setDConfigBeanVersion(DConfigBeanVersionType version)
                           throws DConfigBeanVersionUnsupportedException
Set the configuration beans to be used to the J2EE platform version specificed.

Parameters:
version - a DConfigBeanVersionType object representing the J2EE platform version for which support is requested.
Throws:
DConfigBeanVersionUnsupportedException - when the requested bean version is not supported.


Submit a bug or feature

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

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

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