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

Examples of com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnection.call()


        int count = 0;
        Throwable ex = null;
        while (count++ < retry) {
            try {
                connection = factory.createConnection(params);
                return connection.call(event);
            } catch (Exception e) {
                logger.error(String.format("call[%s] , retry[%s]", addr, count), e);
                try {
                    Thread.sleep(count * retryDelay);
                } catch (InterruptedException e1) {
View Full Code Here


        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

        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
    public void testPool() {
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);
                }
            } finally {
View Full Code Here

            event.setSleep(1000);
            executor.submit(new Callable() {

                public Object call() throws Exception {
                    try {
                        Object obj = connection.call(event);
                        count.countDown();
                        return obj;
                    } finally {
                        connection.close();
                    }
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.