mirror of https://github.com/apache/activemq.git
Fix 1.4 - 1.5 compatibility issues
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@411967 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bc7aa98d45
commit
fa37910edd
|
@ -27,7 +27,8 @@ import javax.jms.Destination;
|
|||
import javax.jms.Topic;
|
||||
import javax.jms.Message;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class JmsConsumerClient extends JmsPerformanceSupport {
|
||||
private static final Log log = LogFactory.getLog(JmsConsumerClient.class);
|
||||
|
|
|
@ -29,14 +29,14 @@ import java.util.Properties;
|
|||
public class PerfMeasurementTool implements PerfEventListener, Runnable {
|
||||
public static final String PREFIX_CONFIG_SYSTEM_TEST = "sampler.";
|
||||
|
||||
private long duration = 5 * 60 * 1000; // 5 mins by default test duration
|
||||
private long interval = 1000; // 1 sec sample interval
|
||||
private long rampUpTime = 1 * 60 * 1000; // 1 min default test ramp up time
|
||||
private long duration = 5 * 60 * 1000; // 5 mins by default test duration
|
||||
private long interval = 1000; // 1 sec sample interval
|
||||
private long rampUpTime = 1 * 60 * 1000; // 1 min default test ramp up time
|
||||
private long rampDownTime = 1 * 60 * 1000; // 1 min default test ramp down time
|
||||
private long sampleIndex = 0;
|
||||
private long sampleIndex = 0;
|
||||
|
||||
private AtomicBoolean start = new AtomicBoolean(false);
|
||||
private AtomicBoolean stop = new AtomicBoolean(false);
|
||||
private AtomicBoolean stop = new AtomicBoolean(false);
|
||||
private AtomicBoolean isRunning = new AtomicBoolean(false);
|
||||
private DataOutputStream dataDoutputStream = null;
|
||||
private Properties samplerSettings = new Properties();
|
||||
|
|
|
@ -86,7 +86,7 @@ public final class ReflectionUtil {
|
|||
} else if (propertyType == Byte.TYPE) {
|
||||
targetClass.getMethod(setterMethod, new Class[] {byte.class}).invoke(target, new Object[] {Byte.valueOf(val)});
|
||||
} else if (propertyType == Character.TYPE) {
|
||||
targetClass.getMethod(setterMethod, new Class[] {char.class}).invoke(target, new Object[] {val.charAt(0)});
|
||||
targetClass.getMethod(setterMethod, new Class[] {char.class}).invoke(target, new Object[] {new Character(val.charAt(0))});
|
||||
}
|
||||
} else {
|
||||
// Set String type
|
||||
|
@ -96,7 +96,7 @@ public final class ReflectionUtil {
|
|||
// For unknown object type, try to call the valueOf method of the object
|
||||
// to convert the string to the target object type
|
||||
} else {
|
||||
Object param = propertyType.getMethod("valueOf", new Class[] {String.class}).invoke(null, val);
|
||||
Object param = propertyType.getMethod("valueOf", new Class[] {String.class}).invoke(null, new Object[] {val});
|
||||
targetClass.getMethod(setterMethod, new Class[] {propertyType}).invoke(target, new Object[] {param});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,17 +74,17 @@ public class ActiveMQPojoSPI implements SPIConnectionFactory {
|
|||
|
||||
setting = settings.getProperty(KEY_ASYNC_SEND);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setUseAsyncSend(Boolean.parseBoolean(setting));
|
||||
factory.setUseAsyncSend(Boolean.getBoolean(setting));
|
||||
}
|
||||
|
||||
setting = settings.getProperty(KEY_ASYNC_DISPATCH);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setAsyncDispatch(Boolean.parseBoolean(setting));
|
||||
factory.setAsyncDispatch(Boolean.getBoolean(setting));
|
||||
}
|
||||
|
||||
setting = settings.getProperty(KEY_ASYNC_SESSION);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setAlwaysSessionAsync(Boolean.parseBoolean(setting));
|
||||
factory.setAlwaysSessionAsync(Boolean.getBoolean(setting));
|
||||
}
|
||||
|
||||
setting = settings.getProperty(KEY_CLOSE_TIMEOUT);
|
||||
|
@ -94,32 +94,32 @@ public class ActiveMQPojoSPI implements SPIConnectionFactory {
|
|||
|
||||
setting = settings.getProperty(KEY_COPY_MSG_ON_SEND);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setCopyMessageOnSend(Boolean.parseBoolean(setting));
|
||||
factory.setCopyMessageOnSend(Boolean.getBoolean(setting));
|
||||
}
|
||||
|
||||
setting = settings.getProperty(KEY_DISABLE_TIMESTAMP);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setDisableTimeStampsByDefault(Boolean.parseBoolean(setting));
|
||||
factory.setDisableTimeStampsByDefault(Boolean.getBoolean(setting));
|
||||
}
|
||||
|
||||
setting = settings.getProperty(KEY_DEFER_OBJ_SERIAL);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setObjectMessageSerializationDefered(Boolean.parseBoolean(setting));
|
||||
factory.setObjectMessageSerializationDefered(Boolean.getBoolean(setting));
|
||||
}
|
||||
|
||||
setting = settings.getProperty(KEY_ON_SEND_PREP_MSG);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setOnSendPrepareMessageBody(Boolean.parseBoolean(setting));
|
||||
factory.setOnSendPrepareMessageBody(Boolean.getBoolean(setting));
|
||||
}
|
||||
|
||||
setting = settings.getProperty(KEY_OPTIM_ACK);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setOptimizeAcknowledge(Boolean.parseBoolean(setting));
|
||||
factory.setOptimizeAcknowledge(Boolean.getBoolean(setting));
|
||||
}
|
||||
|
||||
setting = settings.getProperty(KEY_OPTIM_DISPATCH);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setOptimizedMessageDispatch(Boolean.parseBoolean(setting));
|
||||
factory.setOptimizedMessageDispatch(Boolean.getBoolean(setting));
|
||||
}
|
||||
|
||||
setting = settings.getProperty(KEY_PREFETCH_QUEUE);
|
||||
|
@ -134,12 +134,12 @@ public class ActiveMQPojoSPI implements SPIConnectionFactory {
|
|||
|
||||
setting = settings.getProperty(KEY_USE_COMPRESSION);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setUseCompression(Boolean.parseBoolean(setting));
|
||||
factory.setUseCompression(Boolean.getBoolean(setting));
|
||||
}
|
||||
|
||||
setting = settings.getProperty(KEY_USE_RETROACTIVE);
|
||||
if (setting != null && setting.length() > 0) {
|
||||
factory.setUseRetroactiveConsumer(Boolean.parseBoolean(setting));
|
||||
factory.setUseRetroactiveConsumer(Boolean.getBoolean(setting));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue