[jboss-cvs] JBoss Messaging SVN: r5509 - in trunk/src/main/org/jboss/messaging/core/client: impl and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Dec 10 14:05:57 EST 2008


Author: timfox
Date: 2008-12-10 14:05:56 -0500 (Wed, 10 Dec 2008)
New Revision: 5509

Added:
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientFileMessageInternal.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManager.java
Removed:
   trunk/src/main/org/jboss/messaging/core/client/ConnectionManager.java
Modified:
   trunk/src/main/org/jboss/messaging/core/client/ClientConsumer.java
   trunk/src/main/org/jboss/messaging/core/client/ClientFileMessage.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerImpl.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerInternal.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientFileMessageImpl.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientProducerImpl.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionImpl.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManagerImpl.java
Log:
More cleanup of the public client API


Modified: trunk/src/main/org/jboss/messaging/core/client/ClientConsumer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/ClientConsumer.java	2008-12-10 18:46:23 UTC (rev 5508)
+++ trunk/src/main/org/jboss/messaging/core/client/ClientConsumer.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -22,8 +22,6 @@
 
 package org.jboss.messaging.core.client;
 
-import java.io.File;
-
 import org.jboss.messaging.core.exception.MessagingException;
 
 /**
@@ -47,8 +45,5 @@
    
    boolean isClosed();   
    
-
-   boolean isFileConsumer();
-
    Exception getLastException();
 }

Modified: trunk/src/main/org/jboss/messaging/core/client/ClientFileMessage.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/ClientFileMessage.java	2008-12-10 18:46:23 UTC (rev 5508)
+++ trunk/src/main/org/jboss/messaging/core/client/ClientFileMessage.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -41,11 +41,5 @@
 {
    File getFile();
 
-   void setFile(File file);
-   
-   void setLargeMessage(boolean largeMessage);
-
-   FileChannel getChannel() throws MessagingException;
-   
-   void closeChannel() throws MessagingException;   
+   void setFile(File file);   
 }

Deleted: trunk/src/main/org/jboss/messaging/core/client/ConnectionManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/ConnectionManager.java	2008-12-10 18:46:23 UTC (rev 5508)
+++ trunk/src/main/org/jboss/messaging/core/client/ConnectionManager.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * 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.messaging.core.client;
-
-import org.jboss.messaging.core.client.impl.ClientSessionInternal;
-import org.jboss.messaging.core.exception.MessagingException;
-
-/**
- * A ConnectionManager
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * 
- * Created 27 Nov 2008 18:45:46
- *
- *
- */
-public interface ConnectionManager
-{
-   ClientSession createSession(final String username,
-                               final String password,
-                               final boolean xa,
-                               final boolean autoCommitSends,
-                               final boolean autoCommitAcks,
-                               final boolean preAcknowledge,
-                               final int ackBatchSize,
-                               final int minLargeMessageSize,
-                               final boolean blockOnAcknowledge,
-                               final boolean autoGroup,
-                               final int sendWindowSize,
-                               final int consumerWindowSize,
-                               final int consumerMaxRate,
-                               final int producerMaxRate,
-                               final boolean blockOnNonPersistentSend,
-                               final boolean blockOnPersistentSend) throws MessagingException;
-
-   void removeSession(final ClientSessionInternal session);
-
-   int numConnections();
-
-   int numSessions();
-}

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerImpl.java	2008-12-10 18:46:23 UTC (rev 5508)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerImpl.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -363,7 +363,7 @@
 
       if (isFileConsumer())
       {
-         ClientFileMessage fileMessage = (ClientFileMessage)currentChunkMessage;
+         ClientFileMessageInternal fileMessage = (ClientFileMessageInternal)currentChunkMessage;
          addBytesBody(fileMessage, chunk.getBody());
       }
       else
@@ -389,15 +389,15 @@
          // Close the file that was being generated
          if (isFileConsumer())
          {
-            ((ClientFileMessage)currentChunkMessage).closeChannel();
+            ((ClientFileMessageInternal)currentChunkMessage).closeChannel();
          }
-         
+
          currentChunkMessage.setFlowControlSize(chunk.getBody().length);
 
          ClientMessageInternal msgToSend = currentChunkMessage;
-         
+
          currentChunkMessage = null;
-         
+
          handleMessage(msgToSend);
       }
    }
@@ -692,7 +692,7 @@
       }
    }
 
-   private void addBytesBody(final ClientFileMessage fileMessage, final byte[] body) throws Exception
+   private void addBytesBody(final ClientFileMessageInternal fileMessage, final byte[] body) throws Exception
    {
       FileChannel channel = fileMessage.getChannel();
       channel.write(ByteBuffer.wrap(body));

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerInternal.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerInternal.java	2008-12-10 18:46:23 UTC (rev 5508)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerInternal.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -57,5 +57,6 @@
    void acknowledge(ClientMessage message) throws MessagingException;
    
    void flushAcks() throws MessagingException;
-
+   
+   boolean isFileConsumer();
 }

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientFileMessageImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientFileMessageImpl.java	2008-12-10 18:46:23 UTC (rev 5508)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientFileMessageImpl.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -29,7 +29,6 @@
 import java.nio.ByteBuffer;
 import java.nio.channels.FileChannel;
 
-import org.jboss.messaging.core.client.ClientFileMessage;
 import org.jboss.messaging.core.exception.MessagingException;
 import org.jboss.messaging.core.remoting.spi.MessagingBuffer;
 
@@ -42,7 +41,7 @@
  *
  *
  */
-public class ClientFileMessageImpl extends ClientMessageImpl implements ClientFileMessage
+public class ClientFileMessageImpl extends ClientMessageImpl implements ClientFileMessageInternal
 {
    private File file;
 

Added: trunk/src/main/org/jboss/messaging/core/client/impl/ClientFileMessageInternal.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientFileMessageInternal.java	                        (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientFileMessageInternal.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * 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.messaging.core.client.impl;
+
+import java.nio.channels.FileChannel;
+
+import org.jboss.messaging.core.client.ClientFileMessage;
+import org.jboss.messaging.core.exception.MessagingException;
+
+/**
+ * A ClientFileMessageInternal
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * 
+ * Created 10 Dec 2008 19:02:06
+ *
+ *
+ */
+public interface ClientFileMessageInternal extends ClientFileMessage
+{
+   void setLargeMessage(boolean largeMessage);
+
+   FileChannel getChannel() throws MessagingException;
+   
+   void closeChannel() throws MessagingException;   
+}

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientProducerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientProducerImpl.java	2008-12-10 18:46:23 UTC (rev 5508)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientProducerImpl.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -301,11 +301,12 @@
          pos += chunkLength;
       }
 
-      if (msg instanceof ClientFileMessage)
+      if (msg instanceof ClientFileMessageInternal)
       {
+         //FIXME - this is very ugly - do we really need an instanceof check???
          try
          {
-            ((ClientFileMessage)msg).closeChannel();
+            ((ClientFileMessageInternal)msg).closeChannel();
          }
          catch (Exception e)
          {

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java	2008-12-10 18:46:23 UTC (rev 5508)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -21,7 +21,6 @@
 
 import org.jboss.messaging.core.client.ClientSession;
 import org.jboss.messaging.core.client.ConnectionLoadBalancingPolicy;
-import org.jboss.messaging.core.client.ConnectionManager;
 import org.jboss.messaging.core.cluster.DiscoveryListener;
 import org.jboss.messaging.core.config.TransportConfiguration;
 import org.jboss.messaging.core.config.impl.ConfigurationImpl;

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionImpl.java	2008-12-10 18:46:23 UTC (rev 5508)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionImpl.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -38,7 +38,6 @@
 import org.jboss.messaging.core.client.ClientFileMessage;
 import org.jboss.messaging.core.client.ClientMessage;
 import org.jboss.messaging.core.client.ClientProducer;
-import org.jboss.messaging.core.client.ConnectionManager;
 import org.jboss.messaging.core.exception.MessagingException;
 import org.jboss.messaging.core.logging.Logger;
 import org.jboss.messaging.core.remoting.Channel;

Copied: trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManager.java (from rev 5498, trunk/src/main/org/jboss/messaging/core/client/ConnectionManager.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManager.java	                        (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManager.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * 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.messaging.core.client.impl;
+
+import org.jboss.messaging.core.client.ClientSession;
+import org.jboss.messaging.core.exception.MessagingException;
+
+/**
+ * A ConnectionManager
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * 
+ * Created 27 Nov 2008 18:45:46
+ *
+ *
+ */
+public interface ConnectionManager
+{
+   ClientSession createSession(final String username,
+                               final String password,
+                               final boolean xa,
+                               final boolean autoCommitSends,
+                               final boolean autoCommitAcks,
+                               final boolean preAcknowledge,
+                               final int ackBatchSize,
+                               final int minLargeMessageSize,
+                               final boolean blockOnAcknowledge,
+                               final boolean autoGroup,
+                               final int sendWindowSize,
+                               final int consumerWindowSize,
+                               final int consumerMaxRate,
+                               final int producerMaxRate,
+                               final boolean blockOnNonPersistentSend,
+                               final boolean blockOnPersistentSend) throws MessagingException;
+
+   void removeSession(final ClientSessionInternal session);
+
+   int numConnections();
+
+   int numSessions();
+}

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManagerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManagerImpl.java	2008-12-10 18:46:23 UTC (rev 5508)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManagerImpl.java	2008-12-10 19:05:56 UTC (rev 5509)
@@ -36,7 +36,6 @@
 import java.util.concurrent.locks.Lock;
 
 import org.jboss.messaging.core.client.ClientSession;
-import org.jboss.messaging.core.client.ConnectionManager;
 import org.jboss.messaging.core.config.TransportConfiguration;
 import org.jboss.messaging.core.exception.MessagingException;
 import org.jboss.messaging.core.logging.Logger;




More information about the jboss-cvs-commits mailing list