|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.resource.spi Interface ManagedConnectionFactory
- All Superinterfaces:
- Serializable
public interface ManagedConnectionFactory
- extends Serializable
ManagedConnectionFactory 实例是 ManagedConnection 和特定于 EIS 连接工厂实例的工厂。此接口提供匹配和创建 ManagedConnection 实例的方法,以支持连接入池。ManagedConnectionFactory 实例必须是 JavaBean。
version | 0.6 |
See also | javax.resource.spi.ManagedConnection |
ManagedConnectionFactory instance is a factory of both ManagedConnection and EIS-specific connection factory instances. This interface supports connection pooling by providing methods for matching and creation of ManagedConnection instance. A ManagedConnectionFactory instance is required to be a JavaBean.
- Version:
- 0.6
- Author:
- Rahul Sharma
- See Also:
ManagedConnection
Method Summary | |
---|---|
Object |
createConnectionFactory()
Creates a Connection Factory instance. |
Object |
createConnectionFactory(ConnectionManager cxManager)
Creates a Connection Factory instance. |
ManagedConnection |
createManagedConnection(Subject subject,
ConnectionRequestInfo cxRequestInfo)
Creates a new physical connection to the underlying EIS resource manager. |
boolean |
equals(Object other)
Check if this ManagedConnectionFactory is equal to another ManagedConnectionFactory. |
PrintWriter |
getLogWriter()
Get the log writer for this ManagedConnectionFactory instance. |
int |
hashCode()
Returns the hash code for the ManagedConnectionFactory |
ManagedConnection |
matchManagedConnections(Set connectionSet,
Subject subject,
ConnectionRequestInfo cxRequestInfo)
Returns a matched connection from the candidate set of connections. |
void |
setLogWriter(PrintWriter out)
Set the log writer for this ManagedConnectionFactory instance. |
Method Detail |
---|
public Object
createConnectionFactory(ConnectionManager cxManager) throws ResourceException
创建一个 Connection Factory 实例。Connection Factory 实例使用传递的 ConnectionManager 进行初始化。在托管情况下,ConnectionManager 由应用服务器提供。
cxManager | 要与创建的 EIS 连接工厂实例关联的 ConnectionManager |
return | 特定于 EIS 的 Connection Factory 实例或 javax.resource.cci.ConnectionFactory 实例 |
Throws | ResourceException: 一般异常 |
Throws | ResourceAdapterInternalException: 与资源适配器有关的错误情况 |
createConnectionFactory
Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
- Creates a Connection Factory instance. The Connection Factory
instance gets initialized with the passed ConnectionManager. In
the managed scenario, ConnectionManager is provided by the
application server.
- Parameters:
cxManager
- ConnectionManager to be associated with created EIS connection factory instance- Returns:
- EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
- Throws:
ResourceException
- Generic exceptionResourceAdapterInternalException
- Resource adapter related error condition
public Object
createConnectionFactory() throws ResourceException
创建一个 Connection Factory 实例。Connection Factory 实例使用资源适配器提供的默认 ConnectionManager 进行初始化。
return | 特定于 EIS 的 Connection Factory 实例或 javax.resource.cci.ConnectionFactory 实例 |
Throws | ResourceException: 一般异常 |
Throws | ResourceAdapterInternalException: 与资源适配器有关的错误情况 |
createConnectionFactory
Object createConnectionFactory() throws ResourceException
- Creates a Connection Factory instance. The Connection Factory
instance gets initialized with a default ConnectionManager provided
by the resource adapter.
- Returns:
- EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
- Throws:
ResourceException
- Generic exceptionResourceAdapterInternalException
- Resource adapter related error condition
public ManagedConnection
createManagedConnection(javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
创建一个连接底层 EIS 资源管理器的新物理连接。
ManagedConnectionFactory 使用安全信息(作为 Subject 传递)和其他 ConnectionRequestInfo(特定于 ResourceAdapter 并且对应用服务器不透明)创建此新连接。
subject | 调用者的安全信息 |
cxRequestInfo | 特定于其他资源适配器的连接请求信息 |
Throws | ResourceException: 一般异常 |
Throws | SecurityException: 与安全有关的错误 |
Throws | ResourceAllocationException: 无法为连接请求分配系统资源 |
Throws | ResourceAdapterInternalException: 与资源适配器相关的错误情况 |
Throws | EISSystemException: EIS 实例中的内部错误情况 |
return | ManagedConnection 实例 |
createManagedConnection
ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
- Creates a new physical connection to the underlying EIS
resource manager.
ManagedConnectionFactory uses the security information (passed as Subject) and additional ConnectionRequestInfo (which is specific to ResourceAdapter and opaque to application server) to create this new connection.
- Parameters:
subject
- Caller's security informationcxRequestInfo
- Additional resource adapter specific connection request information- Returns:
- ManagedConnection instance
- Throws:
ResourceException
- generic exceptionSecurityException
- security related errorResourceAllocationException
- failed to allocate system resources for connection requestResourceAdapterInternalException
- resource adapter related error conditionEISSystemException
- internal error condition in EIS instance
public ManagedConnection
matchManagedConnections(java.util.Set<E> connectionSet, javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
返回候选连接集中的匹配连接。
返回候选连接集中的匹配连接。
ManagedConnectionFactory 使用安全信息(如 Subject 中的信息)、通过 ConnectionRequestInfo 提供的信息以及特定于其他资源适配器的标准执行匹配。注意,用于匹配的标准是特定于资源适配器的,不是 Connector 规范指定的。
此方法返回一个 ManagedConnection 实例,该实例是处理连接分配请求的最佳匹配。
connectionSet | 候选连接集 |
subject | 调用者的安全信息 |
cxRequestInfo | 特定于其他资源适配器的连接请求信息 |
Throws | ResourceException: 一般异常 |
Throws | SecurityException: 与安全有关的错误 |
Throws | ResourceAdapterInternalException: 与资源适配器相关的错误情况 |
Throws | NotSupportedException: 如果不支持该操作 |
return | 如果资源适配器找到一个可接受的匹配项,则返回 ManagedConnection;否则返回 null |
matchManagedConnections
ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
- Returns a matched connection from the candidate set of connections.
ManagedConnectionFactory uses the security info (as in Subject) and information provided through ConnectionRequestInfo and additional Resource Adapter specific criteria to do matching. Note that criteria used for matching is specific to a resource adapter and is not prescribed by the Connector specification.
This method returns a ManagedConnection instance that is the best match for handling the connection allocation request.
- Parameters:
connectionSet
- candidate connection setsubject
- caller's security informationcxRequestInfo
- additional resource adapter specific connection request information- Returns:
- ManagedConnection if resource adapter finds an acceptable match otherwise null
- Throws:
ResourceException
- generic exceptionSecurityException
- security related errorResourceAdapterInternalException
- resource adapter related error conditionNotSupportedException
- if operation is not supported
public void
setLogWriter(java.io.PrintWriter out) throws ResourceException
设置此 ManagedConnectionFactory 实例的日志 writer。
日志 writer 是一个字符输出流,此 ManagedConnectionfactory 实例的所有记录和跟踪消息都将打印到该输出流。
ApplicationServer 管理输出流与 ManagedConnectionFactory 的关联。创建 ManagedConnectionFactory 对象时,日志 writer 最初为 null,即禁用日志记录。将日志 writer 与 ManagedConnectionFactory 关联之后,将启用 ManagedConnectionFactory 实例的记录和跟踪。
ManagedConnectionFactory 创建的 ManagedConnection 实例“继承”该日志 writer,ApplicationServer 可以使用 ManagedConnection.setLogWriter 将其重写,以设置特定于 ManagedConnection 的记录和跟踪。
out | 一个 PrintWriter,即用于记录错误和跟踪错误的输出流 |
Throws | ResourceException: 一般异常 |
Throws | ResourceAdapterInternalException: 与资源适配器相关的错误情况 |
setLogWriter
void setLogWriter(PrintWriter out) throws ResourceException
- Set the log writer for this ManagedConnectionFactory instance.
The log writer is a character output stream to which all logging and tracing messages for this ManagedConnectionfactory instance will be printed.
ApplicationServer manages the association of output stream with the ManagedConnectionFactory. When a ManagedConnectionFactory object is created the log writer is initially null, in other words, logging is disabled. Once a log writer is associated with a ManagedConnectionFactory, logging and tracing for ManagedConnectionFactory instance is enabled.
The ManagedConnection instances created by ManagedConnectionFactory "inherits" the log writer, which can be overridden by ApplicationServer using ManagedConnection.setLogWriter to set ManagedConnection specific logging and tracing.
- Parameters:
out
- PrintWriter - an out stream for error logging and tracing- Throws:
ResourceException
- generic exceptionResourceAdapterInternalException
- resource adapter related error condition
public java.io.PrintWriter
getLogWriter() throws ResourceException
获取此 ManagedConnectionFactory 实例的日志 writer。
日志 writer 是一个字符输出流,此 ManagedConnectionFactory 实例的所有记录和跟踪消息都将打印到该输出流。
ApplicationServer 管理输出流与 ManagedConnectionFactory 的关联。创建 ManagedConnectionFactory 对象时,日志 writer 最初为 null,即禁用日志记录。
return |
| |
Throws | ResourceException: 一般异常 |
getLogWriter
PrintWriter getLogWriter() throws ResourceException
- Get the log writer for this ManagedConnectionFactory instance.
The log writer is a character output stream to which all logging and tracing messages for this ManagedConnectionFactory instance will be printed
ApplicationServer manages the association of output stream with the ManagedConnectionFactory. When a ManagedConnectionFactory object is created the log writer is initially null, in other words, logging is disabled.
- Returns:
- PrintWriter
- Throws:
ResourceException
- generic exception
public int
hashCode()
返回 ManagedConnectionFactory 的哈希码
return | ManagedConnectionFactory 的哈希码 |
hashCode
int hashCode()
- Returns the hash code for the ManagedConnectionFactory
- Returns:
- hash code for the ManagedConnectionFactory
public boolean
equals(Object other)
检查此 ManagedConnectionFactory 是否等于另一个 ManagedConnectionFactory。
return | 如果两个实例相等,则返回 true |
equals
boolean equals(Object other)
- Check if this ManagedConnectionFactory is equal to another
ManagedConnectionFactory.
- Returns:
- true if two instances are equal
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!