Package com.alibaba.otter.shared.communication.core.impl.connection

Examples of com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionFactory.createConnection()


    public void testSingle() {
        CommunicationConnectionFactory factory = new DubboCommunicationConnectionFactory();
        CommunicationParam param = new CommunicationParam();
        param.setIp("127.0.0.1");
        param.setPort(2088);
        CommunicationConnection connection = factory.createConnection(param);
        Object result = connection.call(new HeartEvent());
        want.object(result).notNull();
    }

}
View Full Code Here


    public void testSingle() {
        CommunicationConnectionFactory factory = new RmiCommunicationConnectionFactory();
        CommunicationParam param = new CommunicationParam();
        param.setIp("127.0.0.1");
        param.setPort(1099);
        CommunicationConnection connection = factory.createConnection(param);
        Object result = connection.call(new HeartEvent());
        want.object(result).notNull();
    }

    @Test
View Full Code Here

        CommunicationConnection last = null;
        for (int i = 0; i < 11; i++) {
            CommunicationConnection connection = null;
            try {
                connection = poolFactory.createConnection(param);
                connection.call(new PoolEvent(PoolEventType.pool));
                last = connection;
                if (last != null) { // 检查链接是否是重用
                    want.object(last).isEqualTo(connection);
                }
View Full Code Here

        ExecutorService executor = Executors.newCachedThreadPool();
        long start = System.currentTimeMillis();
        final CountDownLatch count = new CountDownLatch(11);
        for (int i = 0; i < 11; i++) {
            final CommunicationConnection connection = poolFactory.createConnection(param);
            final PoolEvent event = new PoolEvent(PoolEventType.exhaust);
            event.setSleep(1000);
            executor.submit(new Callable() {

                public Object call() throws Exception {
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.