Package ca.uhn.hl7v2.protocol

Examples of ca.uhn.hl7v2.protocol.TransportException


        Transportable result = null;
        try {
            Message message = myInbound.receive();
            result = toTransportable(message);
        } catch (JMSException e) {
            throw new TransportException(e);           
        }
        return result;
    }
View Full Code Here


            myInbound.connect();
            if (myInbound != myOutbound) {
                myOutbound.connect();
            }
        } catch (JMSException e) {
            throw new TransportException(e);
        }
    }
View Full Code Here

            myInbound.disconnect();
            if (myInbound != myOutbound) {
                myOutbound.disconnect();
            }
        } catch (JMSException e) {
            throw new TransportException(e);
        }
    }
View Full Code Here

    private Socket getSocket(SocketAddress theAddress) throws TransportException {
        Socket s = new Socket();       
        try {
            s.connect(theAddress);
        } catch (IOException e) {
            throw new TransportException(e);
        }
        return s;       
    }
View Full Code Here

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

        Message message;
        try {
            message = getMessage();
        
            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 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

        Transportable result = null;
        try {
            Message message = receiveJMS();
            result = toTransportable(message);
        } catch (JMSException e) {
            throw new TransportException(e);           
        }
        return result;
    }
View Full Code Here

            myPublisher = mySendingSession.createPublisher(myTopic);

            myReceivingSession = myConnection.createTopicSession(transacted, ackMode);
            mySubscriber = myReceivingSession.createSubscriber(myTopic);
        } 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

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.