[jboss-cvs] jboss-jms/src/main/org/jboss/jms/server ...
Timothy Fox
tim.fox at jboss.com
Mon Jul 17 13:14:45 EDT 2006
User: timfox
Date: 06/07/17 13:14:45
Modified: src/main/org/jboss/jms/server Bootstrap.java
ConnectionFactoryManager.java ServerPeer.java
Added: src/main/org/jboss/jms/server QueuedExecutorPool.java
Log:
Many changes including implementation of prefetch, SEDAisation of server, changing of recovery
Revision Changes Path
1.2 +2 -41 jboss-jms/src/main/org/jboss/jms/server/Bootstrap.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Bootstrap.java
===================================================================
RCS file: /cvsroot/jboss/jboss-jms/src/main/org/jboss/jms/server/Bootstrap.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- Bootstrap.java 2 May 2006 02:45:31 -0000 1.1
+++ Bootstrap.java 17 Jul 2006 17:14:45 -0000 1.2
@@ -21,59 +21,20 @@
*/
package org.jboss.jms.server;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.Attribute;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.aop.AspectXmlLoader;
-import org.jboss.jms.server.connectionfactory.ConnectionFactoryJNDIMapper;
-import org.jboss.jms.server.connectionmanager.SimpleConnectionManager;
-import org.jboss.jms.server.connectormanager.SimpleConnectorManager;
-import org.jboss.jms.server.endpoint.ServerConsumerEndpoint;
-import org.jboss.jms.server.plugin.contract.ChannelMapper;
-import org.jboss.jms.server.plugin.contract.ThreadPool;
-import org.jboss.jms.server.remoting.JMSServerInvocationHandler;
-import org.jboss.jms.server.remoting.JMSWireFormat;
-import org.jboss.jms.server.security.SecurityMetadataStore;
-import org.jboss.logging.Logger;
-import org.jboss.messaging.core.plugin.IdManager;
-import org.jboss.messaging.core.plugin.contract.MessageStore;
-import org.jboss.messaging.core.plugin.contract.PersistenceManager;
-import org.jboss.messaging.core.tx.TransactionRepository;
-import org.jboss.messaging.util.Util;
-import org.jboss.mx.loading.UnifiedClassLoader3;
-import org.jboss.remoting.ServerInvocationHandler;
-import org.jboss.remoting.marshal.MarshalFactory;
-import org.jboss.remoting.serialization.SerializationStreamFactory;
-import org.jboss.system.ServiceCreator;
import org.jboss.system.ServiceMBeanSupport;
-import org.w3c.dom.Element;
-
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
/**
* A bootstrap for a scoped deployment.
*
* @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 1.1 $</tt>
+ * @version <tt>$Revision: 1.2 $</tt>
*
- * $Id: Bootstrap.java,v 1.1 2006/05/02 02:45:31 ovidiu Exp $
+ * $Id: Bootstrap.java,v 1.2 2006/07/17 17:14:45 timfox Exp $
*/
public class Bootstrap extends ServiceMBeanSupport
{
// Constants -----------------------------------------------------
- private static final Logger log = Logger.getLogger(Bootstrap.class);
-
// Static --------------------------------------------------------
// Attributes ----------------------------------------------------
1.4 +5 -3 jboss-jms/src/main/org/jboss/jms/server/ConnectionFactoryManager.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ConnectionFactoryManager.java
===================================================================
RCS file: /cvsroot/jboss/jboss-jms/src/main/org/jboss/jms/server/ConnectionFactoryManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ConnectionFactoryManager.java 13 Apr 2006 19:43:05 -0000 1.3
+++ ConnectionFactoryManager.java 17 Jul 2006 17:14:45 -0000 1.4
@@ -25,9 +25,9 @@
/**
* @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 1.3 $</tt>
+ * @version <tt>$Revision: 1.4 $</tt>
*
- * $Id: ConnectionFactoryManager.java,v 1.3 2006/04/13 19:43:05 timfox Exp $
+ * $Id: ConnectionFactoryManager.java,v 1.4 2006/07/17 17:14:45 timfox Exp $
*/
public interface ConnectionFactoryManager
{
@@ -37,7 +37,9 @@
*
* @return an identifier that uniques identifies the registered ConnectionFactory.
*/
- int registerConnectionFactory(String clientID, JNDIBindings jndiBindings, String locatorURI, boolean clientPing) throws Exception;
+ int registerConnectionFactory(String clientID, JNDIBindings jndiBindings,
+ String locatorURI, boolean clientPing,
+ int prefetchSize) throws Exception;
void unregisterConnectionFactory(int connectionFactoryID) throws Exception;
1.108 +31 -25 jboss-jms/src/main/org/jboss/jms/server/ServerPeer.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServerPeer.java
===================================================================
RCS file: /cvsroot/jboss/jboss-jms/src/main/org/jboss/jms/server/ServerPeer.java,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -b -r1.107 -r1.108
--- ServerPeer.java 27 Jun 2006 19:44:38 -0000 1.107
+++ ServerPeer.java 17 Jul 2006 17:14:45 -0000 1.108
@@ -40,7 +40,6 @@
import org.jboss.jms.server.connectormanager.SimpleConnectorManager;
import org.jboss.jms.server.endpoint.ServerConsumerEndpoint;
import org.jboss.jms.server.plugin.contract.ChannelMapper;
-import org.jboss.jms.server.plugin.contract.ThreadPool;
import org.jboss.jms.server.remoting.JMSServerInvocationHandler;
import org.jboss.jms.server.remoting.JMSWireFormat;
import org.jboss.jms.server.security.SecurityMetadataStore;
@@ -67,9 +66,9 @@
*
* @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision: 1.107 $</tt>
+ * @version <tt>$Revision: 1.108 $</tt>
*
- * $Id: ServerPeer.java,v 1.107 2006/06/27 19:44:38 timfox Exp $
+ * $Id: ServerPeer.java,v 1.108 2006/07/17 17:14:45 timfox Exp $
*/
public class ServerPeer extends ServiceMBeanSupport
{
@@ -94,6 +93,8 @@
protected String defaultQueueJNDIContext;
protected String defaultTopicJNDIContext;
+ protected int queuedExecutorPoolSize = 50;
+
protected boolean started;
protected int objectIDSequence = Integer.MIN_VALUE + 1;
@@ -108,11 +109,10 @@
protected ConnectorManager connectorManager;
protected IdManager messageIdManager;
protected MemoryManager memoryManager;
+ protected QueuedExecutorPool queuedExecutorPool;
// plugins
- protected ObjectName threadPoolObjectName;
- protected ThreadPool threadPoolDelegate;
protected ObjectName persistenceManagerObjectName;
protected PersistenceManager persistenceManagerDelegate;
protected ObjectName messageStoreObjectName;
@@ -177,9 +177,6 @@
// circumventing the MBeanServer. However, they are installed as services to take advantage
// of their automatically-creating management interface.
- threadPoolDelegate =
- (ThreadPool)mbeanServer.getAttribute(threadPoolObjectName, "Instance");
-
persistenceManagerDelegate =
(PersistenceManager)mbeanServer.getAttribute(persistenceManagerObjectName, "Instance");
@@ -190,11 +187,20 @@
channelMapper = (ChannelMapper)mbeanServer.
getAttribute(channelMapperObjectName, "Instance");
+ if (queuedExecutorPoolSize < 1)
+ {
+ throw new IllegalArgumentException("queuedExecutorPoolSize must be > 0");
+ }
+ queuedExecutorPool = new QueuedExecutorPool(queuedExecutorPoolSize);
+
+
// TODO: Shouldn't this go into ChannelMapper's dependencies? Since it's a plug in,
// we shouldn't inject their dependencies externally, but they should take care
/// of them themselves.
channelMapper.setPersistenceManager(persistenceManagerDelegate);
+ channelMapper.setQueuedExecutorPool(queuedExecutorPool);
+
// start the rest of the internal components
memoryManager.start();
@@ -250,16 +256,6 @@
// JMX Attributes ------------------------------------------------
- public ObjectName getThreadPool()
- {
- return threadPoolObjectName;
- }
-
- public void setThreadPool(ObjectName on)
- {
- threadPoolObjectName = on;
- }
-
public ObjectName getPersistenceManager()
{
return persistenceManagerObjectName;
@@ -375,6 +371,16 @@
return handler;
}
+ public int getQueuedExecutorPoolSize()
+ {
+ return queuedExecutorPoolSize;
+ }
+
+ public void setQueuedExecutorPoolSize(int poolSize)
+ {
+ this.queuedExecutorPoolSize = poolSize;
+ }
+
// JMX Operations ------------------------------------------------
public String createQueue(String name, String jndiName) throws Exception
@@ -473,11 +479,6 @@
// access to plugin references
- public ThreadPool getThreadPoolDelegate()
- {
- return threadPoolDelegate;
- }
-
public PersistenceManager getPersistenceManagerDelegate()
{
return persistenceManagerDelegate;
@@ -515,6 +516,11 @@
return (ServerConsumerEndpoint)consumers.remove(consumerID);
}
+ public QueuedExecutorPool getQueuedExecutorPool()
+ {
+ return queuedExecutorPool;
+ }
+
public String toString()
{
return "ServerPeer [" + getServerPeerID() + "]";
1.1 date: 2006/07/17 17:14:45; author: timfox; state: Exp;jboss-jms/src/main/org/jboss/jms/server/QueuedExecutorPool.java
Index: QueuedExecutorPool.java
===================================================================
/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.jms.server;
import org.jboss.messaging.util.RotatingPool;
import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
/**
* A QueuedExecutorPool
* @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
* @version <tt>$Revision: 1.1 $</tt>
*
* $Id: QueuedExecutorPool.java,v 1.1 2006/07/17 17:14:45 timfox Exp $
*
*/
public class QueuedExecutorPool extends RotatingPool
{
public QueuedExecutorPool(int maxSize)
{
super(maxSize);
}
protected Object createEntry()
{
return new QueuedExecutor();
}
}
More information about the jboss-cvs-commits
mailing list