Package ca.uhn.hl7v2.protocol

Examples of ca.uhn.hl7v2.protocol.TransportException


            }
            if (myReceivingSession != null) {
                myReceivingSession.close();
            }
        } catch (JMSException e) {
            throw new TransportException(e);
        }       
    }
View Full Code Here


                getOutboundStream().close();
                getInboundStream().close();
                getSocket().close();
            }           
        } catch (IOException e) {
            throw new TransportException(e);
        }
    }
View Full Code Here

    public OutputStream getOutboundStream() throws TransportException {
        checkConnected();
        try {
            return getSocket().getOutputStream();
        } catch (IOException e) {
            throw new TransportException(e);
        }
    }
View Full Code Here

        }
    }
   
    private void checkConnected() throws TransportException {
        if (!isConnected()) {
            throw new TransportException("The socket is not connected");
        }
    }
View Full Code Here

    public InputStream getInboundStream() throws TransportException {
        checkConnected();
        try {
            return getSocket().getInputStream();
        } catch (IOException e) {
            throw new TransportException(e);
        }
    }
View Full Code Here

            mySender = mySendingSession.createSender(myQueue);

            myReceivingSession = myConnection.createQueueSession(transacted, ackMode);
            myReceiver = myReceivingSession.createReceiver(myQueue);
        } catch (JMSException e) {
            throw new TransportException(e);
        }
    }
View Full Code Here

            }
            if (myReceivingSession != null) {
                myReceivingSession.close();
            }
        } catch (JMSException e) {
            throw new TransportException(e);
        }       
    }
View Full Code Here

    public void doSend(Transportable theMessage) throws TransportException {
        try {           
            Message message = toMessage(theMessage);
            myOutbound.send(message);
        } catch (JMSException e) {
            throw new TransportException(e);
        }
    }
View Full Code Here

        Message message;
        try {
            message = myOutbound.createMessage();
        
            if ( !(message instanceof TextMessage)) {
                throw new TransportException("This implementation expects getMessage() to return "
                    + " a TextMessage.  Override this method if another message type is to be used");
            }

            ((TextMessage) message).setText(theSource.getMessage());
       
            Iterator<String> it = theSource.getMetadata().keySet().iterator();
            while (it.hasNext()) {
                Object key = it.next();
                Object val = theSource.getMetadata().get(key);
                message.setObjectProperty(key.toString(), val);
            }
        } catch (JMSException e) {
            throw new TransportException(e);
        }      
       
        return message;
    }
View Full Code Here

     * @param theMessage a JMS Message from which to obtain data 
     * @return a Transportable containing data from the given Message
     */
    protected Transportable toTransportable(Message theMessage) throws TransportException {
        if ( !(theMessage instanceof TextMessage)) {
            throw new TransportException("This implementation expects getMessage() to return "
                + " a TextMessage.  Override this method if another message type is to be used");
        }
       
        Transportable result = null;
        try {
            String text = ((TextMessage) theMessage).getText();
            result = new TransportableImpl(text);
            result.getMetadata().putAll(getCommonMetadata());
        } catch (JMSException e) {
            throw new TransportException(e);
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of ca.uhn.hl7v2.protocol.TransportException

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.