/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
private void dispose(IOException error) { ArrayList<FutureResponse> requests=null; synchronized(requestMap) { if( this.error==null) { this.error = error; requests = new ArrayList<FutureResponse>(requestMap.values()); requestMap.clear(); } } if( requests!=null ) { for (Iterator<FutureResponse> iter = requests.iterator(); iter.hasNext();) { FutureResponse fr = iter.next(); fr.set(new ExceptionResponse(error)); } } }
response = command.visit(this); } else { response = new ExceptionResponse(transportException.get()); transport.getRemoteAddress(), e.getMessage()); response = new ExceptionResponse(e); } else { forceRollbackOnlyOnFailedAsyncTransactionOp(e, command);
public FutureResponse asyncRequest(Object o, ResponseCallback responseCallback) throws IOException { Command command = (Command) o; command.setCommandId(sequenceGenerator.getNextSequenceId()); command.setResponseRequired(true); FutureResponse future = new FutureResponse(responseCallback, this); IOException priorError = null; synchronized (requestMap) { priorError = this.error; if (priorError == null) { requestMap.put(new Integer(command.getCommandId()), future); } } if (priorError != null) { future.set(new ExceptionResponse(priorError)); throw priorError; } next.oneway(command); return future; }
ExceptionResponse response = new ExceptionResponse(); response.setException(new TransactionRolledBackException("Transaction completion in doubt due to failover. Forcing rollback of " + command.getTransactionId())); response.setCorrelationId(command.getCommandId());
@Override public void run() { TimeoutMessage timeout; try { while (true) { timeout = flowControlTimeoutMessages.take(); if (timeout != null) { synchronized (messagesWaitingForSpace) { if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) { ExceptionResponse response = new ExceptionResponse( new ResourceAllocationException( "Usage Manager Memory Limit Wait Timeout. Stopping producer (" + timeout.message.getProducerId() + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." + " See http://activemq.apache.org/producer-flow-control.html for more info")); response.setCorrelationId(timeout.message.getCommandId()); timeout.context.getConnection().dispatchAsync(response); } } } } } catch (InterruptedException e) { LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping"); } } }
ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response);
@Override public void run() { try { // While waiting for space to free up... the // message may have expired. if (message.isExpired()) { broker.messageExpired(context, message, null); getDestinationStatistics().getExpired().increment(); } else { doMessageSend(producerExchange, message); } if (sendProducerAck) { ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message .getSize()); context.getConnection().dispatchAsync(ack); } else { Response response = new Response(); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } catch (Exception e) { if (!sendProducerAck && !context.isInRecoveryMode()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } } });
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
/** * @return a new object instance */ public DataStructure createObject() { return new ExceptionResponse(); }
private Response convertException(Exception e) { Response resp; if (e instanceof ActiveMQSecurityException) { resp = new ExceptionResponse(new JMSSecurityException(e.getMessage())); } else if (e instanceof ActiveMQNonExistentQueueException) { resp = new ExceptionResponse(new InvalidDestinationException(e.getMessage())); } else { resp = new ExceptionResponse(e); } return resp; }