当前位置: 首页>>代码示例>>Java>>正文


Java ManagedConnectionFactory.createManagedConnection方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:26,代码来源:ActiveMQRAConnectionManager.java

示例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;
}
 
开发者ID:vratsel,项目名称:generic-jms-ra,代码行数:24,代码来源:JmsConnectionManager.java

示例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);
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:8,代码来源:OTMConnectionManager.java

示例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);
}
 
开发者ID:ops4j,项目名称:org.ops4j.pax.transx,代码行数:10,代码来源:SimpleConnectionManager.java

示例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);
}
 
开发者ID:agito-it,项目名称:activiti-jobexecutor-ee,代码行数:6,代码来源:DefaultConnectionManager.java


注:本文中的javax.resource.spi.ManagedConnectionFactory.createManagedConnection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。