Package org.jayasoft.woj.common.services.exceptions

Examples of org.jayasoft.woj.common.services.exceptions.ServiceNotAvailableException


                urlSuffix = url.substring(server.length());
                LOGGER.info("redirected to server: "+server);
                try {
                    _targetServer.setNewTargetServer(new Server(new URL(server)));
                } catch (MalformedURLException e1) {
                    throw new ServiceNotAvailableException("redirected to malformed url: "+server, e1);
                }                   
            } catch(ConnectException e) {
                LOGGER.info("Server did not respond: "+serverUrl, e);
                if (firstException == null) {
                    firstException = e;
                }
                errorMessages.append("[").append(serverUrl).append(": ").append(e.getClass().getName()).append(" ").append(e.getMessage()).append("] ");
            } catch (NoHttpResponseException e) { //idem ConnectException but thru proxy
                LOGGER.info("Server did not respond correctly: "+serverUrl, e);
                if (firstException == null) {
                    firstException = e;
                }
                errorMessages.append("[").append(serverUrl).append(": ").append(e.getClass().getName()).append(" ").append(e.getMessage()).append("] ");
            } catch (IOException e) {
            LOGGER.info("Unable to connect to: "+serverUrl, e);
            if (firstException == null) {
              firstException = e;
            }
            errorMessages.append("[").append(serverUrl).append(": ").append(e.getClass().getName()).append(" ").append(e.getMessage()).append("] ");
          }
        }
        if (firstException != null) {
            throw new ServiceNotAvailableException(errorMessages.toString(), firstException);
        } else {
            throw new ServiceNotAvailableException("Server did not respond: "+_targetServer);
        }
    }
View Full Code Here


          LOGGER.debug("Offline mode"); //$NON-NLS-1$
            throw new OfflineException();
        }
        if (!(_lastFailedTime < 0 ||  _lastFailedTime+DELAY_BEFORE_RETRY < System.currentTimeMillis())) {
          LOGGER.info("prevent connection to server.(delay before retry not reached)"); //$NON-NLS-1$
            throw new ServiceNotAvailableException(Messages.getString("services.error.serverdown")); //$NON-NLS-1$
        }
    }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.common.services.exceptions.ServiceNotAvailableException

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.