@Override protected final void finalize() throws Throwable { if (!closed) { if (this.factoryReference.isFinalizeChecks()) { ActiveMQJMSClientLogger.LOGGER.connectionLeftOpen(creationStack); } close(); } }
@Override public void stop() { threadAwareContext.assertNotMessageListenerThreadRuntime(); try { connection.stop(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public JMSProducer createProducer() { checkSession(); try { return new ActiveMQJMSProducer(this, getInnerProducer()); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public TextMessage createTextMessage() throws JMSException { checkClosed(); ActiveMQTextMessage msg = new ActiveMQTextMessage(session); msg.setText(null); msg.setEnable1xPrefixes(enable1xPrefixes); return msg; }
@Override public ObjectMessage createObjectMessage(final Serializable object) throws JMSException { checkClosed(); ActiveMQObjectMessage msg = new ActiveMQObjectMessage(session, options); msg.setObject(object); msg.setEnable1xPrefixes(enable1xPrefixes); return msg; }
@Override public Message createMessage() throws JMSException { checkClosed(); ActiveMQMessage message = new ActiveMQMessage(session); message.setEnable1xPrefixes(enable1xPrefixes); return message; }
@Override public StreamMessage createStreamMessage() throws JMSException { checkClosed(); ActiveMQStreamMessage message = new ActiveMQStreamMessage(session); message.setEnable1xPrefixes(enable1xPrefixes); return message; }
@Override public synchronized void stop() throws JMSException { threadAwareContext.assertNotMessageListenerThread(); checkClosed(); for (ActiveMQSession session : sessions) { session.stop(); } started = false; }
@Override public BytesMessage createBytesMessage() throws JMSException { checkClosed(); ActiveMQBytesMessage message = new ActiveMQBytesMessage(session); message.setEnable1xPrefixes(enable1xPrefixes); return message; }
protected ActiveMQDestination(final SimpleString address, final TYPE type, final ActiveMQSession session) { if (address != null) { setSimpleAddress(address); } this.thetype = type; this.session = session; this.temporary = TYPE.isTemporary(type); this.queue = TYPE.isQueue(type); }
@Override public ConnectionMetaData getMetaData() throws JMSException { checkClosed(); if (metaData == null) { metaData = new ActiveMQConnectionMetaData(thisVersion); } return metaData; }
@Override public JMSProducer send(Destination destination, String body) { TextMessage message = context.createTextMessage(body); send(destination, message); return this; }
@Override public void setExceptionListener(ExceptionListener listener) { try { connection.setExceptionListener(listener); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public JMSProducer send(Destination destination, Serializable body) { ObjectMessage message = context.createObjectMessage(body); send(destination, message); return this; }
@Override public ExceptionListener getExceptionListener() { try { return connection.getExceptionListener(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public void start() { try { connection.start(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public synchronized void start() throws JMSException { checkClosed(); for (ActiveMQSession session : sessions) { session.start(); } justCreated = false; started = true; }
@Override public void setDeliveryMode(final int deliveryMode) throws JMSException { checkClosed(); if (deliveryMode != DeliveryMode.NON_PERSISTENT && deliveryMode != DeliveryMode.PERSISTENT) { throw ActiveMQJMSClientBundle.BUNDLE.illegalDeliveryMode(deliveryMode); } defaultDeliveryMode = deliveryMode; }
@Override public ConnectionMetaData getMetaData() { try { return connection.getMetaData(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public TextMessage createTextMessage(final String text) throws JMSException { checkClosed(); ActiveMQTextMessage msg = new ActiveMQTextMessage(session); msg.setText(text); msg.setEnable1xPrefixes(enable1xPrefixes); return msg; }