Examples of CommunicationException


Examples of lt.baltic_amadeus.jqbridge.server.CommunicationException

                return msg;
            } while (!stopping.getValue());
            return null;
        }
        catch (IOException ex) {
            throw new CommunicationException(this, ex);
        }
    }
View Full Code Here

Examples of net.grinder.communication.CommunicationException

   *
   * @param message message to be sent
   */
  public void update(AgentUpdateGrinderMessage message) throws CommunicationException {
    if (message.getOffset() != offset) {
      throw new CommunicationException("Expected " + offset + " offset," +
          " but " + message.getOffset() + " was sent. " + ToStringBuilder.reflectionToString(message));
    }
    try {
      IOUtils.write(message.getBinary(), agentOutputStream);
      offset = message.getNext();
    } catch (IOException e) {
      throw new CommunicationException("Error while writing binary", e);
    }
    if (message.getNext() == 0) {
      IOUtils.closeQuietly(agentOutputStream);
      decompressDownloadPackage();
      // Then just exist to run the agent update process.
View Full Code Here

Examples of org.apache.geronimo.messaging.CommunicationException

                marshalled = memOut.toByteArray();
                memOut.reset();
            }
        } catch (IOException e) {
            log.error(e);
            throw new CommunicationException(e);
        }
        PlainDownPacket downPacket = new PlainDownPacket();
        ByteBuffer buffer = ByteBuffer.allocate(marshalled.length);
        buffer.put(marshalled);
        buffer.flip();
        downPacket.setBuffers(Collections.singleton(buffer));
        synchronized(protocol) {
            try {
                protocol.sendDown(downPacket);
            } catch (ProtocolException e) {
                log.error(e);
                throw new CommunicationException(e);
            }
        }
    }
View Full Code Here

Examples of org.arch.dns.exception.CommunicationException

                  tcp.close();
                }
                Header hdr2 = new Header(msg2, msg2.length);
                if (hdr2.query)
                {
                  throw new CommunicationException(
                          "DNS error: expecting response");
                }
                checkResponseCode(hdr2);
               
                if (!auth || hdr2.authoritative)
                {
                  // Got a valid response
                  hdr = hdr2;
                  msg = msg2;
                  break;
                }
                else
                {
                  doNotRetry[ij] = true;
                }
              }
              catch (Exception e)
              {
                // Try next server, or use UDP response
              }
            } // servers
          }
          return new ResourceRecords(msg, msg.length, hdr, false);
         
        }
        catch (IOException e)
        {
          if (debug)
          {
            dprint("Caught IOException:" + e);
          }
          if (caughtException == null)
          {
            caughtException = e;
          }
          // Use reflection to allow pre-1.4 compilation.
          // This won't be needed much longer.
          if (e.getClass().getName()
                  .equals("java.net.PortUnreachableException"))
          {
            doNotRetry[i] = true;
          }
        }
        catch (NameNotFoundException e)
        {
          throw e;
        }
        catch (CommunicationException e)
        {
          if (caughtException == null)
          {
            caughtException = e;
          }
        }
        catch (NamingException e)
        {
          if (caughtException == null)
          {
            caughtException = e;
          }
          doNotRetry[i] = true;
        }
      } // servers
    } // retries
   
    reqs.remove(xid);
    if (caughtException instanceof NamingException)
    {
      throw (NamingException) caughtException;
    }
    // A network timeout or other error occurred.
    NamingException ne = new CommunicationException("DNS error");
    ne.setRootCause(caughtException);
    throw ne;
  }
View Full Code Here

Examples of org.nasutekds.server.admin.client.CommunicationException

          throw new OperationRejectedException(OperationType.MODIFY, d
              .getUserFriendlyName(), m);
        }
      } catch (NamingException e) {
        // Just treat it as a communication problem.
        throw new CommunicationException(e);
      }
    }
  }
View Full Code Here

Examples of org.serviceconnector.net.CommunicationException

  public ChannelFuture awaitUninterruptibly(long timeoutMillis) throws Exception {
    ChannelFuture response;
    // poll() waits until message arrives in queue or time runs out
    response = this.answer.poll(timeoutMillis, TimeUnit.MILLISECONDS);
    if (response == null || response.isSuccess() == false) {
      throw new CommunicationException("Operation could not be completed");
    }
    return response;
  }
View Full Code Here

Examples of org.springframework.ldap.CommunicationException

    @Test
    public void authenticateWithNamingException() {
        UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken("ben", "benspassword");
        LdapAuthenticator mockAuthenticator = mock(LdapAuthenticator.class);
        CommunicationException expectedCause = new CommunicationException(new javax.naming.CommunicationException());
        when(mockAuthenticator.authenticate(authRequest)).thenThrow(expectedCause);

        LdapAuthenticationProvider ldapProvider = new LdapAuthenticationProvider(mockAuthenticator);
        try {
            ldapProvider.authenticate(authRequest);
View Full Code Here

Examples of org.tarantool.core.exception.CommunicationException

            ByteBuffer welcome = state.getWelcomeBuffer();
            readFully(welcome);
            String firstLine = new String(welcome.array(), 0, welcome.position());
            if (!firstLine.startsWith("Tarantool")) {
                channel.close();
                throw new CommunicationException("Welcome message should starts with tarantool but starts with '" + firstLine + "'");
            }
            welcome = state.getWelcomeBuffer();
            readFully(welcome);
            this.salt = new String(welcome.array(), 0, welcome.position());
        } catch (IOException e) {
            throw new CommunicationException("Can't connect with tarantool", e);
        }
    }
View Full Code Here

Examples of org.teiid.net.CommunicationException

            keyGen = new DhKeyGenerator();
            byte[] publicKey;
      try {
        publicKey = keyGen.createPublicKey();
      } catch (CryptoException e) {
        throw new CommunicationException(e);
      }
            handshake.setPublicKey(publicKey);
        }
        this.objectSocket.write(handshake);
  }
View Full Code Here

Examples of org.teiid.net.CommunicationException

    if (usingEncryption) {
            byte[] returnedPublicKey = handshake.getPublicKey();
           
            //ensure the key information
            if (returnedPublicKey == null) {
                throw new CommunicationException(RuntimePlugin.Util.getString("SocketClientInstance.invalid_sessionkey")); //$NON-NLS-1$
            }
           
            try {
        this.cryptor = keyGen.getSymmetricCryptor(returnedPublicKey);
      } catch (CryptoException e) {
        throw new CommunicationException(e);
      }
            this.keyGen = null;
        } else {
            this.cryptor = new NullCryptor();
        }
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.