User: chirino Date: 01/06/21 22:24:31 Modified: src/main/org/jboss/jms/jndi AbstractJMSProviderAdapter.java JBossMQProvider.java JMSProviderAdapter.java JMSProviderLoader.java JMSProviderLoaderMBean.java Removed: src/main/org/jboss/jms/jndi JBossLocalTXProvider.java Log: Updated JBoss with the latest JBossMQ which includes fixes for the recent threading issues. I have alos updated the JMProviderLoader so that the references to the connection factory locations can be set via JMX. The jboss.jcml file was updated so that MDBs uese the INVM IL for better performance. Revision Changes Path 1.4 +83 -61 jboss/src/main/org/jboss/jms/jndi/AbstractJMSProviderAdapter.java Index: AbstractJMSProviderAdapter.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/jndi/AbstractJMSProviderAdapter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AbstractJMSProviderAdapter.java 2001/06/18 20:01:25 1.3 +++ AbstractJMSProviderAdapter.java 2001/06/22 05:24:31 1.4 @@ -25,91 +25,113 @@ * provide connection names via instance initialzation and provide an * implementaion of {@link #getInitialContext}. * - * @version <pre>$Revision: 1.3 $</pre> + * 6/22/01 - hchirino - The queue/topic jndi references are now configed via JMX + * + * @version <pre>$Revision: 1.4 $</pre> * @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a> + * @author <a href="mailto:[EMAIL PROTECTED]">Hiram Chirino</a> */ -public abstract class AbstractJMSProviderAdapter +public class AbstractJMSProviderAdapter implements JMSProviderAdapter, java.io.Serializable { - /** The queue factory name to use. */ - protected String queueFactoryName; - /** The topic factory name to use. */ - protected String topicFactoryName; + + /** The name of the provider. */ protected String name; /** The provider url. */ protected String providerURL; - /** - * Initialize. - * - * @param queueFactoryName The name of the queue factory to use. - * @param topicFactoryName The name of the topic factory to use. - */ - protected AbstractJMSProviderAdapter(final String queueFactoryName, - final String topicFactoryName) - { - this.queueFactoryName = queueFactoryName; - System.out.println("queue factory name: " + this.queueFactoryName); - this.topicFactoryName = topicFactoryName; - System.out.println("topic factory name: " + this.topicFactoryName); - } + /** - * Set the name of the provider. - * - * @param name The provider name. - */ + * Set the name of the provider. + * + * @param name The provider name. + */ public void setName(final String name) { - this.name = name; - } + this.name = name; + } /** - * Get the name of the provider. - * - * @return The provider name. - */ + * Get the name of the provider. + * + * @return The provider name. + */ public final String getName() { - return name; - } + return name; + } /** - * Set the URL that will be used to connect to the JNDI provider. - * - * @param url The URL that will be used to connect. - */ + * Set the URL that will be used to connect to the JNDI provider. + * + * @param url The URL that will be used to connect. + */ public void setProviderUrl(final String url) { - this.providerURL = url; - } + this.providerURL = url; + } /** - * Get the URL that is currently being used to connect to the JNDI - * provider. - * - * @return The URL that is currently being used. - */ + * Get the URL that is currently being used to connect to the JNDI + * provider. + * + * @return The URL that is currently being used. + */ public final String getProviderUrl() { - return providerURL; - } + return providerURL; + } - /** - * Get the JNDI name of the queue factory connection to use. - * - * @return JNDI name of the queue factory connection to use. - */ - public final String getQueueFactoryName() { - return queueFactoryName; - } - /** - * Get the JNDI name of the topic factory connection to use. - * - * @return JNDI name of the topic factory connection to use. - */ - public final String getTopicFactoryName() { - return topicFactoryName; - } + + + + /** The queue factory name to use. */ + protected String queueFactoryRef; + /** The topic factory name to use. */ + protected String topicFactoryRef; + + /** + * getInitialContext method comment. + */ + public javax.naming.Context getInitialContext() throws javax.naming.NamingException { + return new javax.naming.InitialContext(); // Connect to the JBoss JNDI + } + +/** + * Insert the method's description here. + * Creation date: (6/22/2001 12:41:44 AM) + * @return java.lang.String + */ +public java.lang.String getQueueFactoryRef() { + return queueFactoryRef; +} + +/** + * Insert the method's description here. + * Creation date: (6/22/2001 12:41:44 AM) + * @return java.lang.String + */ +public java.lang.String getTopicFactoryRef() { + return topicFactoryRef; +} + +/** + * Insert the method's description here. + * Creation date: (6/22/2001 12:41:44 AM) + * @param newQueueFactoryRef java.lang.String + */ +public void setQueueFactoryRef(java.lang.String newQueueFactoryRef) { + queueFactoryRef = newQueueFactoryRef; +} + +/** + * Insert the method's description here. + * Creation date: (6/22/2001 12:41:44 AM) + * @param newTopicFactoryRef java.lang.String + */ +public void setTopicFactoryRef(java.lang.String newTopicFactoryRef) { + topicFactoryRef = newTopicFactoryRef; } +} \ No newline at end of file 1.4 +30 -29 jboss/src/main/org/jboss/jms/jndi/JBossMQProvider.java Index: JBossMQProvider.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/jndi/JBossMQProvider.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JBossMQProvider.java 2001/04/17 21:27:14 1.3 +++ JBossMQProvider.java 2001/06/22 05:24:31 1.4 @@ -27,40 +27,41 @@ * A JMS provider adapter for <em>JBossMQ</em>. * * Created: Fri Dec 22 09:34:04 2000 + * 6/22/01 - hchirino - The queue/topic jndi references are now configed via JMX * * @author Peter Antman + * @author <a href="mailto:[EMAIL PROTECTED]">Hiram Chirino</a> * @version */ public class JBossMQProvider extends AbstractJMSProviderAdapter { - public static final String TOPIC_CONNECTION_FACTORY = "XATopicConnectionFactory"; - public static final String QUEUE_CONNECTION_FACTORY = "XAQueueConnectionFactory"; - public static final String INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory"; - public static final String URL_PKG_PREFIXES = "org.jboss.naming"; - private static final String SECURITY_MANAGER = "java.naming.rmi.security.manager"; - - private String hasJndiSecurityManager = "yes"; - - public JBossMQProvider() { - super(QUEUE_CONNECTION_FACTORY, TOPIC_CONNECTION_FACTORY); - } - - public Context getInitialContext() throws NamingException { - Context ctx = null; - if (providerURL == null) { - // Use default - ctx = new InitialContext(); // Only for JBoss embedded now - } else { - // Try another location - Hashtable props = new Hashtable(); - props.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY); - props.put(Context.PROVIDER_URL, providerURL); - props.put(SECURITY_MANAGER, hasJndiSecurityManager); - props.put(Context.URL_PKG_PREFIXES, URL_PKG_PREFIXES); - ctx = new InitialContext(props); - } - return ctx; - } -} // JBossMQProvider + + public static final String INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory"; + public static final String URL_PKG_PREFIXES = "org.jboss.naming"; + private static final String SECURITY_MANAGER = "java.naming.rmi.security.manager"; + + private String hasJndiSecurityManager = "yes"; + + public JBossMQProvider() { + } + + public Context getInitialContext() throws NamingException { + Context ctx = null; + if (providerURL == null) { + // Use default + ctx = new InitialContext(); // Only for JBoss embedded now + } else { + // Try another location + Hashtable props = new Hashtable(); + props.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY); + props.put(Context.PROVIDER_URL, providerURL); + props.put(SECURITY_MANAGER, hasJndiSecurityManager); + props.put(Context.URL_PKG_PREFIXES, URL_PKG_PREFIXES); + ctx = new InitialContext(props); + } + return ctx; + } + +} \ No newline at end of file 1.2 +15 -9 jboss/src/main/org/jboss/jms/jndi/JMSProviderAdapter.java Index: JMSProviderAdapter.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/jndi/JMSProviderAdapter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JMSProviderAdapter.java 2000/12/06 12:52:36 1.1 +++ JMSProviderAdapter.java 2001/06/22 05:24:31 1.2 @@ -19,22 +19,28 @@ import javax.naming.Context; import javax.naming.NamingException; + /** * JMSProviderAdapter.java * * * Created: Wed Nov 29 14:15:07 2000 + * 6/22/01 - hchirino - The queue/topic jndi references are now configed via JMX * * @author + * @author <a href="mailto:[EMAIL PROTECTED]">Hiram Chirino</a> * @version */ + +public interface JMSProviderAdapter { + public Context getInitialContext() throws NamingException; -public interface JMSProviderAdapter { - public Context getInitialContext() throws NamingException; - public String getTopicFactoryName(); - public String getQueueFactoryName(); - public void setName(String name); - public String getName(); - public void setProviderUrl(String url); - public String getProviderUrl(); -} // JMSProviderAdapter + public void setName(String name); + public String getName(); + public void setProviderUrl(String url); + public String getProviderUrl(); + public java.lang.String getQueueFactoryRef(); + public java.lang.String getTopicFactoryRef(); + public void setQueueFactoryRef(java.lang.String newQueueFactoryRef); + public void setTopicFactoryRef(java.lang.String newTopicFactoryRef); +} \ No newline at end of file 1.3 +95 -61 jboss/src/main/org/jboss/jms/jndi/JMSProviderLoader.java Index: JMSProviderLoader.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/jndi/JMSProviderLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JMSProviderLoader.java 2000/12/07 16:19:29 1.2 +++ JMSProviderLoader.java 2001/06/22 05:24:31 1.3 @@ -28,14 +28,17 @@ import org.jboss.util.ServiceMBeanSupport; import org.jboss.logging.Logger; + /** * JMSProviderLoader.java * * This is realy NOT a factory for pool's but simply a way of getting * an object instantiated and bound in jndi * Created: Wed Nov 29 14:07:07 2000 + * 6/22/01 - hchirino - The queue/topic jndi references are now configed via JMX * * @author + * @author <a href="mailto:[EMAIL PROTECTED]">Hiram Chirino</a> * @version */ @@ -48,107 +51,138 @@ String url; String providerName; String providerAdapterClass; + String queueFactoryRef; + String topicFactoryRef; public void setProviderName(String name) { - this.providerName = name; - } + this.providerName = name; + } public String getProviderName() { - return providerName; - } + return providerName; + } public void setProviderAdapterClass(String clazz) { - providerAdapterClass = clazz; - } + providerAdapterClass = clazz; + } public String getProviderAdapterClass() { - return providerAdapterClass; - } + return providerAdapterClass; + } public void setProviderUrl(String url) { - this.url = url; - } + this.url = url; + } public String getProviderUrl() { - return url; - } + return url; + } public ObjectName getObjectName(MBeanServer parm1, ObjectName parm2) - throws javax.management.MalformedObjectNameException + throws javax.management.MalformedObjectNameException { - return (parm2 == null) ? new ObjectName(OBJECT_NAME) : parm2; - } + return (parm2 == null) ? new ObjectName(OBJECT_NAME) : parm2; + } public String getName() { - return providerName; - } + return providerName; + } public void initService() - throws Exception + throws Exception { - Class cls = Class.forName(providerAdapterClass); - providerAdapter = (JMSProviderAdapter)cls.newInstance(); - providerAdapter.setName(providerName); - providerAdapter.setProviderUrl(url); - } + Class cls = Class.forName(providerAdapterClass); + providerAdapter = (JMSProviderAdapter)cls.newInstance(); + providerAdapter.setName(providerName); + providerAdapter.setProviderUrl(url); + providerAdapter.setQueueFactoryRef(queueFactoryRef); + providerAdapter.setTopicFactoryRef(topicFactoryRef); + } public void startService() - throws Exception + throws Exception { - // Bind in JNDI - bind(new InitialContext(), "java:/"+providerAdapter.getName(), providerAdapter); + // Bind in JNDI + bind(new InitialContext(), "java:/"+providerAdapter.getName(), providerAdapter); - log.log("JMS provider Adapter "+providerAdapter.getName()+" bound to java:/"+providerAdapter.getName()); - } + log.log("JMS provider Adapter "+providerAdapter.getName()+" bound to java:/"+providerAdapter.getName()); + } public void stopService() { - // Unbind from JNDI - try { - String name = providerAdapter.getName(); - new InitialContext().unbind("java:/"+name); - log.log("JMA Provider Adapter "+name+" removed from JNDI"); - //source.close(); - //log.log("XA Connection pool "+name+" shut down"); - } catch (NamingException e) - { - // Ignore - } - } + // Unbind from JNDI + try { + String name = providerAdapter.getName(); + new InitialContext().unbind("java:/"+name); + log.log("JMA Provider Adapter "+name+" removed from JNDI"); + //source.close(); + //log.log("XA Connection pool "+name+" shut down"); + } catch (NamingException e) + { + // Ignore + } + } // Private ------------------------------------------------------- private void bind(Context ctx, String name, Object val) throws NamingException { - // Bind val to name in ctx, and make sure that all intermediate contexts exist - Name n = ctx.getNameParser("").parse(name); - while (n.size() > 1) - { - String ctxName = n.get(0); - try - { - ctx = (Context)ctx.lookup(ctxName); - } catch (NameNotFoundException e) - { - ctx = ctx.createSubcontext(ctxName); - } - n = n.getSuffix(1); - } - - ctx.bind(n.get(0), val); - } - + // Bind val to name in ctx, and make sure that all intermediate contexts exist + Name n = ctx.getNameParser("").parse(name); + while (n.size() > 1) + { + String ctxName = n.get(0); + try + { + ctx = (Context)ctx.lookup(ctxName); + } catch (NameNotFoundException e) + { + ctx = ctx.createSubcontext(ctxName); + } + n = n.getSuffix(1); + } + ctx.bind(n.get(0), val); + } +/** + * Insert the method's description here. + * Creation date: (6/22/2001 12:38:31 AM) + * @param newQueueFactoryRef java.lang.String + */ +public void setQueueFactoryRef(java.lang.String newQueueFactoryRef) { + queueFactoryRef = newQueueFactoryRef; } - - - +/** + * Insert the method's description here. + * Creation date: (6/22/2001 12:38:31 AM) + * @param newTopicFactoryRef java.lang.String + */ +public void setTopicFactoryRef(java.lang.String newTopicFactoryRef) { + topicFactoryRef = newTopicFactoryRef; +} +/** + * Insert the method's description here. + * Creation date: (6/22/2001 12:38:31 AM) + * @return java.lang.String + */ +public java.lang.String getQueueFactoryRef() { + return queueFactoryRef; +} +/** + * Insert the method's description here. + * Creation date: (6/22/2001 12:38:31 AM) + * @return java.lang.String + */ +public java.lang.String getTopicFactoryRef() { + return topicFactoryRef; +} +} \ No newline at end of file 1.4 +24 -14 jboss/src/main/org/jboss/jms/jndi/JMSProviderLoaderMBean.java Index: JMSProviderLoaderMBean.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/jndi/JMSProviderLoaderMBean.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JMSProviderLoaderMBean.java 2001/02/28 09:25:46 1.3 +++ JMSProviderLoaderMBean.java 2001/06/22 05:24:31 1.4 @@ -18,31 +18,41 @@ package org.jboss.jms.jndi; import org.jboss.util.ServiceMBean; + /** * JMSProviderLoaderMBean.java * * * Created: Wed Nov 29 14:08:39 2000 + * 6/22/01 - hchirino - The queue/topic jndi references are now configed via JMX * * @author + * @author <a href="mailto:[EMAIL PROTECTED]">Hiram Chirino</a> * @version */ public interface JMSProviderLoaderMBean extends ServiceMBean { - public static final String OBJECT_NAME = ":service=JMSProviderLoader"; + public static final String OBJECT_NAME = ":service=JMSProviderLoader"; + + public void setProviderName(String name); + + public String getProviderName(); + + public void setProviderAdapterClass(String clazz); + + public String getProviderAdapterClass(); + + public void setProviderUrl(String url); + + public String getProviderUrl(); + + public java.lang.String getQueueFactoryRef(); + + public java.lang.String getTopicFactoryRef(); + + public void setQueueFactoryRef(java.lang.String newQueueFactoryRef); - public void setProviderName(String name); - - public String getProviderName(); - - public void setProviderAdapterClass(String clazz); - - public String getProviderAdapterClass(); - - public void setProviderUrl(String url); - - public String getProviderUrl(); - -} + public void setTopicFactoryRef(java.lang.String newTopicFactoryRef); +} \ No newline at end of file _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development