Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.Receipt


     * @param timeout
     * @throws JMSException
     */
    public void syncSendPacket(Packet packet, int timeout) throws JMSException {
        if (isTransportOK && !closed.get()) {
            Receipt receipt;
            packet.setReceiptRequired(true);
            receipt = this.transportChannel.send(packet, timeout);
            if (receipt != null) {
                if (receipt.isFailed()) {
                    Throwable e = receipt.getException();
                    if (e != null) {
                        throw JMSExceptionHelper.newJMSException(e);
                    }
                    throw new JMSException("syncSendPacket failed with unknown exception");
                }
View Full Code Here


    }

    public Receipt syncSendRequest(Packet packet) throws JMSException {
        checkClosed();
        if (isTransportOK && !closed.get()) {
            Receipt receipt;
            packet.setReceiptRequired(true);
            if (packet.getId() == null || packet.getId().length() == 0) {
                packet.setId(this.packetIdGenerator.generateId());
            }
            receipt = this.transportChannel.send(packet);
            if (receipt != null && receipt.isFailed()) {
                Throwable e = receipt.getException();
                if (e != null) {
                    throw (JMSException) new JMSException(e.getMessage()).initCause(e);
                }
                throw new JMSException("syncSendPacket failed with unknown exception");
            }
View Full Code Here

        connection.start();
        BrokerInfo info = new BrokerInfo();
        info.setBrokerName(brokerContainer.getBroker().getBrokerName());
        info.setClusterName(brokerContainer.getBroker().getBrokerClusterName());
     
        Receipt receipt = connection.syncSendRequest(info);
        if (receipt != null){
            remoteBrokerName = receipt.getBrokerName();
            remoteClusterName = receipt.getClusterName();
        }
    }
View Full Code Here

     * @param timeout
     * @throws JMSException
     */
    public void syncSendPacket(Packet packet, int timeout) throws JMSException {
        if (isTransportOK && !closed.get()) {
            Receipt receipt;
            packet.setReceiptRequired(true);
            receipt = this.transportChannel.send(packet, timeout);
            if (receipt != null) {
                if (receipt.isFailed()) {
                    Throwable e = receipt.getException();
                    if (e != null) {
                        throw JMSExceptionHelper.newJMSException(e);
                    }
                    throw new JMSException("syncSendPacket failed with unknown exception");
                }
View Full Code Here

    }

    public Receipt syncSendRequest(Packet packet) throws JMSException {
        checkClosed();
        if (isTransportOK && !closed.get()) {
            Receipt receipt;
            packet.setReceiptRequired(true);
            if (packet.getId() == null || packet.getId().length() == 0) {
                packet.setId(this.packetIdGenerator.generateId());
            }
            receipt = this.transportChannel.send(packet);
            if (receipt != null && receipt.isFailed()) {
                Throwable e = receipt.getException();
                if (e != null) {
                    throw (JMSException) new JMSException(e.getMessage()).initCause(e);
                }
                throw new JMSException("syncSendPacket failed with unknown exception");
            }
View Full Code Here

        sendReceipt(packet, null, false);
    }

    private void sendReceipt(Packet packet, Throwable requestEx, boolean failed) {
        if (packet != null && packet.isReceiptRequired()) {
            Receipt receipt = new Receipt();
            receipt.setId(this.packetIdGenerator.generateId());
            receipt.setCorrelationId(packet.getId());
            receipt.setBrokerName(brokerConnector.getBrokerInfo().getBrokerName());
            receipt.setClusterName(brokerConnector.getBrokerInfo().getClusterName());
            receipt.setException(requestEx);
            receipt.setFailed(failed);
            send(receipt);
        }
    }
View Full Code Here

        sendReceipt(packet, null, false);
    }

    private void sendReceipt(Packet packet, Throwable requestEx, boolean failed) {
        if (packet != null && packet.isReceiptRequired()) {
            Receipt receipt = new Receipt();
            receipt.setId(this.packetIdGenerator.generateId());
            receipt.setCorrelationId(packet.getId());
            receipt.setBrokerName(brokerConnector.getBrokerInfo().getBrokerName());
            receipt.setClusterName(brokerConnector.getBrokerInfo().getClusterName());
            receipt.setException(requestEx);
            receipt.setFailed(failed);
            send(receipt);
        }
    }
View Full Code Here

     * @param timeout
     * @throws JMSException
     */
    public void syncSendPacket(Packet packet, int timeout) throws JMSException {
        if (isTransportOK && !closed.get()) {
            Receipt receipt;
            packet.setReceiptRequired(true);
            receipt = this.transportChannel.send(packet, timeout);
            if (receipt != null) {
                if (receipt.isFailed()) {
                    Throwable e = receipt.getException();
                    if (e != null) {
                        throw JMSExceptionHelper.newJMSException(e);
                    }
                    throw new JMSException("syncSendPacket failed with unknown exception");
                }
View Full Code Here

    }

    public Receipt syncSendRequest(Packet packet) throws JMSException {
        checkClosed();
        if (isTransportOK && !closed.get()) {
            Receipt receipt;
            packet.setReceiptRequired(true);
            if (packet.getId() == null || packet.getId().length() == 0) {
                packet.setId(this.packetIdGenerator.generateId());
            }
            receipt = this.transportChannel.send(packet);
            if (receipt.isFailed()) {
                Throwable e = receipt.getException();
                if (e != null) {
                    throw (JMSException) new JMSException(e.getMessage()).initCause(e);
                }
                throw new JMSException("syncSendPacket failed with unknown exception");
            }
View Full Code Here

     */
    public Receipt send(Packet packet, int timeout) throws JMSException {
        ReceiptHolder rh = new ReceiptHolder();
        requestMap.put(packet.getId(), rh);
        doAsyncSend(packet);
        Receipt result = rh.getReceipt(timeout);
        return result;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.Receipt

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.