DeploymentFactory (Java EE 5)

Java EE API


javax.enterprise.deploy.spi.factories Interface DeploymentFactory


public interface DeploymentFactory


DeploymentFactory 接口是 J2EE 平台产品的部署驱动程序。它返回一个 DeploymentManager 对象,该对象表示一个到特定 J2EE 平台产品的连接。

每个应用服务器供应商都必须提供此类的实现,以便 J2EE Deployment API 处理他们的产品。

实现此接口的类应该有一个公共的无参数构造方法,并且应该是无状态的(该类的两个实例的行为应该始终相同)。建议该类拥有一个静态初始化程序(但这不是必需的),该程序可向 DeploymentFactoryManager 类注册一个类实例。

可以请求一个连接断开的 DeploymentManager。在连接平台的情况下运行的 DeploymentManager 能够访问 J2EE 资源。在断开连接的情况下运行的 DeploymentManager 仅提供模块部署配置支持。

英文文档:

The DeploymentFactory interface is a deployment driver for a J2EE plaform product. It returns a DeploymentManager object which represents a connection to a specific J2EE platform product.

Each application server vendor must provide an implementation of this class in order for the J2EE Deployment API to work with their product.

The class implementing this interface should have a public no-argument constructor, and it should be stateless (two instances of the class should always behave the same). It is suggested but not required that the class have a static initializer that registers an instance of the class with the DeploymentFactoryManager class.

A connected or disconnected DeploymentManager can be requested. A DeploymentManager that runs connected to the platform can provide access to J2EE resources. A DeploymentManager that runs disconnected only provides module deployment configuration support.

See Also:
DeploymentFactoryManager

Method Summary
 DeploymentManager
 DeploymentManager
 String
 String
 boolean
 

Method Detail

public boolean handlesURI(String uri)
测试此工厂是否能够根据指定的 URI 创建 DeploymentManager 对象。此方法并不能指出这种尝试能否成功,仅能指出工厂能否处理该 URI。
uri 要检查的 URI。
return 如果工厂能够处理该 URI,则返回 true
英文文档:

handlesURI

boolean handlesURI(String uri)
Tests whether this factory can create a DeploymentManager object based on the specificed URI. This does not indicate whether such an attempt will be successful, only whether the factory can handle the uri.

Parameters:
uri - The uri to check
Returns:
true if the factory can handle the uri.

public DeploymentManager getDeploymentManager(String uri, String username, String password) throws DeploymentManagerCreationException
返回一个连接的 DeploymentManager 实例。
uri 表示连接参数的 URI
username 可选用户名(如果此平台不需要验证,则为 null)。
password 可选密码(如果此平台不需要验证,则为 null)。
return 就绪的 DeploymentManager 实例。
ThrowsDeploymentManagerCreationException: 无法返回 DeploymentManager 时(服务器关闭、无法进行验证等)发生。
英文文档:

getDeploymentManager

DeploymentManager getDeploymentManager(String uri,
                                       String username,
                                       String password)
                                       throws DeploymentManagerCreationException
Return a connected DeploymentManager instance.

Parameters:
uri - The URI that specifies the connection parameters
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 a DeploymentManager could not be returned (server down, unable to authenticate, etc).

public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException
返回一个断开连接的 DeploymentManager 实例。
uri 要返回的 DeploymentManager 的 URI。
return DeploymentManager 断开的实例。
ThrowsDeploymentManagerCreationException: 无法创建 DeploymentManager 时发生。
英文文档:

getDisconnectedDeploymentManager

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

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

public String getDisplayName()
提供包含此供应商 DeploymentManager 的名称的字符串。
return 供应商 DeploymentManager 的名称。
英文文档:

getDisplayName

String getDisplayName()
Provide a string with the name of this vendor's DeploymentManager.

Returns:
the name of the vendor's DeploymentManager.

public String getProductVersion()
提供标识此供应商 DeploymentManager 的版本的字符串。
return 供应商 DeploymentManager 的名称。
英文文档:

getProductVersion

String getProductVersion()
Provide a string identifying version of this vendor's DeploymentManager.

Returns:
the name of the vendor's DeploymentManager.


Submit a bug or feature

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

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

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