Get a connection manager to use for this connection.
<p>
Called late in initialization.
<p>
Default implementation uses a shared PoolingClientConnectionManager.

@return The connection manager to use.
553605
private ClientConnectionManager getConnectionManager() {
        synchronized (this.getClass()) {
            if (sharedCM == null) {
                PoolingClientConnectionManager cm = new PoolingClientConnectionManager();
                cm.setMaxTotal(maxConnections);
                cm.setDefaultMaxPerRoute(maxConnections);
                sharedCM = cm;
            }
            return sharedCM;
        }
    }
1042379
public static ServiceManagerProvider current()
  {
    ServiceManagerProvider systemProvider = _systemProvider;
    
    if (systemProvider != null) {
      return systemProvider;
    }
    
    Thread thread = Thread.currentThread();
    ClassLoader loader = thread.getContextClassLoader();
    
    return getProvider(loader);
  }
1195005
public static BeanManager getBeanManager() {
        BeanManager mgr = getBeanManagerFromJndi();
        if (mgr == null) {
            ServiceLoader<BeanManagerProvider> loader = ServiceLoader
                .load(BeanManagerProvider.class);
            Iterator<BeanManagerProvider> it = loader.iterator();

            while (mgr == null && it.hasNext()) {
                BeanManagerProvider provider = it.next();
                mgr = provider.getBeanManager();
            }
        }

        return mgr;
    }
678632
public SICoreConnection getConnection() 
  throws SISessionUnavailableException, SISessionDroppedException
  {
    if (CoreSPIBifurcatedConsumerSession.tc.isEntryEnabled()) 
      SibTr.entry(CoreSPIBifurcatedConsumerSession.tc, "getConnection", this);
        
    // Check that this connection connection isn't closed.
    checkNotClosed();
    
    if (CoreSPIBifurcatedConsumerSession.tc.isEntryEnabled()) 
      SibTr.exit(CoreSPIBifurcatedConsumerSession.tc, "getConnection", _connection);    
    return _connection;
  }
396778
private ManagedConnectionPool getManagedConnectionPool(Credential credential)
   {
      ManagedConnectionPool mcp = pools.get(credential);

      if (mcp == null)
      {
         synchronized (this)
         {
            mcp = pools.get(credential);

            if (mcp == null)
            {
               ManagedConnectionPool newMcp = createManagedConnectionPool(credential);
               mcp = pools.putIfAbsent(credential, newMcp);
               if (mcp == null)
               {
                  mcp = newMcp;

                  if (Tracer.isEnabled())
                     Tracer.createManagedConnectionPool(poolConfiguration.getId(), mcp);
               }
               else
               {
                  newMcp.shutdown();
               }
            }
         }
      }
      return mcp;
   }
394477
private Connection getConnection(AlpineQueryManager aqm) {
        final JDOConnection jdoConnection = aqm.getPersistenceManager().getDataStoreConnection();
        if (jdoConnection != null) {
            if (jdoConnection.getNativeConnection() instanceof Connection) {
                return (Connection)jdoConnection.getNativeConnection();
            }
        }
        return null;
    }
260606
public ManagerConnection createSecureManagerConnection()
    {
        DefaultManagerConnection dmc;
        dmc = new DefaultManagerConnection(hostname, port, username, password);
        dmc.setSsl(true);
        return dmc;
    }
13180
public Object createConnectionFactory(
            final ConnectionManager connectionManager) {

        if (TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "createConnectionFactory",
                    connectionManager);
        }

        final Object connectionFactory = new SibRaConnectionFactory(this,
                connectionManager);

        if (TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "createConnectionFactory",
                    connectionFactory);
        }
        return connectionFactory;

    }
1210489
public static synchronized ChatManager getInstanceFor(XMPPConnection connection) {
        ChatManager manager = INSTANCES.get(connection);
        if (manager == null)
            manager = new ChatManager(connection);
        return manager;
    }
135032
public Connection getConnection()
    {
        Connection connection;

        try
        {
            if (getLogger().isDebugEnabled())
            {
                getLogger().debug("before: active : " + connectionPool.getNumActive() + " idle: " + connectionPool.getNumIdle());
            }
            connection = dataSource.getConnection();
            if (getLogger().isDebugEnabled())
            {
                getLogger().debug("after: active : " + connectionPool.getNumActive() + " idle: " + connectionPool.getNumIdle() + " giving " + connection);
            }
        }
        catch (Exception e)
        {
            getLogger().error("Unable to get connection " + this, e);
            throw new MithraDatabaseException("could not get connection", e);
        }
        if (connection == null)
        {
            throw new MithraDatabaseException("could not get connection"+this);
        }
        return connection;
    }
921292
public static Manager getManager(ServletContext servletContext) {
		Object managerObject = servletContext.getAttribute(SimonUtils.MANAGER_SERVLET_CTX_ATTRIBUTE);
		Manager manager = null;
		if (managerObject instanceof Manager) {
			manager =(Manager) managerObject;
		}
		return manager;
	}
746307
public static CollectionFactoryManager getInstance() {

    if (instance == null) {
      synchronized (CollectionFactoryManagerImpl.class) {
        if (instance == null) {
          CollectionFactoryManagerImpl manager = new CollectionFactoryManagerImpl();
          manager.initialize();
          instance = manager;
        }
      }
    }
    return instance;
  }
714756
public static ConnectionHolder getConnectionHolder(ConsumerBootstrap consumerBootstrap) {
        try {
            String connectionHolder = consumerBootstrap.getConsumerConfig().getConnectionHolder();
            ExtensionClass<ConnectionHolder> ext = ExtensionLoaderFactory
                .getExtensionLoader(ConnectionHolder.class).getExtensionClass(connectionHolder);
            if (ext == null) {
                throw ExceptionUtils.buildRuntime("consumer.connectionHolder", connectionHolder,
                    "Unsupported connectionHolder of client!");
            }
            return ext.getExtInstance(new Class[] { ConsumerBootstrap.class }, new Object[] { consumerBootstrap });
        } catch (SofaRpcRuntimeException e) {
            throw e;
        } catch (Throwable e) {
            throw new SofaRpcRuntimeException(e.getMessage(), e);
        }
    }
397137
public ConnectionPool getPool() throws ConnectionPoolNotFoundException {
        ConnectionPool connectionPool = null;

        try {
            if (h_ConnectionPools.containsKey(defaultPoolName)) {
                connectionPool = h_ConnectionPools.get(defaultPoolName);
            } else {
                // Error: default pool was never initialized or could not be found
                throw new ConnectionPoolNotFoundException("Default connection pool "
                        + "not found: " + defaultPoolName);
            }

        } catch (Throwable th) {
            throw new ConnectionPoolNotFoundException("The default connection "
                    + "pool \"" + defaultPoolName
                    + "\" could not be found. The " + "underlying error was a "
                    + th.getClass().getName() + "The message was \""
                    + th.getMessage() + "\".");
        }

        return connectionPool;
    }
1142419
@Override
    public SICoreConnection getConnection() throws SISessionUnavailableException
    {
        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConsumerSession.tc.isEntryEnabled())
            SibTr.entry(CoreSPIConsumerSession.tc, "getConnection", this);

        checkNotClosed();

        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConsumerSession.tc.isEntryEnabled())
            SibTr.exit(CoreSPIConsumerSession.tc, "getConnection", _connection);
        //Return the connection used to create this consumer session
        return _connection;
    }
103055
public static WsByteBufferPoolManager getBufferManager() {
        final CHFWBundle chfw = getCHFWBundle();
        if (null == chfw) {
            return ChannelFrameworkFactory.getBufferManager();
        }
        return chfw.getBufferManager();
    }
96369
public final Connection getConnection() throws SQLException {

      final Timer.Context ctx = acquisitions.time();

      try {

         Connection conn;
         for(int i = 0; i < activeSegments; i++) {
            conn = segments[i].open();
            if(conn != null) {
               return conn;
            }
         }

         //All connections for active segments were in-use.
         //Send signal to attempt to activate a new segment then
         //try the active segments in-order (again) with the acquire time-out.

         signalActivateSegment();

         try {

            for(int i = 0; i < activeSegments; i++) {
               ConnectionPoolSegment segment = segments[i];
               conn = segment.open(segment.acquireTimeoutMillis, TimeUnit.MILLISECONDS);
               if(conn != null) {
                  return conn;
               }
            }

         } catch(InterruptedException ie) {
            Thread.currentThread().interrupt();
            throw new SQLException("Connection pool, '" + name + "' interrupted during acquire", JDBConnection.SQLSTATE_CONNECTION_EXCEPTION);
         }

         //Try all pools again with maximum acquire timeout.

         long maxTimeoutMillis = saturatedAcquireTimeoutMillis / activeSegments;

         try {

            for(int i = 0; i < activeSegments; i++) {
               ConnectionPoolSegment segment = segments[i];
               conn = segment.open(maxTimeoutMillis, TimeUnit.MILLISECONDS);
               if(conn != null) {
                  return conn;
               }
            }

         } catch(InterruptedException ie) {
            Thread.currentThread().interrupt();
            throw new SQLException("Connection pool, '" + name + "' interrupted during acquire", JDBConnection.SQLSTATE_CONNECTION_EXCEPTION);
         }

         //Done trying

         failedAcquisitions.mark();

         throw new SQLException(SATURATED_MESSAGE, JDBConnection.SQLSTATE_CONNECTION_FAILURE);

      } finally {
         ctx.stop();
      }
   }