@Override public void onException(IOException error) { transportListener.onException(error); }
/** * Passes any IO exceptions into the transport listener */ public void onException(IOException e) { if (transportListener != null) { try { transportListener.onException(e); } catch (RuntimeException e2) { // Handle any unexpected runtime exceptions by debug logging // them. LOG.debug("Unexpected runtime exception: " + e2, e2); } } }
private void propagateFailureToExceptionListener(Exception exception) { if (transportListener != null) { if (exception instanceof IOException) { transportListener.onException((IOException)exception); } else { transportListener.onException(IOExceptionSupport.create(exception)); } } reconnectMutex.notifyAll(); }
@Override public void onException(IOException error) { try { handleTransportFailure(owner, error); } catch (InterruptedException e) { Thread.currentThread().interrupt(); if (transportListener != null) { transportListener.onException(new InterruptedIOException()); } } }
@Override public void onException(IOException error) { getTransportListener().onException(error); }
@Override public void onException(IOException error) { if (failed.compareAndSet(false, true)) { stopMonitorThreads(); if (sendLock.writeLock().isHeldByCurrentThread()) { sendLock.writeLock().unlock(); } transportListener.onException(error); } }
public void onException(IOException error) { // Changed this method to use a LogWriter object to actually // print the messages to the log, and only in case of logging // being active, instead of logging the message directly. if( logging && log.isDebugEnabled() ) { logWriter.logReceivedException(log, error); } getTransportListener().onException(error); }
@Override public void onException(IOException error) { try { synchronized (reconnectMutex) { if (transport == null || !transport.isConnected()) { return; } LOG.debug("Transport failed, starting up reconnect task", error); ServiceSupport.dispose(transport); transport = null; connectedCount--; if (primary == this) { primary = null; } reconnectTask.wakeup(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); if (transportListener != null) { transportListener.onException(new InterruptedIOException()); } } } }
@Override public void run() { transportFailed(error); ServiceSupport.dispose(ActiveMQConnection.this.transport); brokerInfoReceived.countDown(); try { doCleanup(true); } catch (JMSException e) { LOG.warn("Exception during connection cleanup, " + e, e); } for (Iterator<TransportListener> iter = transportListeners.iterator(); iter.hasNext();) { TransportListener listener = iter.next(); listener.onException(error); } } });
/** * @see org.apache.activemq.thread.Task#iterate() */ @Override public boolean iterate() { final TransportListener tl = transportListener; LinkedBlockingQueue<Object> mq; try { mq = getMessageQueue(); } catch (TransportDisposedIOException e) { return false; } Object command = mq.poll(); if (command != null && !disposed.get()) { try { tl.onCommand(command); } catch (Exception e) { try { peer.transportListener.onException(IOExceptionSupport.create(e)); } catch (Exception ignore) { } } return !mq.isEmpty() && !disposed.get(); } else { if(disposed.get()) { mq.clear(); } return false; } }
public void onCommand(Object command) { try { getTransportListener().onCommand((Command)localWireFormat.unmarshal(remoteWireFormat.marshal(command))); } catch (IOException e) { getTransportListener().onException(e); } }
public void onCommand(Object o) { Command command = (Command)o; byte type = command.getDataStructureType(); if (type == PartialCommand.DATA_STRUCTURE_TYPE || type == LastPartialCommand.DATA_STRUCTURE_TYPE) { PartialCommand header = (PartialCommand)command; byte[] partialData = header.getData(); try { out.write(partialData); } catch (IOException e) { getTransportListener().onException(e); } if (type == LastPartialCommand.DATA_STRUCTURE_TYPE) { try { byte[] fullData = out.toByteArray(); out.reset(); DataInputStream dataIn = new DataInputStream(new ByteArrayInputStream(fullData)); Command completeCommand = (Command)wireFormat.unmarshal(dataIn); LastPartialCommand lastCommand = (LastPartialCommand)command; lastCommand.configure(completeCommand); getTransportListener().onCommand(completeCommand); } catch (IOException e) { LOG.warn("Failed to unmarshal partial command: " + command); getTransportListener().onException(e); } } } else { getTransportListener().onCommand(command); } }
/** * Requests that a range of commands be replayed */ public void requestReplay(int fromCommandId, int toCommandId) { ReplayCommand replay = new ReplayCommand(); replay.setFirstNakNumber(fromCommandId); replay.setLastNakNumber(toCommandId); try { oneway(replay); } catch (IOException e) { getTransportListener().onException(e); } }
peer.transportListener.onException(new TransportDisposedIOException("peer (" + this + ") stopped.")); } catch (Exception ignore) {
public void onException(IOException error) { // Changed this method to use a LogWriter object to actually // print the messages to the log, and only in case of logging // being active, instead of logging the message directly. if( logging && log.isDebugEnabled() ) { logWriter.logReceivedException(log, error); } getTransportListener().onException(error); }
@Override public void onException(IOException error) { if (failed.compareAndSet(false, true)) { stopConnectionTimeoutChecker(); if (amqpTransport != null) { amqpTransport.onException(error); } transportListener.onException(error); } }
@Override public void onException(IOException error) { if (failed.compareAndSet(false, true)) { stopConnectionTimeoutChecker(); if (amqpTransport != null) { amqpTransport.onException(error); } transportListener.onException(error); } }
public void onException(IOException error) { // Changed this method to use a LogWriter object to actually // print the messages to the log, and only in case of logging // being active, instead of logging the message directly. if( logging && log.isDebugEnabled() ) { logWriter.logReceivedException(log, error); } getTransportListener().onException(error); }
@Override public void onException(IOException error) { if (failed.compareAndSet(false, true)) { stopConnectChecker(); stopReadChecker(); if (protocolConverter != null) { protocolConverter.onTransportError(); } transportListener.onException(error); } }
public void onCommand(Object command) { try { getTransportListener().onCommand((Command)localWireFormat.unmarshal(remoteWireFormat.marshal(command))); } catch (IOException e) { getTransportListener().onException(e); } }