本文整理汇总了Java中javax.resource.spi.ManagedConnectionFactory.createManagedConnection方法的典型用法代码示例。如果您正苦于以下问题:Java ManagedConnectionFactory.createManagedConnection方法的具体用法?Java ManagedConnectionFactory.createManagedConnection怎么用?Java ManagedConnectionFactory.createManagedConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.resource.spi.ManagedConnectionFactory
的用法示例。
在下文中一共展示了ManagedConnectionFactory.createManagedConnection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: allocateConnection
import javax.resource.spi.ManagedConnectionFactory; //导入方法依赖的package包/类
/**
* Allocates a connection
*
* @param mcf The managed connection factory
* @param cxRequestInfo The connection request information
* @return The connection
* @throws ResourceException Thrown if there is a problem obtaining the connection
*/
@Override
public Object allocateConnection(final ManagedConnectionFactory mcf,
final ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if (ActiveMQRAConnectionManager.trace) {
ActiveMQRALogger.LOGGER.trace("allocateConnection(" + mcf + ", " + cxRequestInfo + ")");
}
ManagedConnection mc = mcf.createManagedConnection(null, cxRequestInfo);
Object c = mc.getConnection(null, cxRequestInfo);
if (ActiveMQRAConnectionManager.trace) {
ActiveMQRALogger.LOGGER.trace("Allocated connection: " + c + ", with managed connection: " + mc);
}
connections.add(mc);
return c;
}
示例2: allocateConnection
import javax.resource.spi.ManagedConnectionFactory; //导入方法依赖的package包/类
/**
* Allocate a new connection.
*
* @param mcf
* @param cxRequestInfo
* @return A new connection
* @throws ResourceException Failed to create connection.
*/
public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
boolean trace = log.isTraceEnabled();
if (trace) {
log.trace("Allocating connection; mcf=" + mcf + ", cxRequestInfo=" + cxRequestInfo);
}
ManagedConnection mc = mcf.createManagedConnection(null, cxRequestInfo);
Object c = mc.getConnection(null, cxRequestInfo);
if (trace) {
log.trace("Allocated connection: " + c + ", with managed connection: " + mc);
}
return c;
}
示例3: allocateConnection
import javax.resource.spi.ManagedConnectionFactory; //导入方法依赖的package包/类
public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo info)
throws ResourceException
{
Util.log("In OTMConnectionManager.allocateConnection");
ManagedConnection mc = mcf.createManagedConnection(null, info);
return mc.getConnection(null, info);
}
示例4: allocateConnection
import javax.resource.spi.ManagedConnectionFactory; //导入方法依赖的package包/类
/**
* @see javax.resource.spi.ConnectionManager#allocateConnection(javax.resource.spi.ManagedConnectionFactory,
* javax.resource.spi.ConnectionRequestInfo)
*/
public Object allocateConnection(ManagedConnectionFactory connectionFactory, ConnectionRequestInfo info) throws ResourceException {
ManagedConnection connection = connectionFactory.createManagedConnection(null, info);
connection.addConnectionEventListener(this);
return connection.getConnection(null, info);
}
示例5: allocateConnection
import javax.resource.spi.ManagedConnectionFactory; //导入方法依赖的package包/类
@Override
public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cri) throws ResourceException {
ManagedConnection mc = mcf.createManagedConnection(null, cri);
return mc.getConnection(null, cri);
}