DeploymentFactoryManager (Java EE 5)

Java EE API


javax.enterprise.deploy.shared.factories Class DeploymentFactoryManager

java.lang.Object
  extended by javax.enterprise.deploy.shared.factories.DeploymentFactoryManager

public final class DeploymentFactoryManager
extends Object


DeploymentFactoryManager 类是 J2EE DeploymentFactory 对象的集中注册表。DeploymentFactoryManager 保留对工具所加载的 DeploymentFactory 对象的引用。DeploymentFactory 对象提供一个对 DeploymentManager 的引用。 DeploymentFactoryManager 被作为单件实现。工具通过 getInstance 方法获取对 DeploymentFactoryManager 的引用。 DeploymentFactoryManager 可以返回两种类型的 DeploymentManager:连接的 DeploymentManager 与断开连接的 DeploymentManager。连接的 DeploymentManager 可以访问配置和部署时可能需要的任何产品资源。获取连接 DeploymentManager 的方法是 getDeploymentManager。此方法提供用户名和密码参数,产品进行用户验证时可能需要这些信息。断开连接的 DeploymentManager 不提供对运行 J2EE 产品的访问。获取断开连接 DeploymentManager 的方法是 getDisconnectedDeploymentManager。断开连接的 DeploymentManager 不需要用户验证信息。
英文文档:

The DeploymentFactoryManager class is a central registry for J2EE DeploymentFactory objects. The DeploymentFactoryManager retains references to DeploymentFactory objects loaded by a tool. A DeploymentFactory object provides a reference to a DeploymentManager. The DeploymentFactoryManager has been implemented as a singleton. A tool gets a reference to the DeploymentFactoryManager via the getInstance method. The DeploymentFactoryManager can return two types of DeploymentManagers, a connected DeploymentManager and a disconnected DeploymentManager. The connected DeploymentManager provides access to any product resources that may be required for configurations and deployment. The method to retrieve a connected DeploymentManager is getDeploymentManager. This method provides parameters for user name and password that the product may require for user authentication. A disconnected DeploymentManager does not provide access to a running J2EE product. The method to retrieve a disconnected DeploymentManager is getDisconnectedDeploymentManager. A disconnected DeploymentManager does not need user authentication information.


Method Summary
 DeploymentFactory[]
 DeploymentManager
 DeploymentManager
static DeploymentFactoryManager
 void
 
Methods inherited from class java.lang.Object
 

Method Detail

public static DeploymentFactoryManager getInstance()
获取单件 DeploymentFactoryManager。
return DeploymentFactoryManager 实例
英文文档:

getInstance

public static DeploymentFactoryManager getInstance()
Retrieve the Singleton DeploymentFactoryManager

Returns:
DeploymentFactoryManager instance

public DeploymentFactory[] getDeploymentFactories()
获取当前已注册的 DeploymentFactory 列表。
return DeploymentFactory 对象列表;如果没有,则返回一个空数组。
英文文档:

getDeploymentFactories

public DeploymentFactory[] getDeploymentFactories()
Retrieve the lists of currently registered DeploymentFactories.

Returns:
the list of DeploymentFactory objects or an empty array if there are none.

public DeploymentManager getDeploymentManager(String uri, String username, String password) throws DeploymentManagerCreationException
获取一个用于部署的 DeploymentManager 实例。调用者提供一个 URI 及可选的用户名和密码,所有已注册的 DeploymentFactory 都将被检查。第一个理解所给 URI 的 DeploymentFactory 将尝试启动一个服务器连接,并返回一个就绪的 DeploymentManager 实例。
uri 要检查的 URI。
username 可选用户名(如果此平台不需要验证,则为 null)。
password 可选密码(如果此平台不需要验证,则为 null)。
return 就绪的 DeploymentManager 实例。
ThrowsDeploymentManagerCreationException: 当指定 URI 相应的工厂无法初始化 DeploymentManager 实例时(服务器出现故障、无法验证等等)。
英文文档:

getDeploymentManager

public DeploymentManager getDeploymentManager(String uri,
                                              String username,
                                              String password)
                                       throws DeploymentManagerCreationException
Retrieves a DeploymentManager instance to use for deployment. The caller provides a URI and optional username and password, and all registered DeploymentFactories will be checked. The first one to understand the URI provided will attempt to initiate a server connection and return a ready DeploymentManager instance.

Parameters:
uri - The uri to check
username - An optional username (may be null if no authentication is required for this platform).
password - An optional password (may be null if no authentication is required for this platform).
Returns:
A ready DeploymentManager instance.
Throws:
DeploymentManagerCreationException - Occurs when the factory appropriate to the specified URI was unable to initialize a DeploymentManager instance (server down, unable to authenticate, etc.).

public void registerDeploymentFactory(DeploymentFactory factory)
注册一个 DeploymentFactory,以便它能处理请求。
英文文档:

registerDeploymentFactory

public void registerDeploymentFactory(DeploymentFactory factory)
Registers a DeploymentFactory so it will be able to handle requests.


public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException
返回一个断开连接的 DeploymentManager 实例。
uri 要返回的断开连接 DeploymentManager 的标识符。
return DeploymentManager 实例。
ThrowsDeploymentDriverException: 如果无法创建 DeploymentManager。
英文文档:

getDisconnectedDeploymentManager

public DeploymentManager getDisconnectedDeploymentManager(String uri)
                                                   throws DeploymentManagerCreationException
Return a disconnected DeploymentManager instance.

Parameters:
uri - identifier of the disconnected DeploymentManager to return.
Returns:
A DeploymentManager instance.
Throws:
DeploymentDriverException - occurs if the DeploymentManager could not be created.
DeploymentManagerCreationException


Submit a bug or feature

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

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

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