# WLI JMS Control Interface

The WLI JMS control enables WebLogic Workshop business processes to easily interact with messaging systems that provide a JMS implementation. A specific WLI JMS control is associated with particular facilities of the messaging system. The WLI JMS control is an extension of the JMS control.

The following are the WLI JMS control methods:

    package com.bea.control;

    public interface WliJMSControl extends com.bea.control.JMSControl {
        /**
         *  This method sets the control properties dynamically.
         *  Properties set by this method over-ride the static
         *  annotations.
         * @param jmsProps control properties
         */
        public void setProperties(JMSControlPropertiesDocument        jmsProps) throws ControlException;

        /**
         * This method returns the WliJMSControl's properties.
         * @return JMSControlPropertiesDocument WliJMSControl
         * dynamic properties
         */
        public JMSControlPropertiesDocument getControlProperties();

        public interface Callback extends           com.bea.control.JMSControl.Callback {}
    }

### Sample Extended WLI JMS Control

The following code shows an example of an extended control. This code is automatically created by the control wizard.

    package FunctionDemo;

    import com.bea.control.*;
    import com.bea.xml.*;
    import java.io.Serializable;

    /**
     *   @jc:jms send-type="queue" send-jndi-name="myqueue.async.request"
     *   receive-type="queue"  receive-jndi-name="myqueue.async.response"
     *   connection-factory-jndi-name="weblogic.jws.jms.QueueConnFactory"
     */
    public interface MyJMS extends
     WliJMSControl,com.bea.control.ControlExtension
    {
        /**
         * this method will send a javax.jms.TextMessage to send-jndi-name
         */
        public void sendTextMessage(XmlObject payload);
        /**
         * If your control specifies receive-jndi-name, that is your JWS expects to
         * receive messages from this control, you will need to implement
         * callback handlers.
         */
        interface Callback extends WliJMSControl.Callback
        {
            /**
             * Define only 1 callback method here.
             *
             * This method defines a callback that can handle text messages
             * from receive-jndi-name
             */
            public void receiveTextMessage(XmlObject payload);
        }
    }