Examples of Pool


Examples of com.sun.jndi.ldap.pool.Pool

        String authMech, Control[] ctls, String protocol, String user,
        Object passwd, Hashtable env) throws NamingException {

        // Create base identity for LdapClient
        ClientId id = null;
        Pool pool;

        int p = findPool(authMech);
        if (p < 0 || (pool=pools[p]) == null) {
            throw new IllegalArgumentException(
                "Attempting to use pooling for an unsupported mechanism: " +
                authMech);
        }
        switch (p) {
        case NONE:
            id = new ClientId(version, host, port, protocol,
                        ctls, trace, socketFactory);
            break;

        case SIMPLE:
            // Add identity information used in simple authentication
            id = new SimpleClientId(version, host, port, protocol,
                ctls, trace, socketFactory, user, passwd);
            break;

        case DIGEST:
            // Add user/passwd/realm/authzid/qop/strength/maxbuf/mutual/policy*
            id = new DigestClientId(version, host, port, protocol,
                ctls, trace, socketFactory, user, passwd, env);
            break;
        }

        return (LdapClient) pool.getPooledConnection(id, connTimeout,
            new LdapClientFactory(host, port, socketFactory, connTimeout,
                                readTimeout, trace));
    }
View Full Code Here

Examples of com.sun.tools.javac.jvm.Pool

                    new Pair<Symbol.MethodSymbol, Attribute>(profileValue, new Attribute.Constant(syms.intType, i))));
        }

        Type.moreInfo = true;
        Types types = Types.instance(task.getContext());
        Pool pool = new Pool(types);
        for (JavaFileObject file : fm.list(jarLocation, "", EnumSet.of(CLASS), true)) {
            String className = fm.inferBinaryName(jarLocation, file);
            int index = className.lastIndexOf('.');
            String pckName = index == -1 ? "" : className.substring(0, index);
            boolean addLegacyAnnotation = false;
View Full Code Here

Examples of com.thoughtworks.proxy.toys.pool.Pool

* @author J&ouml;rg Schaible
*/
public class PoolToyExample {

    public static void packageOverviewExample1() {
        Pool pool = new Pool(Checksum.class, new Resetter() {
            public boolean reset(final Object object) {
                ((Checksum)object).reset();
                return true;
            }
        });
        pool.add(new CRC32());
        if (true) {
            Checksum checksum = (Checksum)pool.get();
            checksum.update("JUnit".getBytes(), 0, 5);
            System.out.println("CRC32 checksum of \"JUnit\": " + checksum.getValue());
        }
        if (true) {
            Checksum checksum = (Checksum)pool.get();
            if (checksum == null) {
                System.out.println("No checksum available, force gc ...");
                System.gc();
            }
            checksum = (Checksum)pool.get();
            System.out.println("CRC32 of an resetted checksum: " + checksum.getValue());
            ((Poolable)checksum).returnInstanceToPool();
        }
    }
View Full Code Here

Examples of com.thoughtworks.proxy.toys.pool.Pool

        components = new ArrayList<Object>();

        final Class type = delegate.getComponentKey() instanceof Class ? (Class)delegate
                .getComponentKey() : delegate.getComponentImplementation();
        final Resetter resetter = context.getResetter();
        this.pool = new Pool(type, delegateHasLifecylce ? new LifecycleResetter(
                this, resetter) : resetter, context.getProxyFactory(), serializationMode);
    }
View Full Code Here

Examples of com.xensource.xenapi.Pool

                s_logger.debug(msg);
                throw new DiscoveryException(msg);
            }

            Set<Pool> pools = Pool.getAll(conn);
            Pool pool = pools.iterator().next();
            Pool.Record pr = pool.getRecord(conn);
            String poolUuid = pr.uuid;
            Map<Host, Host.Record> hosts = Host.getAllRecords(conn);

            /*set cluster hypervisor type to xenserver*/
            ClusterVO clu = _clusterDao.findById(clusterId);
View Full Code Here

Examples of com.xensource.xenapi.Pool

            if (hostConn == null) {
                continue;
            }
            try {
                Set<Pool> pools = Pool.getAll(hostConn);
                Pool pool = pools.iterator().next();
                masterIp = pool.getMaster(hostConn).getAddress(hostConn);
                break;

            } catch (Exception e ) {
                s_logger.warn("Can not get master ip address from host " + address);
            } finally {
View Full Code Here

Examples of com.xensource.xenapi.Pool

    }

    protected MaintainAnswer execute(MaintainCommand cmd) {
        Connection conn = getConnection();
        try {
            Pool pool = Pool.getByUuid(conn, _host.pool);
            Pool.Record poolr = pool.getRecord(conn);

            Host.Record hostr = poolr.master.getRecord(conn);
            if (!_host.uuid.equals(hostr.uuid)) {
                s_logger.debug("Not the master node so just return ok: " + _host.ip);
                return new MaintainAnswer(cmd);
View Full Code Here

Examples of com.xensource.xenapi.Pool

        fillHostInfo(conn, cmd);
        cmd.setHypervisorType(HypervisorType.XenServer);
        cmd.setCluster(_cluster);
        cmd.setPoolSync(false);

        Pool pool;
        try {
            pool = Pool.getByUuid(conn, _host.pool);
            Pool.Record poolr = pool.getRecord(conn);

            Host.Record hostr = poolr.master.getRecord(conn);
            if (_host.uuid.equals(hostr.uuid)) {
                HashMap<String, Pair<String, State>> allStates=fullClusterSync(conn);
                cmd.setClusterVMStateChanges(allStates);
View Full Code Here

Examples of com.xensource.xenapi.Pool

                // call Xenserver API
                if (!snapshotMemory) {
                    task = vm.snapshotAsync(conn, vmSnapshotName);
                } else {
                    Set<VBD> vbds = vm.getVBDs(conn);
                    Pool pool = Pool.getByUuid(conn, _host.pool);
                    for (VBD vbd: vbds){
                        VBD.Record vbdr = vbd.getRecord(conn);
                        if (vbdr.userdevice.equals("0")){
                            VDI vdi = vbdr.VDI;
                            SR sr = vdi.getSR(conn);
                            // store memory image on the same SR with ROOT volume
                            pool.setSuspendImageSR(conn, sr);
                        }
                    }
                    task = vm.checkpointAsync(conn, vmSnapshotName);
                }
                task.addToOtherConfig(conn, "CS_VM_SNAPSHOT_KEY", vmSnapshotName);
View Full Code Here

Examples of com.xensource.xenapi.Pool

            if( ! found) {
                s_logger.debug("host " + hostuuid + " has already been ejected from pool " + _host.pool);
                return new Answer(cmd);
            }

            Pool pool = Pool.getAll(conn).iterator().next();
            Pool.Record poolr = pool.getRecord(conn);

            Host.Record masterRec = poolr.master.getRecord(conn);
            if (hostuuid.equals(masterRec.uuid)) {
                s_logger.debug("This is last host to eject, so don't need to eject: " + hostuuid);
                return new Answer(cmd);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.