Package org.apache.geronimo.interop.util

Examples of org.apache.geronimo.interop.util.InstancePool


    private HashMap             poolMap;

    public Connection get(int protocol, String endpoint, ObjectRef objectRef) {
        //System.out.println("ConnectionPool.get(): protocol: " + protocol + ", endpoint: " + endpoint + ", objectRef: " + objectRef);

        InstancePool pool = getInstancePool(protocol, endpoint);
        System.out.println("ConnectionPool.get(): pool: " + pool);
        Connection conn = (Connection) pool.get();
        if (conn == null) {
            conn = newConnection(protocol, endpoint, objectRef, pool);
        }
        return conn;
View Full Code Here


    }

    protected InstancePool getInstancePool(final int protocol, final String endpoint) {
        System.out.println("ConnectionPool.getInstancePool(): protocol: " + protocol + ", endpoint: " + endpoint);

        InstancePool pool = (InstancePool) poolMap.get(endpoint);
        if (pool == null) {
            synchronized (poolMap) {
                pool = (InstancePool) poolMap.get(endpoint);
                if (pool == null) {
                    String poolName = Protocol.getName(protocol) + "://" + endpoint;
                    pool = new InstancePool(poolName);
                    poolMap.put(endpoint, pool);
                }
            }
        }
        return pool;
View Full Code Here

TOP

Related Classes of org.apache.geronimo.interop.util.InstancePool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.