public URL getURL() throws JMSException { if (url == null && remoteBlobUrl != null) { try { url = new URL(remoteBlobUrl); } catch (MalformedURLException e) { throw JMSExceptionSupport.create(e); } } return url; }
private void waitForBrokerInfo() throws JMSException { try { brokerInfoReceived.await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw JMSExceptionSupport.create(e); } }
private void doAsyncSendPacket(Command command) throws JMSException { try { this.transport.oneway(command); } catch (IOException e) { throw JMSExceptionSupport.create(e); } }
@Override public void acknowledge() throws JMSException { if (acknowledgeCallback != null) { try { acknowledgeCallback.execute(); } catch (JMSException e) { throw e; } catch (Throwable e) { throw JMSExceptionSupport.create(e); } } }
/** * return all property names, including standard JMS properties and JMSX properties * @return Enumeration of all property names on this message * @throws JMSException */ @SuppressWarnings("rawtypes") public Enumeration getAllPropertyNames() throws JMSException { try { Vector<String> result = new Vector<String>(this.getProperties().keySet()); result.addAll(JMS_PROPERTY_SETERS.keySet()); return result.elements(); } catch (IOException e) { throw JMSExceptionSupport.create(e); } }
private void beforeEnd() throws JMSException { if (synchronizations == null) { return; } int size = synchronizations.size(); try { for (;beforeEndIndex < size;) { synchronizations.get(beforeEndIndex++).beforeEnd(); } } catch (JMSException e) { throw e; } catch (Throwable e) { throw JMSExceptionSupport.create(e); } }
/** * Writes a byte array to the bytes message stream. * * @param value the byte array to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. * @throws MessageNotWriteableException if the message is in read-only mode. */ @Override public void writeBytes(byte[] value) throws JMSException { initializeWriting(); try { this.dataOut.write(value); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
@Override public boolean propertyExists(String name) throws JMSException { try { return (this.getProperties().containsKey(name) || getObjectProperty(name)!= null); } catch (IOException e) { throw JMSExceptionSupport.create(e); } }
public Object evaluate(Message message) throws JMSException { if (jmsPropertyExpression != null) { return jmsPropertyExpression.evaluate(message); } try { return message.getProperty(name); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
/** * This will create an object of MessageId. For it to be valid, the instance * variable ProducerId and producerSequenceId must be initialized. * * @param producerId * @param producerSequenceId * @throws JMSException */ public void setJMSMessageID(ProducerId producerId, long producerSequenceId) throws JMSException { MessageId id = null; try { id = new MessageId(producerId, producerSequenceId); this.setMessageId(id); } catch (Throwable e) { throw JMSExceptionSupport.create("Invalid message id '" + id + "', reason: " + e.getMessage(), e); } }
@Override public boolean matches(MessageEvaluationContext mec) throws JMSException { try { // for Queues - the message can be acknowledged and dropped whilst // still // in the dispatch loop // so need to get the reference to it Message message = mec.getMessage(); return message != null && matchesForwardingFilter(message, mec); } catch (IOException e) { throw JMSExceptionSupport.create(e); } }
void stop() throws JMSException { try { if (messageQueue.isRunning()) { synchronized(this) { messageQueue.stop(); if (this.taskRunner != null) { this.taskRunner.shutdown(); this.taskRunner = null; } } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw JMSExceptionSupport.create(e); } }
/** * Writes a <code>byte</code> to the stream message. * * @param value the <code>byte</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. * @throws MessageNotWriteableException if the message is in read-only mode. */ @Override public void writeByte(byte value) throws JMSException { initializeWriting(); try { MarshallingSupport.marshalByte(dataOut, value); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
/** * Writes a <code>short</code> to the stream message. * * @param value the <code>short</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. * @throws MessageNotWriteableException if the message is in read-only mode. */ @Override public void writeShort(short value) throws JMSException { initializeWriting(); try { MarshallingSupport.marshalShort(dataOut, value); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
/** * Writes a <code>double</code> to the stream message. * * @param value the <code>double</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. * @throws MessageNotWriteableException if the message is in read-only mode. */ @Override public void writeDouble(double value) throws JMSException { initializeWriting(); try { MarshallingSupport.marshalDouble(dataOut, value); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
/** * Writes a <code>char</code> to the stream message. * * @param value the <code>char</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. * @throws MessageNotWriteableException if the message is in read-only mode. */ @Override public void writeChar(char value) throws JMSException { initializeWriting(); try { MarshallingSupport.marshalChar(dataOut, value); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
public Object evaluate(MessageEvaluationContext message) throws JMSException { try { if (message.isDropped()) { return null; } return evaluator.evaluate(message.getMessage()) ? Boolean.TRUE : Boolean.FALSE; } catch (IOException e) { throw JMSExceptionSupport.create(e); } }
public boolean matches(MessageEvaluationContext message) throws JMSException { try { if (message.isDropped()) { return false; } String messageConnectionId = message.getMessage().getProducerId().getConnectionId(); return !connectionId.equals(messageConnectionId); } catch (IOException e) { throw JMSExceptionSupport.create(e); } }
public void onSend() throws JMSException { super.onSend(); // lets ensure we upload the BLOB first out of band before we send the // message if (blobUploader != null) { try { URL value = blobUploader.upload(this); setURL(value); } catch (IOException e) { throw JMSExceptionSupport.create(e); } } }
public boolean matches(MessageEvaluationContext message) throws JMSException { try { if (message.isDropped()) { return false; } return matches(message.getMessage().getDestination()); } catch (IOException e) { throw JMSExceptionSupport.create(e); } }