sun.rmi.transport.Connection Java Examples

The following examples show how to use sun.rmi.transport.Connection. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TCPChannel.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #2
Source File: TCPChannel.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #3
Source File: TCPChannel.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #4
Source File: TCPChannel.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #5
Source File: TCPChannel.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #6
Source File: TCPChannel.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #7
Source File: TCPChannel.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #8
Source File: TCPChannel.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #9
Source File: TCPChannel.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #10
Source File: TCPChannel.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #11
Source File: TCPChannel.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #12
Source File: TCPChannel.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #13
Source File: TCPChannel.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #14
Source File: TCPChannel.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #15
Source File: TCPChannel.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #16
Source File: TCPChannel.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #17
Source File: TCPChannel.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #18
Source File: TCPChannel.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #19
Source File: TCPChannel.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #20
Source File: TCPChannel.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #21
Source File: TCPChannel.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #22
Source File: TCPChannel.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Give transport next accepted connection, when available.
 */
public void run() {
    Connection conn;

    synchronized (queue) {
        while (queue.size() == 0) {
            try {
                queue.wait();
            } catch (InterruptedException e) {
            }
        }
        startNewAcceptor();
        conn = queue.remove(0);
    }

    transport.handleMessages(conn, true);
}
 
Example #23
Source File: TCPChannel.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Closes all the connections in the cache, whether timed out or not.
 */
public void shedCache() {
    // Build a list of connections, to avoid holding the freeList
    // lock during (potentially long-running) close() calls.
    Connection[] conn;
    synchronized (freeList) {
        conn = freeList.toArray(new Connection[freeList.size()]);
        freeList.clear();
    }

    // Close all the connections that were free
    for (int i = conn.length; --i >= 0; ) {
        Connection c = conn[i];
        conn[i] = null; // help gc
        try {
            c.close();
        } catch (java.io.IOException e) {
            // eat exception
        }
    }
}
 
Example #24
Source File: TCPChannel.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add connection to queue of connections to be accepted.
 */
public void accept(Connection conn) {
    synchronized (queue) {
        queue.add(conn);
        queue.notify();
    }
}
 
Example #25
Source File: TCPChannel.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add connection to queue of connections to be accepted.
 */
public void accept(Connection conn) {
    synchronized (queue) {
        queue.add(conn);
        queue.notify();
    }
}
 
Example #26
Source File: TCPChannel.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Accept a connection provided over a multiplexed channel.
 */
void acceptMultiplexConnection(Connection conn) {
    if (acceptor == null) {
        acceptor = new ConnectionAcceptor(tr);
        acceptor.startNewAcceptor();
    }
    acceptor.accept(conn);
}
 
Example #27
Source File: TCPChannel.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Accept a connection provided over a multiplexed channel.
 */
void acceptMultiplexConnection(Connection conn) {
    if (acceptor == null) {
        acceptor = new ConnectionAcceptor(tr);
        acceptor.startNewAcceptor();
    }
    acceptor.accept(conn);
}
 
Example #28
Source File: TCPChannel.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Accept a connection provided over a multiplexed channel.
 */
void acceptMultiplexConnection(Connection conn) {
    if (acceptor == null) {
        acceptor = new ConnectionAcceptor(tr);
        acceptor.startNewAcceptor();
    }
    acceptor.accept(conn);
}
 
Example #29
Source File: TCPChannel.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Accept a connection provided over a multiplexed channel.
 */
void acceptMultiplexConnection(Connection conn) {
    if (acceptor == null) {
        acceptor = new ConnectionAcceptor(tr);
        acceptor.startNewAcceptor();
    }
    acceptor.accept(conn);
}
 
Example #30
Source File: TCPChannel.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Accept a connection provided over a multiplexed channel.
 */
void acceptMultiplexConnection(Connection conn) {
    if (acceptor == null) {
        acceptor = new ConnectionAcceptor(tr);
        acceptor.startNewAcceptor();
    }
    acceptor.accept(conn);
}