com.ibm.websphere.scheduler

Interface MessageTaskInfo

  • All Superinterfaces:
    java.io.Serializable, TaskInfo, TaskStatus


    public interface MessageTaskInfo
    extends TaskInfo
    Used to create a scheduled task which sends a JMS message to either a Queue or Topic. Once created, the MessageTaskInfoScheduler.create before the task will be created in the persistent store.
    See Also:
    TaskInfo, Scheduler
    • Method Detail

      • initialize

        void initialize(java.lang.String connectionFactoryJndiName,
                      java.lang.String destinationJndiName,
                      java.lang.String msg)
        Initializes a MessageTaskInfo using the specified connection factory, destination, and message data. The message type to be sent is a javax.jms.TextMessage.
        Parameters:
        connectionFactoryJndiName - the JNDI name of the Queue or Topic connection factory.
        destinationJndiName - the JNDI name for the destination
        msg - the String Message to send to the destination when the task fires.
      • initialize

        void initialize(java.lang.String connectionFactoryJndiName,
                      java.lang.String destinationJndiName,
                      java.util.Map msg)
                        throws javax.jms.JMSException
        Initializes a MessageTaskInfo using the specified connection factory, destination, and message data. The message type to be sent is a javax.jms.MapMessage. MapMessage key names must be of the type java.lang.String and the values must be Serializable.
        Parameters:
        connectionFactoryJndiName - the JNDI name of the Queue or Topic connection factory.
        destinationJndiName - the JNDI name for the destination
        msg - the MapMessage to send to the destination when the task fires.
        Throws:
        javax.jms.JMSException - a message key in the supplied map is not a java.lang.String or a value is not serializable.
      • initialize

        void initialize(java.lang.String connectionFactoryJndiName,
                      java.lang.String destinationJndiName,
                      byte[] msg)
        Initializes a MessageTaskInfo using the specified connection factory, destination, and message data. The message type to be sent is a javax.jms.BytesMessage
        Parameters:
        connectionFactoryJndiName - the JNDI name of the Queue or Topic connection factory.
        destinationJndiName - the JNDI name for the destination
        msg - the array of bytes to send to the destination when the task fires.
      • setConnectionFactoryJndiName

        void setConnectionFactoryJndiName(java.lang.String connectionFactoryJndiName)
        Sets the JNDI name of either a queue connection factory, or a topic connection factory. This name can either be located in the Global JNDI name space, or in the current java:comp name space.
        Parameters:
        connectionFactoryJndiName - the JNDI name of the connection factory.
      • getConnectionFactoryJndiName

        java.lang.String getConnectionFactoryJndiName()
        Retrieves the set connection factory JNDI name.
        Returns:
        the JNDI name of the connection factory or null if not set.
      • setDestinationJndiName

        void setDestinationJndiName(java.lang.String destinationJndiName)
        Sets the JNDI name of a JMS destination. This name can either be located in the Global JNDI name space, or in the current java:comp name space.
        Parameters:
        destinationJndiName - the destination JNDI name.
      • getDestinationJndiName

        java.lang.String getDestinationJndiName()
        Retrieves the set destination JNDI name.
        Returns:
        the destination JNDI name or null if not set.
      • setMessageData

        void setMessageData(java.lang.String msg)
        Sets the message data. If set, a javax.jms.StringMessage will be sent when the task fires.

        Note: Only one type of message can be sent in a single MessageTaskInfo instance.

        Parameters:
        msg - any text message.
      • setMessageData

        void setMessageData(java.util.Map msg)
        Sets the message data. If set, a javax.jms.MapMessage will be sent when the task fires.
        Parameters:
        msg - any Map of Serializable data.
      • setMessageData

        void setMessageData(byte[] msg)
        Sets the message data. If set, a javax.jms.ByteMessage will be sent when the task fires.
        Parameters:
        msg - any array of bytes.
      • getMessageData

        java.lang.Object getMessageData()
        Retrieves the message data in the form of an Object.
        Returns:
        the String, byte[] or java.util.Map data that was set using the setMessageData methods.
      • setJMSPriority

        void setJMSPriority(int priority)
        Determines the JMS Priority that the message will be sent with. The javax.jms.Message.setJMSPriority(...) method will be called with this value.
        Parameters:
        priority - the JMS priority
      • getJMSPriority

        int getJMSPriority()
        Gets the set priority
        Returns:
        the priority.
      • setUsername

        void setUsername(java.lang.String username)
        Deprecated. use the com.ibm.websphere.scheduler.TaskInfo.setAuthenticationAlias(String alias) method.
        Sets the username which will be used to connect to the JMS ConnectionFactory.
        Parameters:
        username - the username.
        See Also:
        TaskInfo.setAuthenticationAlias(java.lang.String)
      • getUsername

        java.lang.String getUsername()
        Deprecated. use the com.ibm.websphere.scheduler.TaskInfo.getAuthenticationAlias() method.
        Gets the set username
        Returns:
        the username
        See Also:
        TaskInfo.getAuthenticationAlias()
      • setMessageHeaders

        void setMessageHeaders(java.util.Map headers)
                               throws javax.jms.JMSException
        This allows message properties to be specified for the message. This should allow headers to be set for selectors and other purposes. Only valid JMS property types are allowed. A JMSException is thrown when any attempt to use non-compliant values is detected.

        The allowable types are [Boolean, Byte, Short, Integer, Long, Float, Double, String].

        Parameters:
        headers - the Map holding the properties to be used.
        Throws:
        javax.jms.JMSException - an illegal value was detected.
      • getMessageHeaders

        java.util.Map getMessageHeaders()
        This returns the properties associated with the message. A copy of the properties is returned which can be freely modified. How-ever, to change the properties then setMessageHeaders must be called with the new headers.
        Returns:
        null or a copy of the property map.
      • setPassword

        void setPassword(java.lang.String password)
        Deprecated. use the com.ibm.websphere.scheduler.TaskInfo.setAuthenticationAlias(String alias) method.
        Sets the password which will be used to connect to the JMS ConnectionFactory. The password will be encrypted.
        Parameters:
        password - the password.
        See Also:
        TaskInfo.setAuthenticationAlias(java.lang.String)
IBM WebSphere Application ServerTM
Release 9.0