Modified the version numbers for jar files with dependency error

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@399195 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Darwin G. Flores 2006-05-03 08:04:31 +00:00
parent 5fd6125b23
commit 174a581a4f
5 changed files with 115 additions and 17 deletions

View File

@ -55,7 +55,7 @@ ApacheJMeter_components_version=1.0
ApacheJMeter_version=1.0
avalon_framework_version=4.1.4
batik_awt_util_version=1.0
batik_awt_util_version=1.6
commons_collections_version=2.1
commons_httpclient_version=2.0
commons_logging_version=1.0.3
@ -75,9 +75,9 @@ logkit_version=1.2
soap_version=2.3.1
Tidy_version=1.0
velocity_version=1.4-dev
xalan_version=1.0
xalan_version=2.7.0
xercesImpl_version=2.0.0
xml_apis_version=1.0
xml_apis_version=2.0.2
xpp3_min_version=1.1.3.4.I
xstream_version=1.1
manta_version=1.0

View File

@ -482,7 +482,7 @@
<lib>true</lib>
</properties>
</dependency>
<!--
<dependency>
<groupId>manta</groupId>
<artifactId>manta</artifactId>
@ -492,7 +492,7 @@
<lib>true</lib>
</properties>
</dependency>
-->
</dependencies>
<build>

View File

@ -32,6 +32,8 @@ tibcomq_server=TibcoMQ Server
jbossmq_server=JBossMQ Server
openjms_server=OpenJMS Server
joram_server=Joram Server
swiftmq_server=SwiftMQ Server
websphere_server=WebsphereMQ Server
mantaray_server=Mantaray
form_msg_interval=Message Interval
form_default_msg_interval=Default

View File

@ -24,7 +24,7 @@ import org.apache.jmeter.util.JMeterUtils;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;
import org.mr.MantaAgent;
//import org.mr.MantaAgent;
import javax.jms.Connection;
import javax.jms.Session;
@ -45,6 +45,7 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import java.lang.reflect.Method;
public class Consumer extends Sampler implements MessageListener {
@ -185,10 +186,11 @@ public class Consumer extends Sampler implements MessageListener {
} else if (ServerConnectionFactory.MANTARAY_SERVER.equals(this.getMQServer())) {
if (this.getTopic()) {
Topic topic = (Topic) destination;
Class s = mantaAgent();
System.out.println("CLASS = " + s);
if (this.getDurable()) {
consumer = ((TopicSession) session).createDurableSubscriber(topic,
MantaAgent.getInstance().getAgentName());
// consumer = ((TopicSession) session).createDurableSubscriber(topic,
// s.getInstance().getAgentName());
} else {
consumer = ((TopicSession) session).createSubscriber(topic);
}
@ -225,6 +227,34 @@ public class Consumer extends Sampler implements MessageListener {
addResource(consumer);
}
public static Class mantaAgent() {
String name = "org.mr.api.MantaAgent";
Class type = loadClass(name, ServerConnectionFactory.class.getClassLoader());
System.out.println("cons TYPE = " + type);
if (type != null) {
return (Class) type;
} else {
System.out.println("Class not found: " + name);
}
return null;
}
private static Class loadClass(String name, ClassLoader loader) {
try {
return loader.loadClass(name);
}
catch (ClassNotFoundException e) {
try {
return Thread.currentThread().getContextClassLoader().loadClass(name);
}
catch (ClassNotFoundException e1) {
return null;
}
}
}
/**
* Processes the received message.
*

View File

@ -18,6 +18,7 @@ package org.activemq.util.connection;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;
import javax.jms.Connection;
@ -41,8 +42,8 @@ import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jmeter.testelement.TestElement;
import org.mr.api.jms.MantaQueueConnectionFactory;
import org.mr.api.jms.MantaTopicConnectionFactory;
//import org.mr.api.jms.MantaQueueConnectionFactory;
//import org.mr.api.jms.MantaTopicConnectionFactory;
/**
* Provides static methods for creating Session and Destination objects.
@ -60,6 +61,7 @@ public class ServerConnectionFactory {
public static final String JORAM_NAMING_PORT = JMeterUtils.getResString("joram_naming_port");
public static final String MANTARAY_SERVER = JMeterUtils.getResString("mantaray_server");
public static final String SWIFTMQ_SERVER = JMeterUtils.getResString("swiftmq_server");
public static final String WEBSPHEREMQ_SERVER = JMeterUtils.getResString("webspheremq_server");
// For testing within IntelliJ running main()
/*
@ -93,6 +95,11 @@ public class ServerConnectionFactory {
public static final String SMQP = "com.swiftmq.jms.smqp";
public static final String NAMING_HOST = "java.naming.factory.host";
public static final String NAMING_PORT = "java.naming.factory.post";
//public static final String WEBSPHEREMQ_CONTEXT = "com.sun.jndi.ldap.LdapCtxFactory";
//public static final String WEBSPHEREMQ_CONTEXT = "com.sun.jndi.fscontext.RefFSContextFactory";
//public static final String WEBSPHEREMQ_CONTEXT = "com.ibm.ejs.ns.jndi.CNInitialContextFactory";
public static final String WEBSPHEREMQ_CONTEXT = "com.ibm.websphere.naming.WsnInitialContextFactory";
public static final String WEBSPHEREMQ_CONNECTION_FACTORY = "com.ibm.mq.jms.MQConnectionFactory";
public static Topic topicContext;
@ -129,7 +136,7 @@ public class ServerConnectionFactory {
String mqServer,
boolean isTopic,
boolean isAsync) throws JMSException {
System.out.println("PARAM = " + url + "/" + mqServer + "/" + isTopic + "/" + isAsync);
if (SONICMQ_SERVER.equals(mqServer)) {
//Creates a Connection object for a SONIC MQ server.
if (isTopic) {
@ -192,14 +199,14 @@ public class ServerConnectionFactory {
} else if (MANTARAY_SERVER.equals(mqServer)) {
//Creates a Connection object for a Mantaray.
System.setProperty("mantaHome",url);
ConnectionFactory cf = findMantaCF(isTopic);
if (isTopic) {
TopicConnectionFactory factory = (TopicConnectionFactory) new MantaTopicConnectionFactory();
TopicConnectionFactory factory = (TopicConnectionFactory) cf;
return factory.createTopicConnection();
} else {
QueueConnectionFactory factory = (QueueConnectionFactory) new MantaQueueConnectionFactory();
QueueConnectionFactory factory = (QueueConnectionFactory) cf;
return factory.createQueueConnection();
@ -210,13 +217,11 @@ public class ServerConnectionFactory {
Context ictx = getInitialContext(url, SWIFTMQ_SERVER);
if (isTopic){
TopicConnectionFactory tcf = (TopicConnectionFactory) ictx.lookup("TopicConnectionFactory");
// Topic topic = (Topic) ictx.lookup("testtopic");
ictx.close();
TopicConnection connection = tcf.createTopicConnection();
return connection;
} else {
QueueConnectionFactory qcf = (QueueConnectionFactory) ictx.lookup("QueueConnectionFactory");
// Queue queue = (Queue) ictx.lookup("testqueue");
ictx.close();
QueueConnection connection = qcf.createQueueConnection();
return connection;
@ -224,6 +229,29 @@ public class ServerConnectionFactory {
} catch (NamingException e) {
throw new JMSException("Error creating InitialContext ", e.toString());
}
}else if (WEBSPHEREMQ_SERVER.equals(mqServer)) {
//Creates a Connection object for a SwiftMQ server.
System.out.println("SERVER IS WEBSPHERE");
try {
Context ictx = getInitialContext(url, WEBSPHEREMQ_SERVER);
System.out.println("CONTEXT = " + ictx);
/* if (isTopic){
TopicConnectionFactory tcf = (TopicConnectionFactory) ictx.lookup("MQConnectionFactory");
ictx.close();
TopicConnection connection = tcf.createTopicConnection();
System.out.println("CONN = " + connection);
return connection;
} else {
QueueConnectionFactory qcf = (QueueConnectionFactory) ictx.lookup("MQConnectionFactory");
ictx.close();
QueueConnection connection = qcf.createQueueConnection();
return connection;
} */
return null;//temp return val only
} catch (Exception e) { //orig is NamingException
e.printStackTrace();
throw new JMSException("Error creating InitialContext ", e.toString());
}
} else {
//Used to create a session from the default MQ server ActiveMQConnectionFactory.
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
@ -445,11 +473,17 @@ public class ServerConnectionFactory {
properties.put(Context.INITIAL_CONTEXT_FACTORY, SONICMQ_CONTEXT);
properties.put(Context.PROVIDER_URL, url);
} else if (WEBSPHEREMQ_SERVER.equals(mqServer)) {
//Creates a Context object for WEBSPHEREMQ server
properties.put(Context.INITIAL_CONTEXT_FACTORY, WEBSPHEREMQ_CONTEXT);
properties.put(Context.PROVIDER_URL, url);
System.out.println("PROPS = " + properties);
}
try {
return new InitialContext(properties);
} catch (NamingException e) {
e.printStackTrace();
throw new JMSException("Error creating InitialContext ", e.toString());
}
}
@ -464,4 +498,36 @@ public class ServerConnectionFactory {
return url.substring(url.lastIndexOf("/") + 1, url.lastIndexOf(":"));
}
public static ConnectionFactory findMantaCF(boolean isTopic) {
String name = null;
if (isTopic) {
name = "org.mr.api.jms.MantaTopicConnectionFactory";
} else {
name = "org.mr.api.jms.MantaQueueConnectionFactory";
}
Class type = loadClass(name, ServerConnectionFactory.class.getClassLoader());
System.out.println("SCF type = " + type);
if (type != null) {
Object obj = type;
return (ConnectionFactory) obj;
} else {
System.out.println("Connection Factory not found: " + name);
}
return null;
}
private static Class loadClass(String name, ClassLoader loader) {
try {
return loader.loadClass(name);
}
catch (ClassNotFoundException e) {
try {
return Thread.currentThread().getContextClassLoader().loadClass(name);
}
catch (ClassNotFoundException e1) {
return null;
}
}
}
}