Package playn.core

Examples of playn.core.Connection


     * retention practices, once the resulting connection is disconnected, the given ones
     * will no longer be referenced and hence will only have their {@code disconnect} method
     * called once (via the returned object).
     */
    public static Connection join (final Connection... connections) {
        return new Connection() {
            @Override public void disconnect () {
                if (_conns == null) return;
                for (Connection conn : _conns) conn.disconnect();
                _conns = null;
            }
View Full Code Here


            @Override public void disconnect () {
                disconnects++;
            }
        }

        Connection joined;
        joined = Layers.join();
        joined.disconnect();
        joined.disconnect();

        TestConn c1 = new TestConn();
        joined = Layers.join(c1, joined);
        joined.disconnect();
        Assert.assertEquals(c1.disconnects, 1);
        joined.disconnect();
        Assert.assertEquals(c1.disconnects, 1);
    }
View Full Code Here

TOP

Related Classes of playn.core.Connection

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.