# CustomJMSControl.jcx Sample

This topic inludes the source code for the CustomJMSControl.jcx Sample.

## Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebServices/jms/

## Sample Source Code

`01 package jms; 02 03 import com.bea.control.JMSControl; 04 import java.io.Serializable; 05 06 /** 07 * <p>This customized JMS control demonstrates the use of method annotations for 08 * using XML based JMS messages.</p> 09 * 10 * <p>It uses the same queue for send and receive, so it will send messages to 11 * itself.</p> 12 * 13 * <p>"<i>sendPersonJMS</i>" will publish a message to the send queue with 14 * property values specified.</p> 15 * 16 * <p>"<i>onPersonJMS</i>" defines a callback that will extract values from both the 17 * message and JMS properties.</p> 18 * 19 */ 20 21 /** 22 * @jc:jms 23 * send-type="queue" 24 * send-jndi-name="jms.CustomJmsCtlQ" 25 * receive-type="queue" 26 * receive-jndi-name="jms.CustomJmsCtlQ" 27 * connection-factory-jndi-name="weblogic.jws.jms.QueueConnectionFactory" 28 */ 29 public interface CustomJMSControl extends com.bea.control.ControlExtension, JMSControl 30 { 31 /** 32 * @jc:jms-property key="prop1" value="{p1}" 33 * @jc:jms-property key="prop2" value="{p2}" 34 */ 35 public void sendPersonJMS(String personname, 36 String p1, 37 String p2); 38 39 40 public static interface Callback extends JMSControl.Callback 41 { 42 /** 43 * <p>the "<i>onJMSMessage</i>" event is generated whenever a message arrives.</p> 44 * 45 * @jc:jms-property key="prop1" value="{p1}" 46 * @jc:jms-property key="prop2" value="{p2}" 47 * 48 */ 49 public void onPersonJMS(String pn, 50 String p1, 51 String p2) throws Exception; 52 } 53 }`