Package java.net

Examples of java.net.ConnectException


   *
   * @exception ConnectException  If the admin connection is not established.
   */
  public static int getLocalPort() throws ConnectException {
    if (wrapper == null)
      throw new ConnectException("Administrator not connected.");

    return localPort;
  }
View Full Code Here


    return localPort;
  }

  public static void abortRequest() throws ConnectException {
    if (wrapper == null)
      throw new ConnectException("Administrator not connected.");

    wrapper.abortRequest();
  }
View Full Code Here

   * @param timeOut The timeout
   * @throws ConnectException if the connection is not established.
   */
  public static void setTimeOutToAbortRequest(long timeOut) throws ConnectException {
    if (wrapper == null)
      throw new ConnectException("Administrator not connected.");
   
    wrapper.setTimeOutToAbortRequest(timeOut);
  }
View Full Code Here

   * @return the timeout
   * @throws ConnectException if the connection is not established.
   */
  public static long getTimeOutToAbortRequest() throws ConnectException {
    if (wrapper == null)
      throw new ConnectException("Administrator not connected.");
   
    return wrapper.getTimeOutToAbortRequest();
  }
View Full Code Here

   * @exception AdminException   
   * @exception ConnectException  If the connection fails.
   */
  public static AdminReply processAdmin(String targetId, int command, Properties prop) throws ConnectException, AdminException {
    if (wrapper == null)
      throw new ConnectException("Administrator not connected.");
   
    return wrapper.processAdmin(targetId, command, prop);
  }
View Full Code Here

   * @throws AdminException If the invocation can't be done or fails
   */
  public static String invokeStaticServerMethod(int serverId, String className, String methodName,
      Class[] parameterTypes, Object[] args) throws ConnectException, AdminException {
    if (wrapper == null)
      throw new ConnectException("Administration connection is closed.");

    if (parameterTypes == null && (args != null && args.length > 0)) {
      throw new AdminException("Parameter types array is null while args array is not null or empty.");
    }
    if (args == null && (parameterTypes != null && parameterTypes.length > 0)) {
View Full Code Here

        logger.log(BasicLevel.DEBUG, "JoramAdmin - error during creation", exc);
      throw new AdminException(exc.getMessage());
    } catch (JMSException exc) {
      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG, "JoramAdmin - error during creation", exc);
      throw new ConnectException("Connecting failed: " + exc);
    }
  }
View Full Code Here

  public void testCreateThrowable_01() {
    testCreateThrowable(new CommunicationException(
        "A test MM Communication Exception"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_STALE_CONNECTION);
    testCreateThrowable(
        new ConnectException("A test connection attempt exception"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION);
    testCreateThrowable(
        new ConnectionException("A test MM Connection Exception"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION);
    testCreateThrowable(new IOException(
View Full Code Here

   * Tests various nested exceptions to see if the expected SQLState is
   * returend.
   */
  public void testCreateThrowable_02() {
    testCreateThrowable(
        new CommunicationException(new ConnectException(
            "A test java.net.ConnectException"), //$NON-NLS-1$
            "Test Communication Exception with a ConnectException in it"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION);
    testCreateThrowable(new CommunicationException(new SocketException(
        "A test java.net.SocketException"), //$NON-NLS-1$
View Full Code Here

    if (isPooled) {
      try {
        tcpConnection = pool.getNonBlockingConnection(host, port, isSSL);
       
      } catch (IOException ioe) {
        throw new ConnectException("could not connect to " + host + ":" + port);
      }

       
    } else {
      try {
        if (sslCtx != null) {
          tcpConnection = new NonBlockingConnection(host, port, sslCtx, true);
          ((NonBlockingConnection) tcpConnection).setWorkerpool(pool.getWorkerpool());
         
        } else {
          tcpConnection = new NonBlockingConnection(host, port);
          ((NonBlockingConnection) tcpConnection).setWorkerpool(pool.getWorkerpool());
        }
      } catch (IOException ioe) {
        throw new ConnectException("could not connect to " + host + ":" + port + " reason: " + ioe.toString());
      }
    }
   
    HttpClientConnection httpConnection = new HttpClientConnection(tcpConnection);
    httpConnection.setResponseTimeoutMillis(responseTimeoutMillis);
View Full Code Here

TOP

Related Classes of java.net.ConnectException

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.