类 JmsItemReader<T>

  • 所有已实现的接口:
    ItemReader<T>, org.springframework.beans.factory.InitializingBean

    public class JmsItemReader<T>
    extends java.lang.Object
    implements ItemReader<T>, org.springframework.beans.factory.InitializingBean
    An ItemReader for JMS using a JmsTemplate. The template should have a default destination, which will be used to provide items in read().

    The implementation is thread-safe after its properties are set (normal singleton behavior).
    作者:
    Dave Syer
    • 字段概要

      字段 
      修饰符和类型字段说明
      protected java.lang.Class<? extends T>itemType 
      protected org.springframework.jms.core.JmsOperationsjmsTemplate 
      protected org.apache.commons.logging.Loglogger 
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      voidafterPropertiesSet() 
      Tread()
      Reads a piece of input data and advance to the next one.
      voidsetItemType​(java.lang.Class<? extends T> itemType)
      Set the expected type of incoming message payloads.
      voidsetJmsTemplate​(org.springframework.jms.core.JmsOperations jmsTemplate)
      Setter for JMS template.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • logger

        protected org.apache.commons.logging.Log logger
      • itemType

        protected java.lang.Class<? extends T> itemType
      • jmsTemplate

        protected org.springframework.jms.core.JmsOperations jmsTemplate
    • 方法详细资料

      • setJmsTemplate

        public void setJmsTemplate​(org.springframework.jms.core.JmsOperations jmsTemplate)
        Setter for JMS template.
        参数:
        jmsTemplate - a JmsOperations instance
      • setItemType

        public void setItemType​(java.lang.Class<? extends T> itemType)
        Set the expected type of incoming message payloads. Set this to Message to receive the raw underlying message.
        参数:
        itemType - the java class of the items to be delivered. Typically the same as the class parameter
        抛出:
        java.lang.IllegalStateException - if the message payload is of the wrong type.
      • read

        public T read()
        从接口复制的说明: ItemReader
        Reads a piece of input data and advance to the next one. Implementations must return null at the end of the input data set. In a transactional setting, caller might get the same item twice from successive calls (or otherwise), if the first call was in a transaction that rolled back.
        指定者:
        read 在接口中 ItemReader<T>
        返回:
        T the item to be processed or null if the data source is exhausted
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        指定者:
        afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
        抛出:
        java.lang.Exception