/** * Creates an initialized <CODE>BlobMessage</CODE> object. A * <CODE>BlobMessage</CODE> object is used to send a message containing * the <CODE>File</CODE> content. Before the message is sent the file * conent will be uploaded to the broker or some other remote repository * depending on the {@link #getBlobTransferPolicy()}. * * @param file the file to be uploaded to some remote repo (or the broker) * depending on the strategy * @return a BlobMessage * @throws JMSException if the JMS provider fails to create this message due * to some internal error. */ public BlobMessage createBlobMessage(File file) throws JMSException { ActiveMQBlobMessage message = new ActiveMQBlobMessage(); configureMessage(message); message.setBlobUploader(new BlobUploader(getBlobTransferPolicy(), file)); message.setBlobDownloader(new BlobDownloader((getBlobTransferPolicy()))); message.setDeletedByBroker(true); message.setName(file.getName()); return message; }
public BlobUploadStrategy getStrategy() { return getBlobTransferPolicy().getUploadStrategy(); } }
public URL upload(ActiveMQBlobMessage message) throws JMSException, IOException { if (file != null) { return getStrategy().uploadFile(message, file); } else { return getStrategy().uploadStream(message, in); } }
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 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); } } }
/** * Creates an initialized <CODE>BlobMessage</CODE> object. A * <CODE>BlobMessage</CODE> object is used to send a message containing * the <CODE>File</CODE> content. Before the message is sent the file * conent will be uploaded to the broker or some other remote repository * depending on the {@link #getBlobTransferPolicy()}. <br/> * <p> * The caller of this method is responsible for closing the * input stream that is used, however the stream can not be closed * until <b>after</b> the message has been sent. To have this class * manage the stream and close it automatically, use the method * {@link ActiveMQSession#createBlobMessage(File)} * * @param in the stream to be uploaded to some remote repo (or the broker) * depending on the strategy * @return a BlobMessage * @throws JMSException if the JMS provider fails to create this message due * to some internal error. */ public BlobMessage createBlobMessage(InputStream in) throws JMSException { ActiveMQBlobMessage message = new ActiveMQBlobMessage(); configureMessage(message); message.setBlobUploader(new BlobUploader(getBlobTransferPolicy(), in)); message.setBlobDownloader(new BlobDownloader(getBlobTransferPolicy())); message.setDeletedByBroker(true); return message; }
public URL upload(ActiveMQBlobMessage message) throws JMSException, IOException { if (file != null) { return getStrategy().uploadFile(message, file); } else { return getStrategy().uploadStream(message, in); } }
public BlobUploadStrategy getStrategy() { return getBlobTransferPolicy().getUploadStrategy(); } }
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); } } }
/** * Creates an initialized <CODE>BlobMessage</CODE> object. A * <CODE>BlobMessage</CODE> object is used to send a message containing * the <CODE>File</CODE> content. Before the message is sent the file * conent will be uploaded to the broker or some other remote repository * depending on the {@link #getBlobTransferPolicy()}. * * @param file the file to be uploaded to some remote repo (or the broker) * depending on the strategy * @return a BlobMessage * @throws JMSException if the JMS provider fails to create this message due * to some internal error. */ public BlobMessage createBlobMessage(File file) throws JMSException { ActiveMQBlobMessage message = new ActiveMQBlobMessage(); configureMessage(message); message.setBlobUploader(new BlobUploader(getBlobTransferPolicy(), file)); message.setBlobDownloader(new BlobDownloader((getBlobTransferPolicy()))); message.setDeletedByBroker(true); message.setName(file.getName()); return message; }
public URL upload(ActiveMQBlobMessage message) throws JMSException, IOException { if (file != null) { return getStrategy().uploadFile(message, file); } else { return getStrategy().uploadStream(message, in); } }
public BlobUploadStrategy getStrategy() { return getBlobTransferPolicy().getUploadStrategy(); } }
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); } } }
/** * Creates an initialized <CODE>BlobMessage</CODE> object. A * <CODE>BlobMessage</CODE> object is used to send a message containing * the <CODE>File</CODE> content. Before the message is sent the file * conent will be uploaded to the broker or some other remote repository * depending on the {@link #getBlobTransferPolicy()}. * * @param file the file to be uploaded to some remote repo (or the broker) * depending on the strategy * @return a BlobMessage * @throws JMSException if the JMS provider fails to create this message due * to some internal error. */ public BlobMessage createBlobMessage(File file) throws JMSException { ActiveMQBlobMessage message = new ActiveMQBlobMessage(); configureMessage(message); message.setBlobUploader(new BlobUploader(getBlobTransferPolicy(), file)); message.setBlobDownloader(new BlobDownloader((getBlobTransferPolicy()))); message.setDeletedByBroker(true); message.setName(file.getName()); return message; }
public URL upload(ActiveMQBlobMessage message) throws JMSException, IOException { if (file != null) { return getStrategy().uploadFile(message, file); } else { return getStrategy().uploadStream(message, in); } }
public BlobUploadStrategy getStrategy() { return getBlobTransferPolicy().getUploadStrategy(); } }
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); } } }
/** * Creates an initialized <CODE>BlobMessage</CODE> object. A * <CODE>BlobMessage</CODE> object is used to send a message containing * the <CODE>File</CODE> content. Before the message is sent the file * conent will be uploaded to the broker or some other remote repository * depending on the {@link #getBlobTransferPolicy()}. * * @param file the file to be uploaded to some remote repo (or the broker) * depending on the strategy * @return a BlobMessage * @throws JMSException if the JMS provider fails to create this message due * to some internal error. */ public BlobMessage createBlobMessage(File file) throws JMSException { ActiveMQBlobMessage message = new ActiveMQBlobMessage(); configureMessage(message); message.setBlobUploader(new BlobUploader(getBlobTransferPolicy(), file)); message.setBlobDownloader(new BlobDownloader((getBlobTransferPolicy()))); message.setDeletedByBroker(true); message.setName(file.getName()); return message; }
public URL upload(ActiveMQBlobMessage message) throws JMSException, IOException { if (file != null) { return getStrategy().uploadFile(message, file); } else { return getStrategy().uploadStream(message, in); } }
public BlobUploadStrategy getStrategy() { return getBlobTransferPolicy().getUploadStrategy(); } }