Search in sources :

Example 1 with NoTxConnectorAllocator

use of com.sun.enterprise.resource.allocator.NoTxConnectorAllocator in project Payara by payara.

the class ConnectionManagerImpl method getResource.

private Object getResource(int txLevel, PoolManager poolmgr, ManagedConnectionFactory mcf, ResourceSpec spec, Subject subject, ConnectionRequestInfo cxRequestInfo, ClientSecurityInfo info, ConnectorDescriptor desc, boolean shareable) throws PoolingException, ResourceAllocationException, IllegalStateException, RetryableUnavailableException {
    ResourceAllocator alloc;
    switch(txLevel) {
        case ConnectorConstants.NO_TRANSACTION_INT:
            alloc = new NoTxConnectorAllocator(poolmgr, mcf, spec, subject, cxRequestInfo, info, desc);
            break;
        case ConnectorConstants.LOCAL_TRANSACTION_INT:
            alloc = new LocalTxConnectorAllocator(poolmgr, mcf, spec, subject, cxRequestInfo, info, desc, shareable);
            break;
        case ConnectorConstants.XA_TRANSACTION_INT:
            if (rarName.equals(ConnectorRuntime.DEFAULT_JMS_ADAPTER)) {
                shareable = false;
            }
            spec.markAsXA();
            alloc = new ConnectorAllocator(poolmgr, mcf, spec, subject, cxRequestInfo, info, desc, shareable);
            return poolmgr.getResource(spec, alloc, info);
        default:
            String i18nMsg = getLocalStrings().getString("con_mgr.illegal_tx_level", txLevel + " ");
            throw new IllegalStateException(i18nMsg);
    }
    return poolmgr.getResource(spec, alloc, info);
}
Also used : NoTxConnectorAllocator(com.sun.enterprise.resource.allocator.NoTxConnectorAllocator) ConnectorAllocator(com.sun.enterprise.resource.allocator.ConnectorAllocator) LocalTxConnectorAllocator(com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator) IllegalStateException(javax.resource.spi.IllegalStateException) NoTxConnectorAllocator(com.sun.enterprise.resource.allocator.NoTxConnectorAllocator) LocalTxConnectorAllocator(com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator) ResourceAllocator(com.sun.enterprise.resource.allocator.ResourceAllocator)

Aggregations

ConnectorAllocator (com.sun.enterprise.resource.allocator.ConnectorAllocator)1 LocalTxConnectorAllocator (com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator)1 NoTxConnectorAllocator (com.sun.enterprise.resource.allocator.NoTxConnectorAllocator)1 ResourceAllocator (com.sun.enterprise.resource.allocator.ResourceAllocator)1 IllegalStateException (javax.resource.spi.IllegalStateException)1