Package org.apache.activemq.command

Examples of org.apache.activemq.command.ExceptionResponse


            }
        }
       
        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


            sendToActiveMQ(message, new ResponseHandler() {
                @Override
                public void onResponse(IAmqpProtocolConverter converter, Response response) throws IOException {
                    if (!delivery.remotelySettled()) {
                        if (response.isException()) {
                            ExceptionResponse er = (ExceptionResponse) response;
                            Rejected rejected = new Rejected();
                            ErrorCondition condition = new ErrorCondition();
                            condition.setCondition(Symbol.valueOf("failed"));
                            condition.setDescription(er.getException().getMessage());
                            rejected.setError(condition);
                            delivery.disposition(rejected);
                        }
                    }
                    receiver.flow(1);
View Full Code Here

                        Response response;
                        Throwable exception = null;
                        try {
                            response = resp.getResult();
                            if (response.isException()) {
                                ExceptionResponse er = (ExceptionResponse)response;
                                exception = er.getException();
                            }
                        } catch (Exception e) {
                            exception = e;
                        }
                        if(exception!=null) {
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);
                        }
                        //dispose of transport for security exceptions
                        if (er.getException() instanceof SecurityException && command instanceof ConnectionInfo){
                            Transport t = this.transport;
                            if (null != t){
                                ServiceSupport.dispose(t);
                            }
                        }
View Full Code Here

        try {
            Response response = (Response) (timeout > 0
                    ? this.transport.request(command, timeout)
                    : this.transport.request(command));
            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

        }
        command.setResponseRequired(false);
        if (connection != null) {
            Response response = connection.service(command);
            if (response != null && response.isException()) {
                ExceptionResponse er = (ExceptionResponse)response;
                throw JMSExceptionSupport.create(er.getException());
            }
        } else if (transport != null) {
            transport.oneway(command);
        }
    }
View Full Code Here

        }
        command.setResponseRequired(true);
        if (connection != null) {
            Response response = connection.service(command);
            if (response != null && response.isException()) {
                ExceptionResponse er = (ExceptionResponse)response;
                throw JMSExceptionSupport.create(er.getException());
            }
            return response;
        } else if (transport != null) {
            Response response = (Response)transport.request(command);
            if (response != null && response.isException()) {
                ExceptionResponse er = (ExceptionResponse)response;
                throw JMSExceptionSupport.create(er.getException());
            }
            return response;
        }
        return null;
    }
View Full Code Here

        }
        command.setResponseRequired(false);
        if (connection != null) {
            Response response = connection.service(command);
            if (response != null && response.isException()) {
                ExceptionResponse er = (ExceptionResponse)response;
                throw JMSExceptionSupport.create(er.getException());
            }
        } else if (transport != null) {
            transport.oneway(command);
        }
    }
View Full Code Here

        }
        command.setResponseRequired(true);
        if (connection != null) {
            Response response = connection.service(command);
            if (response != null && response.isException()) {
                ExceptionResponse er = (ExceptionResponse)response;
                throw JMSExceptionSupport.create(er.getException());
            }
            return response;
        } else if (transport != null) {
            Response response = (Response)transport.request(command);
            if (response != null && response.isException()) {
                ExceptionResponse er = (ExceptionResponse)response;
                throw JMSExceptionSupport.create(er.getException());
            }
            return response;
        }
        return null;
    }
View Full Code Here

                        Response response;
                        Throwable exception = null;
                        try {
                            response = resp.getResult();
                            if (response.isException()) {
                                ExceptionResponse er = (ExceptionResponse)response;
                                exception = er.getException();
                            }
                        } catch (Exception e) {
                            exception = e;
                        }
                        if(exception!=null) {
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.