Tabnine Logo
javax.jms
Code IndexAdd Tabnine to your IDE (free)

How to use javax.jms

Best Java code snippets using javax.jms (Showing top 20 results out of 3,573)

origin: spring-projects/spring-framework

/**
 * Create a JMS BytesMessage for the given byte array.
 * @param bytes the byte array to convert
 * @param session current JMS session
 * @return the resulting message
 * @throws JMSException if thrown by JMS methods
 * @see javax.jms.Session#createBytesMessage
 */
protected BytesMessage createMessageForByteArray(byte[] bytes, Session session) throws JMSException {
  BytesMessage message = session.createBytesMessage();
  message.writeBytes(bytes);
  return message;
}
origin: spring-projects/spring-framework

/**
 * Create a new JMS Session for this JMS invoker.
 */
protected Session createSession(Connection con) throws JMSException {
  return con.createSession(false, Session.AUTO_ACKNOWLEDGE);
}
origin: spring-projects/spring-framework

@Override
public void setDisableMessageID(boolean disableMessageID) throws JMSException {
  if (this.originalDisableMessageID == null) {
    this.originalDisableMessageID = this.target.getDisableMessageID();
  }
  this.target.setDisableMessageID(disableMessageID);
}
origin: spring-projects/spring-framework

@Override
public void send(Message message, int deliveryMode, int priority, long timeToLive,
    CompletionListener completionListener) throws JMSException {
  this.target.send(message, deliveryMode, priority, timeToLive, completionListener);
}
origin: spring-projects/spring-framework

/**
 * Extract a String from the given TextMessage.
 * @param message the message to convert
 * @return the resulting String
 * @throws JMSException if thrown by JMS methods
 */
protected String extractStringFromMessage(TextMessage message) throws JMSException {
  return message.getText();
}
origin: spring-projects/spring-framework

/**
 * Create a JMS TextMessage for the given String.
 * @param text the String to convert
 * @param session current JMS session
 * @return the resulting message
 * @throws JMSException if thrown by JMS methods
 * @see javax.jms.Session#createTextMessage
 */
protected TextMessage createMessageForString(String text, Session session) throws JMSException {
  return session.createTextMessage(text);
}
origin: spring-projects/spring-framework

  @Override
  public String getJMSType() throws JMSException {
    throw new JMSException("illegal property");
  }
};
origin: spring-projects/spring-framework

/**
 * Extract a byte array from the given {@link BytesMessage}.
 * @param message the message to convert
 * @return the resulting byte array
 * @throws JMSException if thrown by JMS methods
 */
protected byte[] extractByteArrayFromMessage(BytesMessage message) throws JMSException {
  byte[] bytes = new byte[(int) message.getBodyLength()];
  message.readBytes(bytes);
  return bytes;
}
origin: spring-projects/spring-framework

/**
 * Extract a Serializable object from the given {@link ObjectMessage}.
 * @param message the message to convert
 * @return the resulting Serializable object
 * @throws JMSException if thrown by JMS methods
 */
protected Serializable extractSerializableFromMessage(ObjectMessage message) throws JMSException {
  return message.getObject();
}
origin: spring-projects/spring-framework

/**
 * Create a JMS ObjectMessage for the given Serializable object.
 * @param object the Serializable object to convert
 * @param session current JMS session
 * @return the resulting message
 * @throws JMSException if thrown by JMS methods
 * @see javax.jms.Session#createObjectMessage
 */
protected ObjectMessage createMessageForSerializable(Serializable object, Session session) throws JMSException {
  return session.createObjectMessage(object);
}
origin: spring-projects/spring-framework

public CachedMessageProducer(MessageProducer target) throws JMSException {
  this.target = target;
  this.deliveryMode = target.getDeliveryMode();
  this.priority = target.getPriority();
  this.timeToLive = target.getTimeToLive();
}
origin: spring-projects/spring-framework

@Override
public Session createSession(Connection con) throws JMSException {
  return ((TopicConnection) con).createTopicSession(
      synchedLocalTransactionAllowed, Session.AUTO_ACKNOWLEDGE);
}
@Override
origin: spring-projects/spring-framework

@Override
public TopicConnection createTopicConnection(String username, String password) throws JMSException {
  throw new javax.jms.IllegalStateException(
      "SingleConnectionFactory does not support custom username and password");
}
origin: spring-projects/spring-framework

/**
 * Create a JMS Session for the given Connection.
 * <p>This implementation uses JMS 1.1 API.
 * @param con the JMS Connection to create a Session for
 * @return the new JMS Session
 * @throws javax.jms.JMSException if thrown by JMS API methods
 */
protected Session createSession(Connection con) throws JMSException {
  return con.createSession(true, Session.AUTO_ACKNOWLEDGE);
}
origin: spring-projects/spring-framework

  @Override
  public int getJMSDeliveryMode() throws JMSException {
    throw new JMSException("illegal property");
  }
};
origin: spring-projects/spring-framework

  @Override
  public String getJMSMessageID() throws JMSException {
    throw new JMSException("illegal property");
  }
};
origin: spring-projects/spring-framework

  @Override
  public long getJMSTimestamp() throws JMSException {
    throw new JMSException("illegal property");
  }
};
origin: spring-projects/spring-framework

  @Override
  public Destination getJMSDestination() throws JMSException {
    throw new JMSException("illegal property");
  }
};
origin: spring-projects/spring-framework

  @Override
  public int getJMSPriority() throws JMSException {
    throw new JMSException("illegal property");
  }
};
origin: spring-projects/spring-framework

  @Override
  public void setJMSReplyTo(Destination replyTo) throws JMSException {
    throw new JMSException("illegal property");
  }
};
javax.jms

Most used classes

  • Session
    A Session object is a single-threaded context for producing and consuming messages. Although it may
  • Connection
    A Connection object is a client's active connection to its JMS provider. It typically allocates prov
  • Message
    The Message interface is the root interface of all JMS messages. It defines the message header and t
  • MessageProducer
    A client uses a MessageProducer object to send messages to a destination. A MessageProducer object
  • TextMessage
  • JMSException,
  • MessageConsumer,
  • ObjectMessage,
  • BytesMessage,
  • TopicSession,
  • QueueSession,
  • TopicConnectionFactory,
  • TopicConnection,
  • TopicPublisher,
  • MapMessage,
  • QueueSender,
  • QueueConnectionFactory,
  • QueueConnection,
  • Topic
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now