[jboss-cvs] JBoss Messaging SVN: r3430 - in branches/Branch_JBMESSAGING-544: src/main/org/jboss/jms/server/remoting and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Dec 6 11:36:17 EST 2007


Author: jmesnil
Date: 2007-12-06 11:36:16 -0500 (Thu, 06 Dec 2007)
New Revision: 3430

Removed:
   branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java
   branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/wireformat/JMSWireFormat.java
Modified:
   branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java
   branches/Branch_JBMESSAGING-544/tests/src/org/jboss/test/messaging/tools/container/ServiceContainer.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-544 Replace client-server transport with NIO based transport
* removed unused classes specific to JBoss Remoting

Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java	2007-12-06 15:41:49 UTC (rev 3429)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java	2007-12-06 16:36:16 UTC (rev 3430)
@@ -53,7 +53,6 @@
 import org.jboss.jms.server.messagecounter.MessageCounterManager;
 import org.jboss.jms.server.plugin.contract.JMSUserManager;
 import org.jboss.jms.server.security.SecurityMetadataStore;
-import org.jboss.jms.wireformat.JMSWireFormat;
 import org.jboss.logging.Logger;
 import org.jboss.messaging.core.contract.Binding;
 import org.jboss.messaging.core.contract.ClusterNotifier;
@@ -77,7 +76,6 @@
 import org.jboss.messaging.util.Util;
 import org.jboss.messaging.util.Version;
 import org.jboss.mx.loading.UnifiedClassLoader3;
-import org.jboss.remoting.marshal.MarshalFactory;
 import org.jboss.system.ServiceCreator;
 import org.jboss.system.ServiceMBeanSupport;
 import org.jboss.util.JBossStringBuilder;
@@ -298,10 +296,7 @@
          // eventually cause the server to run out of RAM
          
          txRepository.loadPreparedTransactions();
-         
-         JMSWireFormat wf = new JMSWireFormat();         
-         MarshalFactory.addMarshaller("jms", wf, wf);      
-         
+                  
          started = true;
          
          log.info("JBoss Messaging " + getVersion().getProviderVersion() + " server [" +

Deleted: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java	2007-12-06 15:41:49 UTC (rev 3429)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java	2007-12-06 16:36:16 UTC (rev 3430)
@@ -1,194 +0,0 @@
-/*
-  * 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.remoting;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.management.MBeanServer;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.ServerInvocationHandler;
-import org.jboss.remoting.ServerInvoker;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
-import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
-
-import EDU.oswego.cs.dl.util.concurrent.ReadWriteLock;
-import EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class JMSServerInvocationHandler implements ServerInvocationHandler
-{
-   // Constants ------------------------------------------------------------------------------------
-
-   private static final Logger log = Logger.getLogger(JMSServerInvocationHandler.class);
-   
-   // Static ---------------------------------------------------------------------------------------
-   
-   private static boolean closed = true;
-   
-   private static ReadWriteLock invokeLock;
-   
-   public static void setClosed(boolean b)
-   {
-   	try
-   	{
-	   	invokeLock.writeLock().acquire();
-	   	
-	   	try
-	   	{
-	   		closed = b;
-	   	}
-	   	finally
-	   	{
-	   		invokeLock.writeLock().release();
-	   	}
-   	}
-   	catch (InterruptedException e)
-   	{
-   		log.error("Failed to set closed to " + closed, e);
-   	}
-   }
-   
-   // Attributes -----------------------------------------------------------------------------------
-
-   private ServerInvoker invoker;
-   
-   private MBeanServer server;
-
-   protected Map callbackHandlers;
-   
-   private boolean trace;
-             
-   // Constructors ---------------------------------------------------------------------------------
-
-   public JMSServerInvocationHandler()
-   {
-      callbackHandlers = new HashMap();
-      trace = log.isTraceEnabled();
-      
-      invokeLock = new WriterPreferenceReadWriteLock();      
-   }   
-     
-   // ServerInvocationHandler ----------------------------------------------------------------------
-
-   public void setMBeanServer(MBeanServer server)
-   {
-      this.server = server;
-      log.debug("set MBeanServer to " + this.server);
-   }
-
-   public ServerInvoker getInvoker()
-   {
-      return invoker;
-   }
-
-   public void setInvoker(ServerInvoker invoker)
-   {
-      this.invoker = invoker;
-      log.debug("set ServerInvoker to " + this.invoker);
-   }
-
-   public Object invoke(InvocationRequest invocation) throws Throwable
-   {      
-      throw new IllegalStateException("JBoss Remoting must no longer be used");
-   }
-
-   public void addListener(InvokerCallbackHandler callbackHandler)
-   {                 
-      log.debug("adding callback handler " + callbackHandler);
-      
-      if (callbackHandler instanceof ServerInvokerCallbackHandler)
-      {
-         ServerInvokerCallbackHandler h = (ServerInvokerCallbackHandler)callbackHandler;
-         String sessionId = h.getClientSessionId();
-         
-         synchronized(callbackHandlers)
-         {
-            if (callbackHandlers.containsKey(sessionId))
-            {
-               String msg = "The remoting client " + sessionId + " already has a callback handler";
-               log.error(msg);
-               throw new IllegalStateException(msg);
-            }
-            callbackHandlers.put(sessionId, h);
-         }
-      }
-      else
-      {
-         throw new RuntimeException("Do not know how to use callback handler " + callbackHandler);
-      }
-   }
-
-   public void removeListener(InvokerCallbackHandler callbackHandler)
-   {
-      log.debug("removing callback handler " + callbackHandler);
-      
-      synchronized(callbackHandlers)
-      {
-         for(Iterator i = callbackHandlers.keySet().iterator(); i.hasNext();)
-         {
-            Object key = i.next();
-            if (callbackHandler.equals(callbackHandlers.get(key)))
-            {
-               callbackHandlers.remove(key);
-               return;
-            }
-         }
-      }
-   }
-
-   /**
-    * @return a Collection of InvokerCallbackHandler
-    */
-   public Collection getListeners()
-   {
-      synchronized(callbackHandlers)
-      {
-         return callbackHandlers.values();
-      }
-   }
-
-   // Public ---------------------------------------------------------------------------------------
-
-   public String toString()
-   {
-      return "JMSServerInvocationHandler[" + invoker + ", " + server + "]";
-   }
-   
-   // Package protected ----------------------------------------------------------------------------
-   
-   // Protected ------------------------------------------------------------------------------------
-   
-   // Private --------------------------------------------------------------------------------------
-
-   // Inner classes --------------------------------------------------------------------------------
-}

Deleted: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/wireformat/JMSWireFormat.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/wireformat/JMSWireFormat.java	2007-12-06 15:41:49 UTC (rev 3429)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/wireformat/JMSWireFormat.java	2007-12-06 16:36:16 UTC (rev 3430)
@@ -1,106 +0,0 @@
-/*
-  * 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.wireformat;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
-
-/**
- * We do not use Java or JBoss serialization to send data over the wire. Serialization adds
- * considerable overhead in terms of the amount of data sent (it adds class information plus block
- * data information) which significantly degrades performance.
- * 
- * Instead we define a customer wire format that minimises the amount of data sent.
- * 
- * The only exception to this rule is when sending an ObjectMessage which contains a user defined
- * object whose type is only known at run-time. In this case we use serialization.
- * 
- * @author <a href="tim.fox at jboss.com">Tim Fox</a>
- * @author <a href="ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 3265 $</tt>
- *
- * $Id: JMSWireFormat.java 3265 2007-10-31 12:44:42Z timfox $
- */
-public class JMSWireFormat implements Marshaller, UnMarshaller
-{
-   // Constants ------------------------------------------------------------------------------------
-
-   private static final long serialVersionUID = -7646123424863782043L;
-
-   private static final Logger log = Logger.getLogger(JMSWireFormat.class);
-   
-   // Static ---------------------------------------------------------------------------------------
-
-   // Attributes -----------------------------------------------------------------------------------
-
-   protected boolean trace;
-
-   // Constructors ---------------------------------------------------------------------------------
-
-   public JMSWireFormat()
-   {
-   }
-
-   // Marshaller implementation --------------------------------------------------------------------
-
-   public void write(Object obj, OutputStream out) throws IOException
-   {          
-      throw new IllegalStateException("JBoss Remoting wireformat must not be used");
-   }
-   
-   public Marshaller cloneMarshaller() throws CloneNotSupportedException
-   {
-      return null;
-   }
-
-   // UnMarshaller implementation ------------------------------------------------------------------
-
-   public Object read(InputStream in, Map map) throws IOException, ClassNotFoundException
-   {            
-      throw new IllegalStateException("JBoss Remoting wireformat must not be used");
-   }
-      
-   public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
-   {
-      return null;
-   }
-
-   public void setClassLoader(ClassLoader classloader)
-   {
-   }
-
-   // Public ---------------------------------------------------------------------------------------
-
-   // Package protected ----------------------------------------------------------------------------
-
-   // Protected ------------------------------------------------------------------------------------
-
-   // Private --------------------------------------------------------------------------------------      
-
-   // Inner classes --------------------------------------------------------------------------------
-}

Modified: branches/Branch_JBMESSAGING-544/tests/src/org/jboss/test/messaging/tools/container/ServiceContainer.java
===================================================================
--- branches/Branch_JBMESSAGING-544/tests/src/org/jboss/test/messaging/tools/container/ServiceContainer.java	2007-12-06 15:41:49 UTC (rev 3429)
+++ branches/Branch_JBMESSAGING-544/tests/src/org/jboss/test/messaging/tools/container/ServiceContainer.java	2007-12-06 16:36:16 UTC (rev 3430)
@@ -60,14 +60,11 @@
 import org.hsqldb.persist.HsqlProperties;
 import org.jboss.jms.jndi.JMSProviderAdapter;
 import org.jboss.jms.jndi.JNDIProviderAdapter;
-import org.jboss.jms.server.ServerPeer;
-import org.jboss.jms.server.remoting.JMSServerInvocationHandler;
 import org.jboss.logging.Logger;
 import org.jboss.messaging.core.remoting.internal.MinaService;
 import org.jboss.messaging.util.JNDIUtil;
 import org.jboss.messaging.util.XMLUtil;
 import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.ServerInvocationHandler;
 import org.jboss.remoting.transport.PortUtil;
 import org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory;
 import org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService;
@@ -1398,13 +1395,6 @@
       mbeanServer.registerMBean(mbean, objectName);
       mbeanServer.invoke(objectName, "start", new Object[0], new String[0]);
 
-      ServerInvocationHandler handler = new JMSServerInvocationHandler();
-
-      mbeanServer.invoke(objectName, "addInvocationHandler",
-                         new Object[] { ServerPeer.REMOTING_JMS_SUBSYSTEM, handler},
-                         new String[] { "java.lang.String",
-                                        "org.jboss.remoting.ServerInvocationHandler"});
-
       log.debug("started " + objectName);
       
       if (!transport.equals("http"))




More information about the jboss-cvs-commits mailing list