Examples of RemotingException


Examples of com.alibaba.dubbo.remoting.RemotingException

    }

    public void send(Object message) throws RemotingException {
        if (remoteUrl.getParameter(ERROR_WHEN_SEND, Boolean.FALSE)){
            receivedMessage = null ;
            throw new RemotingException(localAddress, remoteAddress, "mock error");
        } else {
            receivedMessage = message;
        }
    }
View Full Code Here

Examples of com.alibaba.dubbo.remoting.RemotingException

       
        try {
            doOpen();
        } catch (Throwable t) {
            close();
            throw new RemotingException(url.toInetSocketAddress(), null,
                                        "Failed to start " + getClass().getSimpleName() + " " + NetUtils.getLocalAddress()
                                        + " connect to the server " + getRemoteAddress() + ", cause: " + t.getMessage(), t);
        }
        try {
            // connect.
            connect();
            if (logger.isInfoEnabled()) {
                logger.info("Start " + getClass().getSimpleName() + " " + NetUtils.getLocalAddress() + " connect to the server " + getRemoteAddress());
            }
        } catch (RemotingException t) {
            if (url.getParameter(Constants.CHECK_KEY, true)) {
                close();
                throw t;
            } else {
                logger.warn("Failed to start " + getClass().getSimpleName() + " " + NetUtils.getLocalAddress()
                             + " connect to the server " + getRemoteAddress() + " (check == false, ignore and retry later!), cause: " + t.getMessage(), t);
            }
        } catch (Throwable t){
            close();
            throw new RemotingException(url.toInetSocketAddress(), null,
                    "Failed to start " + getClass().getSimpleName() + " " + NetUtils.getLocalAddress()
                    + " connect to the server " + getRemoteAddress() + ", cause: " + t.getMessage(), t);
        }
       
        executor = (ExecutorService) ExtensionLoader.getExtensionLoader(DataStore.class)
View Full Code Here

Examples of com.alibaba.dubbo.remoting.RemotingException

            connect();
        }
        Channel channel = getChannel();
        //TODO getChannel返回的状态是否包含null需要改进
        if (channel == null || ! channel.isConnected()) {
          throw new RemotingException(this, "message can not send, because channel is closed . url:" + getUrl());
        }
        channel.send(message, sent);
    }
View Full Code Here

Examples of com.alibaba.dubbo.remoting.RemotingException

                return;
            }
            initConnectStatusCheckCommand();
            doConnect();
            if (! isConnected()) {
                throw new RemotingException(this, "Failed connect to server " + getRemoteAddress() + " from " + getClass().getSimpleName() + " "
                                            + NetUtils.getLocalHost() + " using dubbo version " + Version.getVersion()
                                            + ", cause: Connect wait timeout: " + getTimeout() + "ms.");
            } else {
              if (logger.isInfoEnabled()){
                logger.info("Successed connect to server " + getRemoteAddress() + " from " + getClass().getSimpleName() + " "
                                            + NetUtils.getLocalHost() + " using dubbo version " + Version.getVersion()
                                            + ", channel is " + this.getChannel());
              }
            }
            reconnect_count.set(0);
            reconnect_error_log_flag.set(false);
        } catch (RemotingException e) {
            throw e;
        } catch (Throwable e) {
            throw new RemotingException(this, "Failed connect to server " + getRemoteAddress() + " from " + getClass().getSimpleName() + " "
                                        + NetUtils.getLocalHost() + " using dubbo version " + Version.getVersion()
                                        + ", cause: " + e.getMessage(), e);
        } finally {
            connectLock.unlock();
        }
View Full Code Here

Examples of com.alibaba.dubbo.remoting.RemotingException

        }

        @Override
        public void connected(Channel channel) throws RemotingException {
            if (invokeWithBizError){
                throw new RemotingException(channel, "test connect biz error");
            }
            sleep(20);
        }
View Full Code Here

Examples of com.alibaba.dubbo.remoting.RemotingException

        }

        @Override
        public void disconnected(Channel channel) throws RemotingException {
            if (invokeWithBizError){
                throw new RemotingException(channel, "test disconnect biz error");
            }
            sleep(20);
        }
View Full Code Here

Examples of org.apache.isis.objectstore.nosql.db.file.RemotingException

        try {
            final String line = reader.readLine();
            LOG.debug("header: " + line);
            if (line == null) {
                logFailure();
                throw new RemotingException("stream ended prematurely while reading header, aborting request");
            }
            if (line.length() == 0) {
                return false;
            } else {
                command = line.charAt(0);
View Full Code Here

Examples of org.apache.isis.objectstore.nosql.db.file.RemotingException

    public boolean readWriteHeaders() {
        final boolean readHeaders = readHeaders();
        if (readHeaders && headers.length != 4) {
            logFailure();
            throw new RemotingException("invalid header string, aborting request");
        }
        return readHeaders;
    }
View Full Code Here

Examples of org.apache.isis.objectstore.nosql.db.file.RemotingException

    public void endCommand() {
        try {
            final String line = reader.readLine();
            if (line == null) {
                logFailure();
                throw new RemotingException("stream ended prematurely while reading end of command, aborting request");
            }
            if (line.length() > 0) {
                logFailure();
                throw new RemotingException("command didn't end with an empty blank line, aborting request");
            }
        } catch (final IOException e) {
            logFailure();
            throw new NoSqlStoreException(e);
        }
View Full Code Here

Examples of org.apache.isis.objectstore.nosql.db.file.RemotingException

            String line;
            while (true) {
                line = reader.readLine();
                if (line == null) {
                    logFailure();
                    throw new RemotingException("stream ended prematurely while reading data, aborting request");
                }
                if (line.length() == 0) {
                    break;
                }
                buffer.append(line);
                buffer.append('\n');
            }
            return buffer.toString();
        } catch (final IOException e) {
            logFailure();
            throw new RemotingException(e);
        }
    }
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.