[jboss-cvs] JBoss Messaging SVN: r1616 - in branches/Branch_HTTP_Experiment: lib src/main/org/jboss/jms/client/remoting src/main/org/jboss/jms/server/endpoint src/main/org/jboss/jms/server/remoting tests tests/src/org/jboss/test/messaging/jms

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 21 21:29:45 EST 2006


Author: ovidiu.feodorov at jboss.com
Date: 2006-11-21 21:29:19 -0500 (Tue, 21 Nov 2006)
New Revision: 1616

Removed:
   branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java
Modified:
   branches/Branch_HTTP_Experiment/lib/jboss-remoting.jar
   branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/CallbackManager.java
   branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java
   branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
   branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
   branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java
   branches/Branch_HTTP_Experiment/tests/build.xml
   branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java
Log:
got rid of acknowledging callbacks

Modified: branches/Branch_HTTP_Experiment/lib/jboss-remoting.jar
===================================================================
(Binary files differ)

Modified: branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/CallbackManager.java
===================================================================
--- branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/CallbackManager.java	2006-11-22 01:57:33 UTC (rev 1615)
+++ branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/CallbackManager.java	2006-11-22 02:29:19 UTC (rev 1616)
@@ -52,6 +52,8 @@
 
    protected static final Logger log = Logger.getLogger(CallbackManager.class);
 
+   public static final String JMS_CALLBACK_SUBSYSTEM = "CALLBACK";
+
    // Static --------------------------------------------------------
 
    protected static CallbackManager theManager;

Deleted: branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java
===================================================================
--- branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java	2006-11-22 01:57:33 UTC (rev 1615)
+++ branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java	2006-11-22 02:29:19 UTC (rev 1616)
@@ -1,35 +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.client.remoting;
-
-
-/**
- * @author <a href="tim.fox at jboss.com">Tim Fox</a>
- * @version $Revision$
- *
- * $Id$
- */
-public class CallbackServerFactory
-{
-   public static final String JMS_CALLBACK_SUBSYSTEM = "CALLBACK";
-}
-

Modified: branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java
===================================================================
--- branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java	2006-11-22 01:57:33 UTC (rev 1615)
+++ branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java	2006-11-22 02:29:19 UTC (rev 1616)
@@ -65,7 +65,7 @@
    // Constructors --------------------------------------------------
 
    public JMSRemotingConnection(String serverLocatorURI, boolean clientPing) throws Throwable
-   { 
+   {
       serverLocator = new InvokerLocator(serverLocatorURI);
       this.clientPing = clientPing;
 
@@ -94,7 +94,7 @@
       // every time which is very slow - see org.jboss.remoting.transport.socket.ProcessInvocation
       // This can make a massive difference on performance. We also do this in
       // ServerConnectionEndpoint.setCallbackClient.
-         
+
       client.setMarshaller(new JMSWireFormat());
       client.setUnMarshaller(new JMSWireFormat());
 
@@ -107,14 +107,18 @@
          HashMap metadata = new HashMap();
          metadata.put(InvokerLocator.DATATYPE, "jms");
          metadata.put(InvokerLocator.SERIALIZATIONTYPE, "jms");
-         
+
          String bindAddress = System.getProperty("jboss.messaging.callback.bind.address");
          if (bindAddress != null)
+         {
             metadata.put(Client.CALLBACK_SERVER_HOST, bindAddress);
-         
+         }
+
          String propertyPort = System.getProperty("jboss.messaging.callback.bind.port");
          if (propertyPort != null)
+         {
             metadata.put(Client.CALLBACK_SERVER_PORT, propertyPort);
+         }
 
          client.addListener(callbackManager, metadata, null, true);
       }
@@ -122,16 +126,22 @@
       {
          if (log.isTraceEnabled()) log.trace("simulating push callbacks");
          HashMap metadata = new HashMap();
-         
-         String callbackPollPeriod = System.getProperty("jboss.messaging.callback.callbackPollPeriod");
+
+         String callbackPollPeriod = System.getProperty("jboss.messaging.callback.pollPeriod");
          if (callbackPollPeriod == null)
+         {
             callbackPollPeriod = CALLBACK_POLL_PERIOD_DEFAULT;
-         metadata.put(CallbackPoller.CALLBACK_POLL_PERIOD, callbackPollPeriod);  
-         
-         String reportPollingStatistics = System.getProperty("jboss.messaging.callback.reportPollingStatistics");
+         }
+         metadata.put(CallbackPoller.CALLBACK_POLL_PERIOD, callbackPollPeriod);
+
+         String reportPollingStatistics =
+            System.getProperty("jboss.messaging.callback.reportPollingStatistics");
+
          if (reportPollingStatistics != null)
+         {
             metadata.put(CallbackPoller.REPORT_STATISTICS, reportPollingStatistics);
-         
+         }
+
          client.addListener(callbackManager, metadata);
       }
 
@@ -147,8 +157,8 @@
 
       client.removeListener(callbackManager);
       client.disconnect();
-      
-      log.debug(this + " closed");      
+
+      log.debug(this + " closed");
    }
 
    public Client getInvokingClient()
@@ -171,7 +181,7 @@
    // Protected -----------------------------------------------------
 
    // Private -------------------------------------------------------
-   
+
    // Inner classes -------------------------------------------------
 
 }

Modified: branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
===================================================================
--- branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java	2006-11-22 01:57:33 UTC (rev 1615)
+++ branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java	2006-11-22 02:29:19 UTC (rev 1616)
@@ -33,7 +33,7 @@
 import javax.transaction.xa.Xid;
 
 import org.jboss.jms.client.delegate.ClientSessionDelegate;
-import org.jboss.jms.client.remoting.CallbackServerFactory;
+import org.jboss.jms.client.remoting.CallbackManager;
 import org.jboss.jms.delegate.SessionDelegate;
 import org.jboss.jms.destination.JBossDestination;
 import org.jboss.jms.message.JBossMessage;
@@ -438,7 +438,7 @@
          // TODO not sure if this is the best way to do this, but the callbackClient needs to have
          //      its "subsystem" set, otherwise remoting cannot find the associated
          //      ServerInvocationHandler on the callback server
-         callbackClient.setSubsystem(CallbackServerFactory.JMS_CALLBACK_SUBSYSTEM);
+         callbackClient.setSubsystem(CallbackManager.JMS_CALLBACK_SUBSYSTEM);
          
          // We explictly set the Marshaller since otherwise remoting tries to resolve the marshaller
          // every time which is very slow - see org.jboss.remoting.transport.socket.ProcessInvocation

Modified: branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2006-11-22 01:57:33 UTC (rev 1615)
+++ branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2006-11-22 02:29:19 UTC (rev 1616)
@@ -23,13 +23,11 @@
 
 
 import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
+import java.util.HashMap;
 
 import javax.jms.IllegalStateException;
 import javax.jms.InvalidSelectorException;
@@ -59,10 +57,7 @@
 import org.jboss.messaging.core.tx.TxCallback;
 import org.jboss.messaging.util.Future;
 import org.jboss.remoting.callback.Callback;
-import org.jboss.remoting.callback.CallbackListener;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
 import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
-import org.jboss.util.id.GUID;
 
 import EDU.oswego.cs.dl.util.concurrent.Executor;
 import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
@@ -77,7 +72,7 @@
  *
  * $Id$
  */
-public class ServerConsumerEndpoint implements Receiver, ConsumerEndpoint, CallbackListener
+public class ServerConsumerEndpoint implements Receiver, ConsumerEndpoint
 {
    // Constants -----------------------------------------------------
 
@@ -130,8 +125,6 @@
 
    private Map deliveries;
    
-   private Set pendingCallbacks;
-
    // Constructors --------------------------------------------------
 
    protected ServerConsumerEndpoint(int id, PagingFilteredQueue messageQueue, String queueName,
@@ -203,8 +196,6 @@
       // prompt delivery
       messageQueue.deliver(false);
       
-      this.pendingCallbacks = new HashSet();
-      
       log.debug(this + " constructed");
    }
 
@@ -455,8 +446,7 @@
          throw ExceptionUtil.handleJMSInvocation(t, this + " more");
       }
    }
-   
-   
+
    // Public --------------------------------------------------------
    
    public String toString()
@@ -645,13 +635,11 @@
          // Flush any messages waiting to be sent to the client.
          this.executor.execute(new Deliverer());
          
-         //Now wait for it to execute
-         synchronized (pendingCallbacks)
-         {
-            if (!pendingCallbacks.isEmpty())
-               pendingCallbacks.wait();
-         }
-             
+         // Now wait for it to execute.
+         Future result = new Future();
+         this.executor.execute(new Waiter(result));
+         result.getResult();
+
          // Now we know any deliverer has delivered any outstanding messages to the client buffer.
       }
       catch (InterruptedException e)
@@ -730,8 +718,7 @@
    {
       public void run()
       {
-         // Is there anything to deliver?
-         // This is ok outside lock - is volatile.
+         // Is there anything to deliver? This is ok outside lock - is volatile.
          if (clientConsumerFull)
          {
             if (trace) { log.trace(this + " client consumer full, do nothing"); }
@@ -765,40 +752,26 @@
 
          try
          {
-            if (trace) { log.trace(ServerConsumerEndpoint.this + " handing " + list.size() + " message(s) over to the remoting layer"); }
-
-            ClientDelivery del = new ClientDelivery(list, serverId, id);
-
             // TODO How can we ensure that messages for the same consumer aren't delivered
             // concurrently to the same consumer on different threads?
+            ClientDelivery del = new ClientDelivery(list, serverId, id);
             MessagingMarshallable mm = new MessagingMarshallable(connection.getUsingVersion(), del);
-
-            Map metadata = new HashMap();
-            metadata.put(ServerInvokerCallbackHandler.CALLBACK_LISTENER, ServerConsumerEndpoint.this);
-            String callbackId = new GUID().toString();
-            metadata.put(ServerInvokerCallbackHandler.CALLBACK_ID, callbackId);
-            metadata.put(ServerInvokerCallbackHandler.REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS, "true");
             Callback callback = new Callback(mm);
-            callback.setReturnPayload(metadata);
-            
-            synchronized (pendingCallbacks)
-            {
-               pendingCallbacks.add(callbackId);
-            }
-            
+
+            if (trace) { log.trace(ServerConsumerEndpoint.this + " handing " + list.size() + " message(s) over to the remoting layer"); }
+
             connection.getCallbackHandler().handleCallback(callback);
+
             if (trace) { log.trace(ServerConsumerEndpoint.this + " handed messages over to the remoting layer"); }
-//
-//            HandleMessageResponse result = (HandleMessageResponse)resp.getLoad();
-//
-//            // For now we don't look at how many messages are accepted since they all will be.
-//            // The field is a placeholder for the future.
-//            if (result.clientIsFull())
-//            {
-//               // Stop the server sending any more messages to the client.
-//               // This is ok outside lock.
-//               clientConsumerFull = true;
-//            }
+
+            // We are NOT using Remoting's facility of acknowledging callbacks. A callback is sent
+            // asynchronously, and there is no confirmation that the callback reached the client or
+            // not.
+
+            // TODO Previously, synchronous server-to-client invocations were used by the client
+            // to report back whether is full or not. This cannot be achieved with asynchronous
+            // callbacks, so the client must explicitely sent this information to the server,
+            // with an invocation on its own.
          }
          catch(Throwable t)
          {
@@ -894,20 +867,4 @@
          delList.add(new Long(messageID));
       }
    }
-   
-   /**
-    * To implement org.jboss.remoting.callback.CallbackListener
-    */
-   public void acknowledgeCallback(InvokerCallbackHandler callbackHandler, Object callbackId, Object response)
-   {
-      synchronized (pendingCallbacks)
-      {
-         if (!pendingCallbacks.remove(callbackId))
-            log.warn("callbackSent() received unknown CallbackId: " + callbackId);
-         
-         if (pendingCallbacks.isEmpty())
-            pendingCallbacks.notify();
-      }
-   }
-   
 }

Modified: branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java
===================================================================
--- branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java	2006-11-22 01:57:33 UTC (rev 1615)
+++ branches/Branch_HTTP_Experiment/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java	2006-11-22 02:29:19 UTC (rev 1616)
@@ -29,7 +29,6 @@
 import java.io.ObjectOutputStream;
 import java.io.OutputStream;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -38,8 +37,8 @@
 
 import org.jboss.aop.Dispatcher;
 import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.jms.client.remoting.CallbackServerFactory;
 import org.jboss.jms.client.remoting.HandleMessageResponse;
+import org.jboss.jms.client.remoting.CallbackManager;
 import org.jboss.jms.message.JBossMessage;
 import org.jboss.jms.server.ServerPeer;
 import org.jboss.jms.server.Version;
@@ -49,11 +48,9 @@
 import org.jboss.logging.Logger;
 import org.jboss.messaging.core.message.MessageFactory;
 import org.jboss.messaging.core.plugin.IdBlock;
-import org.jboss.remoting.Client;
 import org.jboss.remoting.InvocationRequest;
 import org.jboss.remoting.InvocationResponse;
 import org.jboss.remoting.callback.Callback;
-import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
 import org.jboss.remoting.invocation.InternalInvocation;
 import org.jboss.remoting.marshal.Marshaller;
 import org.jboss.remoting.marshal.UnMarshaller;
@@ -453,17 +450,20 @@
                Iterator it = callbackList.iterator();
                while (it.hasNext())
                {
-                  Callback callback = (Callback) it.next();
-                  Map payload = callback.getReturnPayload();
-                  String guid = (String)payload.get(ServerInvokerCallbackHandler.CALLBACK_ID);
-                  dos.writeUTF(guid);
-                  String listenerId = (String)payload.get(Client.LISTENER_ID_KEY);
-                  dos.writeUTF(listenerId);
-                  String acks = (String)payload.get(ServerInvokerCallbackHandler.REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS);
-                  dos.writeUTF(acks);
+                  Callback callback = (Callback)it.next();
+
+                  // We don't use acknowledgeable push callbacks
+
+//                  Map payload = callback.getReturnPayload();
+//                  String guid = (String)payload.get(ServerInvokerCallbackHandler.CALLBACK_ID);
+//                  dos.writeUTF(guid);
+//                  String listenerId = (String)payload.get(Client.LISTENER_ID_KEY);
+//                  dos.writeUTF(listenerId);
+//                  String acks = (String)payload.get(ServerInvokerCallbackHandler.REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS);
+//                  dos.writeUTF(acks);
                   
-                  MessagingMarshallable mm = (MessagingMarshallable) callback.getParameter();
-                  ClientDelivery delivery = (ClientDelivery) mm.getLoad();
+                  MessagingMarshallable mm = (MessagingMarshallable)callback.getParameter();
+                  ClientDelivery delivery = (ClientDelivery)mm.getLoad();
                   delivery.write(dos);
                   dos.flush();
                }
@@ -771,7 +771,7 @@
                InternalInvocation ii
                   = new InternalInvocation(InternalInvocation.HANDLECALLBACK, new Object[]{callback});
                InvocationRequest request
-                  = new InvocationRequest(sessionId, CallbackServerFactory.JMS_CALLBACK_SUBSYSTEM,
+                  = new InvocationRequest(sessionId, CallbackManager.JMS_CALLBACK_SUBSYSTEM,
                                           ii, null, null, null);
    
                if (trace) { log.trace("read callback()"); }
@@ -786,18 +786,20 @@
                ArrayList callbackList = new ArrayList(size);
                for (int i = 0; i < size; i++)
                {
-                  String guid = dis.readUTF();
-                  String listenerId = dis.readUTF();
-                  String acks = dis.readUTF();
+                  // We don't use acknowledgeable push callbacks
+
+//                  String guid = dis.readUTF();
+//                  String listenerId = dis.readUTF();
+//                  String acks = dis.readUTF();
                   ClientDelivery delivery = new ClientDelivery();
                   delivery.read(dis);
                   MessagingMarshallable mm = new MessagingMarshallable(version, delivery);
                   Callback callback = new Callback(mm);
-                  HashMap payload = new HashMap();
-                  payload.put(ServerInvokerCallbackHandler.CALLBACK_ID, guid);
-                  payload.put(Client.LISTENER_ID_KEY, listenerId);
-                  payload.put(ServerInvokerCallbackHandler.REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS, acks);
-                  callback.setReturnPayload(payload);
+//                  HashMap payload = new HashMap();
+//                  payload.put(ServerInvokerCallbackHandler.CALLBACK_ID, guid);
+//                  payload.put(Client.LISTENER_ID_KEY, listenerId);
+//                  payload.put(ServerInvokerCallbackHandler.REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS, acks);
+//                  callback.setReturnPayload(payload);
                   callbackList.add(callback);
                }
 

Modified: branches/Branch_HTTP_Experiment/tests/build.xml
===================================================================
--- branches/Branch_HTTP_Experiment/tests/build.xml	2006-11-22 01:57:33 UTC (rev 1615)
+++ branches/Branch_HTTP_Experiment/tests/build.xml	2006-11-22 02:29:19 UTC (rev 1616)
@@ -360,6 +360,7 @@
                <exclude name="**/jms/crash/*Test.class"/>
                <exclude name="**/jms/MemLeakTest.class"/>
                <exclude name="**/jms/ManualClusteringTest.class"/>
+               <exclude name="**/jms/RemotingConnectionConfigurationTest.class"/>
             </fileset>
          </batchtest>
       </junit>

Modified: branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java
===================================================================
--- branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java	2006-11-22 01:57:33 UTC (rev 1615)
+++ branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java	2006-11-22 02:29:19 UTC (rev 1616)
@@ -84,6 +84,9 @@
 
    // Public --------------------------------------------------------
 
+   /**
+    * It only makes sense to run remote. Exclude it from "invm-tests" target configuration.
+    */
    public void testConnectionConfiguration() throws Exception
    {
       log.info("entering " + getName());
@@ -92,30 +95,32 @@
 
       try
       {
-         if (!ServerManagement.isRemote()) return;
-         
          int freePort = PortUtil.findFreePort(InetAddress.getLocalHost().getHostName());
          System.setProperty("jboss.messaging.callback.bind.port", Integer.toString(freePort));
+
          String pollPeriod = "654";
-         System.setProperty("jboss.messaging.callback.callbackPollPeriod", pollPeriod);
+         System.setProperty("jboss.messaging.callback.pollPeriod", pollPeriod);
          
-         connection = (JBossConnection) cf.createConnection();
+         connection = (JBossConnection)cf.createConnection();
          connection.start();
-         ClientConnectionDelegate delegate = (ClientConnectionDelegate) connection.getDelegate();
+
+         ClientConnectionDelegate delegate = (ClientConnectionDelegate)connection.getDelegate();
          JMSRemotingConnection remotingConnection = delegate.getRemotingConnection();
          Client client = remotingConnection.getInvokingClient();
+
          Field field = JMSRemotingConnection.class.getDeclaredField("serverLocator");
          field.setAccessible(true);
-         InvokerLocator locator = (InvokerLocator) field.get(remotingConnection);
+         InvokerLocator locator = (InvokerLocator)field.get(remotingConnection);
          String transport = locator.getProtocol();
          
          if ("socket".equals(transport))
          {
             field = Client.class.getDeclaredField("callbackConnectors");
             field.setAccessible(true);
-            Map callbackConnectors = (Map) field.get(client);
+            Map callbackConnectors = (Map)field.get(client);
+
             InvokerCallbackHandler callbackHandler = remotingConnection.getCallbackManager();
-            Connector connector = (Connector) callbackConnectors.get(callbackHandler);
+            Connector connector = (Connector)callbackConnectors.get(callbackHandler);
             locator = new InvokerLocator(connector.getInvokerLocator());
             assertEquals(freePort, locator.getPort());
          }
@@ -123,27 +128,28 @@
          {
             field = Client.class.getDeclaredField("callbackPollers");
             field.setAccessible(true);
-            CallbackPoller callbackPoller = (CallbackPoller) field.get(client);
+            Map callbackPollers = (Map)field.get(client);
+            assertEquals(1, callbackPollers.size());
+
+            CallbackPoller callbackPoller =
+               (CallbackPoller)callbackPollers.values().iterator().next();
+
             field = CallbackPoller.class.getDeclaredField("pollPeriod");
             field.setAccessible(true);
-            assertEquals(((Integer) field.get(callbackPoller)).intValue(), Integer.parseInt(pollPeriod));
+
+            assertEquals(pollPeriod, ((Long)field.get(callbackPoller)).toString());
          }
          else
          {
-            log.error("Unrecognized transport: " + transport);
-            fail();
+            fail("Unrecognized transport: " + transport);
          }
       }
-      catch (Exception e)
-      {
-         log.error(e);
-         log.error(getName() + " FAILS");
-      }
       finally
       {
-         log.trace("closing connections ...");
-         if (connection != null) connection.close();
-         log.info(getName() + " PASSES");
+         if (connection != null)
+         {
+            connection.close();
+         }
       }
    }
 }




More information about the jboss-cvs-commits mailing list