/** * Retrieve MCF instance pertaining to the poolName from the registry. * * @param poolInfo Name of the pool * @return factory MCF instance retrieved. */ public ManagedConnectionFactory getManagedConnectionFactory( PoolInfo poolInfo) { if (poolInfo != null) { if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Returning the MCF from connector registry.", poolInfo); } PoolMetaData pmd = factories.get(poolInfo); if (pmd != null) { return pmd.getMCF(); } } return null; }
/** Gets the runtime equivalent of policies enforced by the Security Maps * pertaining to a pool from the Pool's Meta Data. * @param poolInfo pool information * @return runtimeSecurityMap in the form of HashMap of * HashMaps (user and groups). * @see SecurityMapUtils.processSecurityMaps(SecurityMap[]) */ public RuntimeSecurityMap getRuntimeSecurityMap(PoolInfo poolInfo) { if(poolInfo != null) { if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Returing the security map from connector registry.", poolInfo); } PoolMetaData pmd = factories.get(poolInfo); return pmd.getRuntimeSecurityMap(); } else { return null; } }
public ResourceSpec(String resourceId, int resourceIdType, PoolMetaData pmd) { this(resourceId, resourceIdType); if ( pmd.isPM() ) { pmResource = true; } if (pmd.isNonTx()) { nonTxResource = true; } if( pmd.isLazyEnlistable() && !nonTxResource && !pmResource ) { lazyEnlistable_ = true; } if ( pmd.isLazyAssociatable() && !nonTxResource && !pmResource) { lazyAssociatable_ = true; //The rationale behind doing this is that in the PoolManagerImpl //when we return from getResource called by associateConnections, //enlistment should happen immediately since we are associating on //first use anyway, lazyEnlistable_ = false; } }
ResourceSpec.JNDI_NAME, pmd); spec.setPoolInfo(this.poolInfo); ManagedConnectionFactory freshMCF = pmd.getMCF(); boolean subjectDefined = false; if (isUnknownAuth && rarName.equals(ConnectorConstants.DEFAULT_JMS_ADAPTER) && !(pmd.isAuthCredentialsDefinedInPool())) { info = new ClientSecurityInfo(prin); if (prin.equals(defaultPrin)) { subject = pmd.getSubject(); } else { subject = ConnectionPoolObjectsUtils.createSubject(mcf, prin); int txLevel = pmd.getTransactionSupport(); if (getLogger().isLoggable(Level.FINE)) { logFine("ConnectionMgr: poolName " + poolInfo +
public static ConnectionManager getAvailableConnectionManager( PoolInfo poolInfo, boolean forceNoLazyAssoc, ResourceInfo resourceInfo) throws ConnectorRuntimeException { ConnectorRegistry registry = ConnectorRegistry.getInstance(); PoolMetaData pmd = registry.getPoolMetaData(poolInfo); boolean isLazyEnlist = pmd.isLazyEnlistable(); boolean isLazyAssoc = pmd.isLazyAssociatable(); ConnectionManagerImpl mgr = null; if (isLazyAssoc && !forceNoLazyAssoc) { logFine("Creating LazyAssociatableConnectionManager"); mgr = new LazyAssociatableConnectionManagerImpl(poolInfo, resourceInfo); }else if (isLazyEnlist) { logFine("Creating LazyEnlistableConnectionManager"); mgr = new LazyEnlistableConnectionManagerImpl(poolInfo, resourceInfo); } else { logFine("Creating plain ConnectionManager"); mgr = new ConnectionManagerImpl(poolInfo, resourceInfo); } return mgr; }
PoolMetaData pmd = new PoolMetaData(poolInfo, mcf, s, txSupport, prin, isPM, isNonTx, lazyEnlistable, runtimeSecurityMap, lazyAssoc); logFine(pmd.toString()); _registry.addManagedConnectionFactory(poolInfo, pmd);
public void initialize() throws ConnectorRuntimeException { ConnectorRuntime runtime = ConnectorRuntime.getRuntime(); if(runtime.isNonACCRuntime()){ jndiName = ConnectorsUtil.getPMJndiName(jndiName); } ConnectorRegistry registry = ConnectorRegistry.getInstance(); PoolMetaData pmd = registry.getPoolMetaData(poolInfo); defaultPrin = pmd.getResourcePrincipal(); }