Package org.apache.activemq.command

Examples of org.apache.activemq.command.ExceptionResponse


        } else {

            try {
                Response response = (Response) this.transport.request(command,timeout);
                if (response!=null && response.isException()) {
                    ExceptionResponse er = (ExceptionResponse) response;
                    if (er.getException() instanceof JMSException)
                        throw (JMSException) er.getException();
                    else
                        throw JMSExceptionSupport.create(er.getException());
                }
                return response;
            } catch (IOException e) {
                throw JMSExceptionSupport.create(e);
            }
View Full Code Here


                                sendMessage(context, message);
                              Response response = new Response();
                              response.setCorrelationId(message.getCommandId());
                      context.getConnection().dispatchAsync(response);             
                    } catch (Exception e) {
                              ExceptionResponse response = new ExceptionResponse(e);
                              response.setCorrelationId(message.getCommandId());
                      context.getConnection().dispatchAsync(response);
                    } finally {
//                                System.out.println("Async thread end..");
                    }
                      }
View Full Code Here

                    ResponseCallback callback = new ResponseCallback() {
                        public void onCompletion(FutureResponse future) {
                            try {
                                Response response = future.getResult();
                                if(response.isException()){
                                    ExceptionResponse er=(ExceptionResponse) response;
                                    serviceLocalException(er.getException());
                                } else {
                                    localBroker.oneway(new MessageAck(md,MessageAck.STANDARD_ACK_TYPE,1));
                                }
                            } catch (IOException e) {
                                serviceLocalException(e);
View Full Code Here

        ArrayList requests = new ArrayList(requestMap.values());
        requestMap.clear();
       
        for (Iterator iter = requests.iterator(); iter.hasNext();) {
            FutureResponse fr = (FutureResponse) iter.next();
            fr.set(new ExceptionResponse(error));
        }
       
        super.onException(error);
    }
View Full Code Here

    protected void sendSyncToSlave(Command command){
        try{

            Response response=(Response) slave.request(command);
            if (response.isException()){
                ExceptionResponse er=(ExceptionResponse)response;
                log.error("Slave Failed",er.getException());
            }

        }catch(Throwable e){
            log.error("Slave Failed",e);
          
View Full Code Here

            response = command.visit(this);
        } catch ( Throwable e ) {
            if( responseRequired ) {
                if( serviceLog.isDebugEnabled() && e.getClass()!=BrokerStoppedException.class )
                    serviceLog.debug("Error occured while processing sync command: "+e,e);
                response = new ExceptionResponse(e);
            } else {
                serviceException(e);
            }
        }       
        if( responseRequired ) {
View Full Code Here

            }
        }
       
        for (TransactionInfo command: toRollback) {
            // respond to the outstanding commit
            ExceptionResponse response = new ExceptionResponse();
            response.setException(new TransactionRolledBackException("Transaction completion in doubt due to failover. Forcing rollback of " + command.getTransactionId()));
            response.setCorrelationId(command.getCommandId());
            transport.getTransportListener().onCommand(response);
        }
    }
View Full Code Here

        } else {

            try {
                Response response = (Response)this.transport.request(command);
                if (response.isException()) {
                    ExceptionResponse er = (ExceptionResponse)response;
                    if (er.getException() instanceof JMSException) {
                        throw (JMSException)er.getException();
                    } else {
                        if (isClosed()||closing.get()) {
                            LOG.debug("Received an exception but connection is closing");
                        }
                        JMSException jmsEx = null;
                        try {
                         jmsEx = JMSExceptionSupport.create(er.getException());
                        }catch(Throwable e) {
                            LOG.error("Caught an exception trying to create a JMSException for " +er.getException(),e);
                        }
                        if(jmsEx !=null) {
                            throw jmsEx;
                        }
                    }
View Full Code Here

  private Response doSyncSendPacket(Command command, int timeout)
      throws JMSException {
    try {
        Response response = (Response)this.transport.request(command, timeout);
        if (response != null && response.isException()) {
            ExceptionResponse er = (ExceptionResponse)response;
            if (er.getException() instanceof JMSException) {
                throw (JMSException)er.getException();
            } else {
                throw JMSExceptionSupport.create(er.getException());
            }
        }
        return response;
    } catch (IOException e) {
        throw JMSExceptionSupport.create(e);
View Full Code Here

                                        context.getConnection().dispatchAsync(response);
                                    }

                                } catch (Exception e) {
                                    if (!sendProducerAck && !context.isInRecoveryMode()) {
                                        ExceptionResponse response = new ExceptionResponse(e);
                                        response.setCorrelationId(message.getCommandId());
                                        context.getConnection().dispatchAsync(response);
                                    } else {
                                        LOG.debug("unexpected exception on deferred send of :" + message, e);
                                    }
                                }
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.ExceptionResponse

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.