// Path: JMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/DestinationWrapper.java
// public final class DestinationWrapper<E extends Destination> {
// 	
// 	public E destination;
// 	public String name;
// 	
// 	public DestinationWrapper( String name, E destination ) {
// 		this.destination = destination;
// 		this.name = name;
// 	}
// 	
// }


import java.util.Random;
import java.util.logging.Level;
import javax.jms.Message;
import javax.jms.Queue;
import com.ibm.uk.hursley.perfharness.Config;
import com.ibm.uk.hursley.perfharness.Log;
import com.ibm.uk.hursley.perfharness.WorkerThread;
import com.ibm.uk.hursley.perfharness.jms.DestinationWrapper;
/********************************************************* {COPYRIGHT-TOP} ***
* Licensed Materials - Property of IBM
*
* IBM Performance Harness for Java Message Service
*
* (C) Copyright IBM Corp. 2005, 2007  All Rights Reserved.
*
* US Government Users Restricted Rights - Use, duplication, or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
********************************************************** {COPYRIGHT-END} **/
/*
 * $Id: PutGet.java 516 2010-12-20 10:28:14Z fentono $
 * JMSPerfHarness $Name$
 */

package com.ibm.uk.hursley.perfharness.jms.r20;




/**
 * Sends a message then receives one from the same queue.  Normal use is with
 * correlation identifier to ensure the same message is received.
 * @author smassey@uk.ibm.com 
 */

public final class PutGet extends JMS20WorkerThread implements WorkerThread.Paceable {
	@SuppressWarnings("unused")
	private static final String c = com.ibm.uk.hursley.perfharness.Copyright.COPYRIGHT; // IGNORE compiler warning

    Message inMessage = null;
    Message outMessage = null;
    String correlID = null;
    
    public static void registerConfig() {
		Config.registerSelf(PutGet.class);
	}    
    
    /**
     * Constructor for JMSClientThread.
     * @param name
     */
    public PutGet(String name) {
        super(name);
    }

	protected void buildJMSResources() throws Exception {
		super.buildJMSResources();
			
        // Open queues
// Path: JMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/DestinationWrapper.java
// public final class DestinationWrapper<E extends Destination> {
// 	
// 	public E destination;
// 	public String name;
// 	
// 	public DestinationWrapper( String name, E destination ) {
// 		this.destination = destination;
// 		this.name = name;
// 	}
// 	
// }


// Path: JMSPerfHarness/src/com/ibm/uk/hursley/perfharness/jms/r20/PutGet.java
import java.util.Random;
import java.util.logging.Level;
import javax.jms.Message;
import javax.jms.Queue;
import com.ibm.uk.hursley.perfharness.Config;
import com.ibm.uk.hursley.perfharness.Log;
import com.ibm.uk.hursley.perfharness.WorkerThread;
import com.ibm.uk.hursley.perfharness.jms.DestinationWrapper;

/********************************************************* {COPYRIGHT-TOP} ***
* Licensed Materials - Property of IBM
*
* IBM Performance Harness for Java Message Service
*
* (C) Copyright IBM Corp. 2005, 2007  All Rights Reserved.
*
* US Government Users Restricted Rights - Use, duplication, or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
********************************************************** {COPYRIGHT-END} **/
/*
 * $Id: PutGet.java 516 2010-12-20 10:28:14Z fentono $
 * JMSPerfHarness $Name$
 */

package com.ibm.uk.hursley.perfharness.jms.r20;




/**
 * Sends a message then receives one from the same queue.  Normal use is with
 * correlation identifier to ensure the same message is received.
 * @author smassey@uk.ibm.com 
 */

public final class PutGet extends JMS20WorkerThread implements WorkerThread.Paceable {
	@SuppressWarnings("unused")
	private static final String c = com.ibm.uk.hursley.perfharness.Copyright.COPYRIGHT; // IGNORE compiler warning

    Message inMessage = null;
    Message outMessage = null;
    String correlID = null;
    
    public static void registerConfig() {
		Config.registerSelf(PutGet.class);
	}    
    
    /**
     * Constructor for JMSClientThread.
     * @param name
     */
    public PutGet(String name) {
        super(name);
    }

	protected void buildJMSResources() throws Exception {
		super.buildJMSResources();
			
        // Open queues
        DestinationWrapper<Queue> producerDestinationWrapper = jmsProvider.lookupQueue(destFactory.generateDestination(getThreadNum()), context);